Re: [PATCH 2/2] diff: --quote-path-with-sp
From: Junio C Hamano <hidden>
Date: 2021-09-16 20:59:18
Ævar Arnfjörð Bjarmason [off-list ref] writes:
On Wed, Sep 15 2021, Junio C Hamano wrote: [CC-ing Andreas Gruenbacher who's currently active in GNU patch development, and Paul Eggert at his current address, in case he's curious about this blast from the past. Both: The full context for this proposed change in Git is at https://lore.kernel.org/git/20210915223316.1653443-1-gitster@pobox.com/ (local)]quoted
Long time ago, we had a discussion with GNU patch/diff maintainer and agreed that pathnames with certain "difficult" bytes needs to be quoted to ensure the resulting patch is machine parseable in an unambiguous way [*1*]. Recently, we saw a report that found that GNU patch is unhappy with our diff output for a path with SP in it [*2*].It would also be good to mention 4f6fbcdcf96 ...
Ah, I didn't mean "this is the single message to understand the issue". The reference was meant as "you need to read the discussion that starts around here", which you apparently did ;-) There is another message that is much more relevant that does not appear in the thread (and I do not know its message ID), where Linus came up with a way to parse the "diff --git a/... b/..." line, or the first "--- a/..." and "+++ b/..." lines, and learn the pathnames on the preimage side and on the postimage side unambiguously. I think that discovery led to the current implementation.