git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Gwyneth Morgan <gwymor@tilde.club>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/2] (experimental) diff --quote-path-with-sp
Date: Wed, 15 Sep 2021 22:31:51 -0700	[thread overview]
Message-ID: <xmqqh7elulvc.fsf@gitster.g> (raw)
In-Reply-To: <YUK7Bl9uzNE1YErg@tilde.club> (Gwyneth Morgan's message of "Thu, 16 Sep 2021 03:33:26 +0000")

Gwyneth Morgan <gwymor@tilde.club> writes:

> On 2021-09-15 15:33:14-0700, Junio C Hamano wrote:
>> 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*].
>> 
>> With this experimental option, the beginning part of the patch
>> output will have pathnames with SP in them enclosed inside a pair of
>> double quotes, like so:
>> 
>> 	diff --git "a/A Name" "b/A Name"
>> 	--- "a/A Name"
>> 	+++ "b/A Name"
>
> I believe GNU patch is fine with unquoted spaces in the "--- a/path"
> and "+++ b/path", and only has an issue with unquoted spaces in the
> "diff --git" line. busybox patch does seem to have an issue with quoted
> filenames in the "---" and "+++" lines but is fine if those lines are
> unquoted. Maybe we could leave spaces unquoted in those lines, only
> quoted if there's some other character that needs it.

Well, if they are so inconsistent, perhaps we shouldn't bend over
backwards to cater to them, I would have to say.  I do not think we
want to break the convention that these a/ & b/ labeled paths are
spelled exactly the same way, only to please external tools.

Thanks for a quick report.

      reply	other threads:[~2021-09-16  5:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 22:33 [PATCH 0/2] (experimental) diff --quote-path-with-sp Junio C Hamano
2021-09-15 22:33 ` [PATCH 1/2] diff: simplify quote_two() Junio C Hamano
2021-09-15 22:33 ` [PATCH 2/2] diff: --quote-path-with-sp Junio C Hamano
2021-09-16  9:06   ` Ævar Arnfjörð Bjarmason
2021-09-16 20:59     ` Junio C Hamano
2021-09-16  3:33 ` [PATCH 0/2] (experimental) diff --quote-path-with-sp Gwyneth Morgan
2021-09-16  5:31   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqh7elulvc.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gwymor@tilde.club \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).