Re: how to ignore whitespace changes with --color-moved (git diff move detection)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 1, 2018 at 6:13 PM, Timothee Cour <thelastmammoth@xxxxxxxxx> 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@xxxxxxxxxx/
>
> 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@xxxxxxxxxx/


> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux