GNU bug report logs - #66095
diff quoting for names with spaces changed after v3.10-171-g69ae797392

Previous Next

Package: diffutils;

Reported by: Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>

Date: Mon, 18 Sep 2023 22:13:01 UTC

Severity: normal

To reply to this bug, email your comments to 66095 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#66095; Package diffutils. (Mon, 18 Sep 2023 22:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Mon, 18 Sep 2023 22:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>
To: bug-diffutils <at> gnu.org
Subject: diff quoting for names with spaces changed after v3.10-171-g69ae797392
Date: Tue, 19 Sep 2023 01:00:52 +0400
Hi,

Following the commit v3.10-171-g69ae797392 ("cmp,diff,diff3,sdiff: quote
more consistently") the quoting changed as follows:

$ diff --version | head -1
diff (GNU diffutils) 3.10.171-69ae7
$ diff -u with\ space/1 with\ space/2
--- 'with space/1'	1970-01-01 00:00:00.000000000 +0000
+++ 'with space/2'	1970-01-01 00:00:00.000000000 +0000
@@ -1 +1 @@
-1
+2

In the previous commit, it appeared as follows:

$ diff --version | head -1
diff (GNU diffutils) 3.10.170-23d50
$ diff -u with\ space/1 with\ space/2
--- "with space/1"	1970-01-01 00:00:00.000000000 +0000
+++ "with space/2"	1970-01-01 00:00:00.000000000 +0000
@@ -1 +1 @@
-1
+2

Unlike the old quoting (with quotation marks), the new quoting (with
apostrophes) is not supported by GNU patch:

can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- 'with space/1'     1970-01-01 00:00:00.000000000 +0000
|+++ 'with space/2'     1970-01-01 00:00:00.000000000 +0000
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored


This regression was discovered using the Quilt testsuite:

[124] $ quilt push -qa -- failed
Applying patch patches/foo.diff       == Applying patch patches/foo.diff
The text leading up to this was:      != Applying patch patches/revert.diff
--------------------------            != Applying patch patches/again.diff
|--- 'space [dir]/foo.orig'     2023-09-15 18:02:57.623257723 +0000 != Now at patch patches/again.diff
|+++ 'space [dir]/foo'  2023-09-15 18:02:57.625257744 +0000 != ~
--------------------------            != ~
No file to patch.  Skipping patch.    != ~
1 out of 1 hunk ignored               != ~
Patch patches/foo.diff does not apply (enforce with -f) != ~
[129] $ cd .. -- ok
[130] $ rm -rf "space [dir]" -- ok
64 commands (63 passed, 1 failed)
make: *** [Makefile:412: test/.setup.ok] Error 1

-- 
glebfm




Information forwarded to bug-diffutils <at> gnu.org:
bug#66095; Package diffutils. (Tue, 19 Sep 2023 12:07:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Grünbacher <agruen <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: bug-diffutils <at> gnu.org, Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>,
 66095 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#66095: diff quoting for names with spaces
 changed after v3.10-171-g69ae797392
Date: Tue, 19 Sep 2023 14:05:39 +0200
Hello Paul,

I don't know how this change could end up being applied to diffutils,
but commit 69ae797 ("cmp,diff,diff3,sdiff: quote more consistently")
breaks compatibility with GNU patch  and other consumers without a
discussion, warning, or lead time to at least adjust all the major
consumers first. That's not acceptable, so could you please revert
this change?

The particular quoting style that you seem to object to was introduced
in commit e17295d ("diff: encode file names with special characters").
At the time, "git diff" had already been using this format for years,
so there was already considerable precedent for not inventing
something new. And I believe this argument still applies.

Thanks,
Andreas

Am Di., 19. Sept. 2023 um 00:13 Uhr schrieb Gleb
Fotengauer-Malinovskiy <glebfm <at> altlinux.org>:
>
> Hi,
>
> Following the commit v3.10-171-g69ae797392 ("cmp,diff,diff3,sdiff: quote
> more consistently") the quoting changed as follows:
>
> $ diff --version | head -1
> diff (GNU diffutils) 3.10.171-69ae7
> $ diff -u with\ space/1 with\ space/2
> --- 'with space/1'      1970-01-01 00:00:00.000000000 +0000
> +++ 'with space/2'      1970-01-01 00:00:00.000000000 +0000
> @@ -1 +1 @@
> -1
> +2
>
> In the previous commit, it appeared as follows:
>
> $ diff --version | head -1
> diff (GNU diffutils) 3.10.170-23d50
> $ diff -u with\ space/1 with\ space/2
> --- "with space/1"      1970-01-01 00:00:00.000000000 +0000
> +++ "with space/2"      1970-01-01 00:00:00.000000000 +0000
> @@ -1 +1 @@
> -1
> +2
>
> Unlike the old quoting (with quotation marks), the new quoting (with
> apostrophes) is not supported by GNU patch:
>
> can't find file to patch at input line 3
> Perhaps you used the wrong -p or --strip option?
> The text leading up to this was:
> --------------------------
> |--- 'with space/1'     1970-01-01 00:00:00.000000000 +0000
> |+++ 'with space/2'     1970-01-01 00:00:00.000000000 +0000
> --------------------------
> File to patch:
> Skip this patch? [y]
> Skipping patch.
> 1 out of 1 hunk ignored
>
>
> This regression was discovered using the Quilt testsuite:
>
> [124] $ quilt push -qa -- failed
> Applying patch patches/foo.diff       == Applying patch patches/foo.diff
> The text leading up to this was:      != Applying patch patches/revert.diff
> --------------------------            != Applying patch patches/again.diff
> |--- 'space [dir]/foo.orig'     2023-09-15 18:02:57.623257723 +0000 != Now at patch patches/again.diff
> |+++ 'space [dir]/foo'  2023-09-15 18:02:57.625257744 +0000 != ~
> --------------------------            != ~
> No file to patch.  Skipping patch.    != ~
> 1 out of 1 hunk ignored               != ~
> Patch patches/foo.diff does not apply (enforce with -f) != ~
> [129] $ cd .. -- ok
> [130] $ rm -rf "space [dir]" -- ok
> 64 commands (63 passed, 1 failed)
> make: *** [Makefile:412: test/.setup.ok] Error 1
>
> --
> glebfm
>
>
>




Information forwarded to bug-diffutils <at> gnu.org:
bug#66095; Package diffutils. (Tue, 19 Sep 2023 12:07:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-diffutils <at> gnu.org:
bug#66095; Package diffutils. (Wed, 20 Sep 2023 07:14:01 GMT) Full text and rfc822 format available.

Message #14 received at 66095 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>
Cc: Andreas Grünbacher <agruen <at> gnu.org>, 66095 <at> debbugs.gnu.org
Subject: Re: bug#66095: diff quoting for names with spaces changed after
 v3.10-171-g69ae797392
Date: Wed, 20 Sep 2023 00:13:36 -0700
[Message part 1 (text/plain, inline)]
Thanks for reporting that. I had forgotten about the GNU patch 
convention. I installed the attached change to GNU diffutils; please 
give it a try.

GNU patch still mishandles file names containing multi-byte characters 
in some non-UTF-8 locales, but that can be fixed later when someone gets 
around to it.
[0001-diff-go-back-to-C-quoting-for-diff-c-u-headers.patch (text/x-patch, attachment)]

This bug report was last modified 1 year and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.