Subject: Re: [PATCH 2/2] diff: --quote-path-with-sp

From: Junio C Hamano <[email-masked]>
Date: Thu, 16 Sep 2021 13:59:15 -0700

Ævar Arnfjörð Bjarmason <[email-masked]> 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/[email-masked]/]
>
>> 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.