Thread (5 messages) flat view 5 messages, 4 authors, 2016-06-15

Re: Bug: `gitsubmodule` does not list modules with unicode characters

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:57:36
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

Fredrik Gustafsson wrote:
I've looked into this a bit.
Thanks for investigating.

[...]
Why don't we always print names quoted? IMHO the choose of line
termination should not do anything else than alter the line termination.

However, an other solution would be to use git ls-files -z in
git-submodule.sh and then rewrite the perl-code to handle \0 instead
of \n.
The whole point of "-z" is that by using a terminator that is guaranteed
not to appear in filenames, it avoids the need to quote filenames.
Otherwise at least \n would need to be quoted.

How about something like this patch?

-- >8 --
Subject: ls-files doc: clarify purpose of "-z" option

The purpose of the "-z" option is to avoid quoting issues by using a
delimiter that implies a binary-clean parser and cannot appear in
filenames, and in that spirit, "-z" turns off C-style quoting.  But
without looking carefully through the entire manpage, it is too easy
to miss that.

Reported-by: Fredrik Gustafsson <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
 Documentation/git-ls-files.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
index c0856a6e..753c223f 100644
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -75,7 +75,9 @@ OPTIONS
 	succeed.
 
 -z::
-	\0 line termination on output.
+	Terminate lines with NUL instead of LF.
+	This avoids the need to quote filenames; see the Output section
+	below for details.
 
 -x <pattern>::
 --exclude=<pattern>::
-- 
1.8.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help