GNU bug report logs - #68695
Please, fix documentation on whitespace in pathnames

Previous Next

Package: diffutils;

Reported by: Matěj Cepl <mcepl <at> cepl.eu>

Date: Wed, 24 Jan 2024 19:16:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68695 in the body.
You can then email your comments to 68695 AT debbugs.gnu.org in the normal way.

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#68695; Package diffutils. (Wed, 24 Jan 2024 19:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matěj Cepl <mcepl <at> cepl.eu>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Wed, 24 Jan 2024 19:16:02 GMT) Full text and rfc822 format available.

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

From: Matěj Cepl <mcepl <at> cepl.eu>
To: <bug-diffutils <at> gnu.org>
Subject: Please, fix documentation on whitespace in pathnames
Date: Wed, 24 Jan 2024 19:55:02 +0100
[Message part 1 (text/plain, inline)]
https://www.gnu.org/software/diffutils/manual/html_node/Unusual-File-Names.html#Unusual%20File%20Names
still contains rather disturbing information, that diffutils are
incapable working with space in filenames/dirnames. I was just
deciding to stop using quilt because of that information, when I
was told clearly, that just the documentation is obsolete. Could
somebody fix that page, please?

Thank you,

Matěj Cepl

-- 
http://matej.ceplovi.cz/blog/, @mcepl <at> floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
And religious texts are a bit like software standards, the
interpretation is always the tricky and complicated bit.
    -- Alan Cox
-- 
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-diffutils <at> gnu.org:
bug#68695; Package diffutils. (Sun, 05 Jan 2025 17:45:01 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Matěj Cepl <mcepl <at> cepl.eu>
Cc: 68695 <at> debbugs.gnu.org, Andreas Gruenbacher <agruen <at> linbit.com>
Subject: Re: [bug-diffutils] bug#68695: Please, fix documentation on
 whitespace in pathnames
Date: Sun, 5 Jan 2025 09:44:20 -0800
On Wed, Jan 24, 2024 at 11:16 AM Matěj Cepl <mcepl <at> cepl.eu> wrote:
> https://www.gnu.org/software/diffutils/manual/html_node/Unusual-File-Names.html#Unusual%20File%20Names
> still contains rather disturbing information, that diffutils are
> incapable working with space in filenames/dirnames. I was just
> deciding to stop using quilt because of that information, when I
> was told clearly, that just the documentation is obsolete. Could
> somebody fix that page, please?

Thank you for reporting that. Here's the current text:

When a file name contains an unusual character like a newline or white
space, ‘diff -r’ generates a patch that ‘patch’ cannot parse.  The
problem is with format of ‘diff’ output, not just with ‘patch’, because
with odd enough file names one can cause ‘diff’ to generate a patch that
is syntactically correct but patches the wrong files.  The format of
‘diff’ output should be extended to handle all possible file names.

GNU diff's format now accommodates file names containing unusual
characters, GNU patch still fails to parse the resulting diff. Here's
a small demo:
This shows that the output format of diff -u **does** work with a
newline-afflicted file name:

$ f=$'a\na'; echo > "$f"; :>b; diff -u "$f" b
--- "a\na"      2025-01-05 09:32:36.678894920 -0800
+++ b   2025-01-05 09:32:36.678894920 -0800
@@ -1 +0,0 @@
-

Even "diff -r" encodes the unusually-named file:

$ mkdir -p 1 2; a=$'a\na'; echo > "1/$a"; :>"2/$a"; diff -r 1 2
diff -r "1/a\na" "2/a\na"
1d0
<

However, even the latest upstream version of GNU patch
(v2.7.6-202-g5bac274) cannot deal such an encoded file name:

$ f=$'a\na'; echo > "$f"; :>b; diff -u "$f" b |patch -R
patch: **** quoted string "a\n..." contains newline

So at the very least, I'll adjust the documentation to reflect the above.
Hoping that I can also soon say that upstream GNU patch handles these
encoded names.




Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Sun, 05 Jan 2025 19:51:02 GMT) Full text and rfc822 format available.

Notification sent to Matěj Cepl <mcepl <at> cepl.eu>:
bug acknowledged by developer. (Sun, 05 Jan 2025 19:51:02 GMT) Full text and rfc822 format available.

Message #13 received at 68695-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Matěj Cepl <mcepl <at> cepl.eu>
Cc: 68695-done <at> debbugs.gnu.org, Andreas Gruenbacher <agruen <at> linbit.com>
Subject: Re: [bug-diffutils] bug#68695: Please, fix documentation on
 whitespace in pathnames
Date: Sun, 5 Jan 2025 11:49:48 -0800
> So at the very least, I'll adjust the documentation to reflect the above.
> Hoping that I can also soon say that upstream GNU patch handles these
> encoded names.

Pushed the documentation change here:
https://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=dfaa846f093277db65944774497abb348e63760a
Marking this as "done".
Thanks again.




Information forwarded to bug-diffutils <at> gnu.org:
bug#68695; Package diffutils. (Mon, 06 Jan 2025 09:09:04 GMT) Full text and rfc822 format available.

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

From: Matěj Cepl <mcepl <at> cepl.eu>
To: "Jim Meyering" <jim <at> meyering.net>
Cc: 68695 <at> debbugs.gnu.org, Andreas Gruenbacher <agruen <at> linbit.com>
Subject: Re: [bug-diffutils] bug#68695: Please, fix documentation on
 whitespace in pathnames
Date: Sun, 05 Jan 2025 19:46:26 +0100
On Sun Jan 5, 2025 at 6:44 PM CET, Jim Meyering wrote:
> So at the very least, I'll adjust the documentation to reflect the above.
> Hoping that I can also soon say that upstream GNU patch handles these
> encoded names.

I would like just to emphasize that there are two distinct cases:
yes, filenames with $'\n' or $'\t' are really weird and unusual,
but filenames with a space are rather common. Even normal cpython
had (until recently: they apparently capitulated and replaced
spaces with underscores) directory
https://github.com/python/cpython/tree/3.9/Misc/NEWS.d/next/Core%20and%20Builtins,
which is part of every commit to the “Core and Builtins”
component of the Python interpreter.

-- 
http://matej.ceplovi.cz/blog/, @mcepl <at> en.osm.town
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
So many time, the attitude of my heart is: “God, just tell us
what to do so we can do it…without you.” Independently.
  -- Gretchen Konnevik: On Josh Harris, Homeschooling, and
     Spiritual Formulas; https://wp.me/p69TD5-1Xv





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 03 Feb 2025 12:24:18 GMT) Full text and rfc822 format available.

This bug report was last modified 191 days ago.

Previous Next


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