* git add -p doesn't honor diff.noprefix config
@ 2016-12-03 6:45 paddor
2016-12-06 13:56 ` Jeff King
0 siblings, 1 reply; 2+ messages in thread
From: paddor @ 2016-12-03 6:45 UTC (permalink / raw)
To: git
Hi all
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.
Best regards,
Patrik
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: git add -p doesn't honor diff.noprefix config
2016-12-03 6:45 git add -p doesn't honor diff.noprefix config paddor
@ 2016-12-06 13:56 ` Jeff King
0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2016-12-06 13:56 UTC (permalink / raw)
To: paddor; +Cc: git
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-06 13:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-03 6:45 git add -p doesn't honor diff.noprefix config paddor
2016-12-06 13:56 ` Jeff King
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).