Re: git add -p doesn't honor diff.noprefix config

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

 



On Sat, Dec 03, 2016 at 07:45:18AM +0100, paddor wrote:

> I set the config diff.noprefix = true because I don't like the a/ and
> b/ prefixes, which nicely changed the output of `git diff`.
> Unfortunately, the filenames in the output of `git add --patch` are
> still prefixed.
> 
> To me, this seems like a bug. Or there's a config option missing.

The interactive-add process is a perl script built around plumbing
commands like diff-tree, diff-files, etc.  Plumbing commands do not
respect some config options, so that the output remains stable or
scripts built around them. And diff.noprefix is one of these. So scripts
have to get the value themselves and decide whether to pass it along to
the plumbing.

In this case, I think there are two steps needed:

  1. Confirm that git-add--interactive.perl can actually handle
     no-prefix patches. It feeds the patches back to git-apply, which
     may be a complication (so it may need, for example, to pass a
     special flag to git-apply).

  2. git-add--interactive.perl needs to parse the config value, and if
     set, pass the appropriate option to the diff plumbing. This should
     only be one or two lines; see how $diff_algorithm is handled in
     that script.

-Peff



[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]