From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Paul Eggert <eggert@cs.ucla.edu>,
Andreas Gruenbacher <agruen@gnu.org>,
Gwyneth Morgan <gwymor@tilde.club>
Subject: Re: [PATCH 2/2] diff: --quote-path-with-sp
Date: Thu, 16 Sep 2021 11:06:42 +0200 [thread overview]
Message-ID: <87ee9ohnqd.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <20210915223316.1653443-3-gitster@pobox.com>
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 (Functions to quote and
unquote pathnames in C-style., 2005-10-14) here, which is what came out
of the [*1*] discussion you're citing, and that also link to the later:
https://lore.kernel.org/git/7vll0wvb2a.fsf@assigned-by-dhcp.cox.net/
Where you quote a message of Paul Eggert's that didn't make it into the
archive, but which AFAICT accurately summarizes the behavior in
4f6fbcdcf96.
Whereas the [*1*] you linked to is still the early proposal of handling
UTF-8 specially (not quoting it), which doesn't appear to be what either
GNU patch or Git went for in the end (both fully quote some fairly
vanilla (also in latin1) UTF-8 when I tested it).
It's still not clear to me if what was agreed upon was accurately
implemented by Git at the time, but that GNU patch had a bug vis-a-vis
the desired discussed behavior, if the bug is Git's, or both etc. Does a
fix still need to be made in GNU patch?
There's also a mention of busybox's interaction with this behavior in
https://lore.kernel.org/git/YUK7Bl9uzNE1YErg@tilde.club/; has anyone
(you or Gwyneth) sent them an FYI about this in case they'd like to
adjust the behavior of their patch tool?
> Teach "git diff" and friends the "--quote-path-with-sp" option, that
> encloses a pathname with SP in it inside a pair of double-quotes,
> even though there is otherwise no byte in the pathname that need to
> be encoded in the octal.
>
> As an earlier parts of t/t3902 (outside the patch context) shows,
> output from "ls-files", "ls-tree", and "diff --name-only" all follow
> the same rule to decide paths with what bytes in them need quoting
> and how they are quoted.
>
> This experimental option deliberately refrains from touching these
> output and affects ONLY the paths that appear in the patch header,
> i.e. "diff --git", "--- a/path" and "+++ b/path" lines, that GNU
> patch may care. This is to minimize potential damage this change
> may cause to tools and scripts the users have been relying on.
>
> *1* https://lore.kernel.org/git/87ek6s0w34.fsf@penguin.cs.ucla.edu/
> *2* https://lore.kernel.org/git/YR9Iaj%2FFqAyCMade@tilde.club/
> [...patch omitted...]
next prev parent reply other threads:[~2021-09-16 9:30 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 [this message]
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
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=87ee9ohnqd.fsf@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=agruen@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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).