git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* how to ignore whitespace changes with --color-moved (git diff move detection)?
@ 2018-02-02  2:13 Timothee Cour
  2018-02-02  6:51 ` Jeff King
  2018-02-02 18:23 ` Stefan Beller
  0 siblings, 2 replies; 3+ messages in thread
From: Timothee Cour @ 2018-02-02  2:13 UTC (permalink / raw)
  To: git, sbeller

this PR from october 2017 was discussing a patch that'd introduce
`--color-moved-[no-]ignore-space-change`
https://public-inbox.org/git/20171025224620.27657-3-sbeller@google.com/

however not sure what happened since then as I can't find in `git help
diff` options even after `brew install --HEAD git`

it's a really useful feature as it's a common use case (ppl move
blocks and reformat in same PR)

If it's not merged in git repo yet is there an easy way to try out
this feature? (even if experimental)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to ignore whitespace changes with --color-moved (git diff move detection)?
  2018-02-02  2:13 how to ignore whitespace changes with --color-moved (git diff move detection)? Timothee Cour
@ 2018-02-02  6:51 ` Jeff King
  2018-02-02 18:23 ` Stefan Beller
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2018-02-02  6:51 UTC (permalink / raw)
  To: timothee.cour2; +Cc: git, sbeller

On Thu, Feb 01, 2018 at 06:13:52PM -0800, Timothee Cour wrote:

> this PR from october 2017 was discussing a patch that'd introduce
> `--color-moved-[no-]ignore-space-change`
> https://public-inbox.org/git/20171025224620.27657-3-sbeller@google.com/
> 
> however not sure what happened since then as I can't find in `git help
> diff` options even after `brew install --HEAD git`
> 
> it's a really useful feature as it's a common use case (ppl move
> blocks and reformat in same PR)

I think you can still do "--color-moved -w" to ignore whitespace. It's
just that the defaults did not end up getting flipped.

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to ignore whitespace changes with --color-moved (git diff move detection)?
  2018-02-02  2:13 how to ignore whitespace changes with --color-moved (git diff move detection)? Timothee Cour
  2018-02-02  6:51 ` Jeff King
@ 2018-02-02 18:23 ` Stefan Beller
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Beller @ 2018-02-02 18:23 UTC (permalink / raw)
  To: timothee.cour2; +Cc: git

On Thu, Feb 1, 2018 at 6:13 PM, Timothee Cour <thelastmammoth@gmail.com> wrote:
> this PR from october 2017 was discussing a patch that'd introduce
> `--color-moved-[no-]ignore-space-change`
> https://public-inbox.org/git/20171025224620.27657-3-sbeller@google.com/
>
> however not sure what happened since then as I can't find in `git help
> diff` options even after `brew install --HEAD git`

I proposed it, but it wasn't going anywhere, because we seemed to have
a little disagreement over how a reasonable UX looks like.

The previous patch[1] in the series you link to, proposed 6 new
command line flags (3 flags + their negatives), which was deemed
inappropriate for the user ("which combination of these flags do you
need to give to get a good result?"), but I cannot find a reference for
that, I just vaguely recall that discussion.

[1] https://public-inbox.org/git/20171025224620.27657-2-sbeller@google.com/


> it's a really useful feature as it's a common use case (ppl move
> blocks and reformat in same PR)

Thanks for the encouraging words. For now you can
use '--color-moved -w' as Jeff King suggests, but that may
not be exactly what you want, because this
* creates the diff ignoring whitespaces
* and then colors the moved lines (also ignoring white spaces)
but when you want to
* obtain a real diff (no trickery with whitespaces)
* and then have some coloring aid ignoring white spaces
you are out of luck for now. Maybe you have a good idea for
the UX design? (What do we need there? Maybe an option
equivalent of `--color-moved-[no]-ignore-all-space` is sufficient
for all practical purposes?)

> If it's not merged in git repo yet is there an easy way to try out
> this feature? (even if experimental)

Can you compile Git yourself instead of installing it from homebrew?
(See "Build Git from source on OS X" on
https://www.atlassian.com/git/tutorials/install-git for example)
In that case, you can just patch your local version of Git with the
patches that you found. Download them as raw, and "git am"
them before running make.

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-02 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-02  2:13 how to ignore whitespace changes with --color-moved (git diff move detection)? Timothee Cour
2018-02-02  6:51 ` Jeff King
2018-02-02 18:23 ` Stefan Beller

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).