Skip to content

(experimental) diff --quote-path-with-sp

Junio C Hamano git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2diff: simplify quote_two()diff.c+1 -110 replies
2/2diff: --quote-path-with-spDocumentation/diff-options.txt diff.c diff.h +3 more+59 -132 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] (experimental) diff --quote-path-with-sp

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"

We have always done this enclosing inside dq when the pathname had an even more difficult byte (like LF, double quotes, and HT), so we know Git tools can handle such a patch output just fine already.

*1* https://lore.kernel.org/git/[email protected]/
*2* https://lore.kernel.org/git/YR9Iaj%[email protected]/

Junio C Hamano (2):
diff: simplify quote_two()
diff: --quote-path-with-sp

 Documentation/diff-options.txt |  5 +++++
 diff.c                         | 26 ++++++++++----------------
 diff.h                         |  1 +
 quote.c                        | 23 ++++++++++++++++++-----
 quote.h                        |  3 ++-
 t/t3902-quoted.sh              | 24 +++++++++++++++++++++++-
 6 files changed, 59 insertions(+), 23 deletions(-)
Signature · 1 line
2.33.0-649-gd4f4107c2b