git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 16, 2021, 20:59 UTC
Message-ID
<xmqq35q4texo.fsf@gitster.g>
In-Reply-To
<87ee9ohnqd.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 17 quoted lines
> 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/]
>
>> 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.

Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 4 of 7 in “(experimental) diff --quote-path-with-sp”
  1. 0/2 (experimental) diff --quote-path-with-spJunio C Hamano, Sep 15, 2021
  2. 2/2 diff: --quote-path-with-spJunio C Hamano, Sep 15, 2021
  3. Ævar Arnfjörð BjarmasonSep 16, 2021
  4. Junio C HamanoSep 16, 2021
  5. 1/2 diff: simplify quote_two()Junio C Hamano, Sep 15, 2021
  6. Gwyneth MorganSep 16, 2021
  7. Junio C HamanoSep 16, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.