Re: RFE: Split diff.noprefix for git-diff and git-format-patch
From: Junio C Hamano <hidden>
Date: 2021-12-02 17:20:53
Jan Engelhardt [off-list ref] writes:
In interactive git-diff invocations, prefixless is the arguably desired mode, so as to facilitate xterm copy-and-paste of the pathname (since a/ does not exist, you would want to have it in the copypaste operation anywhere). I can see why git-format-patch would make use of the "diff.noprefix" config directive, but equally, it's a bug that diff.noprefix has such broad implications and that there is no way to distinguish between diff and format-patch.
I do not think it is unthinkable to have "log.*" configuration variables that mirror "diff.*" configuration variables and have them override the broader "diff.*" counterparts, and further add "format.*" configuration variables to do the same as even narrower override. I do not offhand recall hearing anybody who wanted format.noprefix separately in the past, and I take it a sign that people are happy with paths with prefix in their "interactive" invocations. I of course am among those, as that is most of the diff snippet I send to the list are created when I say "how about doing it this way" in my response and tell "\C-u \M-! git diff --stat -p" to Emacs to include the output from the command to the message I am composing.