{"thread":{"id":"44607","subject":"git add -p doesn't honor diff.noprefix config","startedAt":"2016-12-03T06:45:26Z","lastAt":"2016-12-06T13:56:55Z","messageCount":2,"participants":["paddor","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"306862","messageId":"E1D7329A-A54B-4D09-A72A-62ECA8005752@gmail.com","threadId":"44607","inReplyTo":null,"subject":"git add -p doesn't honor diff.noprefix config","fromName":"paddor","fromEmail":"paddor@gmail.com","sentAt":"2016-12-03T06:45:18Z","receivedAt":"2016-12-03T06:45:26Z","isPatch":false,"sender":{"key":"paddor@gmail.com","avatar":null},"body":"Hi all\n\nI 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.\n\nTo me, this seems like a bug. Or there's a config option missing.\n\nBest regards,\nPatrik"},{"id":"307007","messageId":"20161206135650.wv5cw3at4tqgpp6o@sigill.intra.peff.net","threadId":"44607","inReplyTo":"E1D7329A-A54B-4D09-A72A-62ECA8005752@gmail.com","subject":"Re: git add -p doesn't honor diff.noprefix config","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-12-06T13:56:50Z","receivedAt":"2016-12-06T13:56:55Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Dec 03, 2016 at 07:45:18AM +0100, paddor wrote:\n\n> I set the config diff.noprefix = true because I don't like the a/ and\n> b/ prefixes, which nicely changed the output of `git diff`.\n> Unfortunately, the filenames in the output of `git add --patch` are\n> still prefixed.\n> \n> To me, this seems like a bug. Or there's a config option missing.\n\nThe interactive-add process is a perl script built around plumbing\ncommands like diff-tree, diff-files, etc.  Plumbing commands do not\nrespect some config options, so that the output remains stable or\nscripts built around them. And diff.noprefix is one of these. So scripts\nhave to get the value themselves and decide whether to pass it along to\nthe plumbing.\n\nIn this case, I think there are two steps needed:\n\n  1. Confirm that git-add--interactive.perl can actually handle\n     no-prefix patches. It feeds the patches back to git-apply, which\n     may be a complication (so it may need, for example, to pass a\n     special flag to git-apply).\n\n  2. git-add--interactive.perl needs to parse the config value, and if\n     set, pass the appropriate option to the diff plumbing. This should\n     only be one or two lines; see how $diff_algorithm is handled in\n     that script.\n\n-Peff\n"}]}