Skip to contentSkip to conversation

git check-attr -z and quoting

DISCUSSION Joey Hess 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

Joey Hess

author
#0 lore raw

First, thanks to all for supporting -z in various commands like git ls-files and git diff. Big help for plumbing, as I'm sure you know.

But, git check-attr -z only enables NUL separation of its input; output always has munged pathnames. This bit me trying to use it as plumbing.

Signature · 1 line
see shy jo
#1 lore raw
Quoted 5 lines · Joey Hess

First, thanks to all for supporting -z in various commands like git ls-files and git diff. Big help for plumbing, as I'm sure you know.

But, git check-attr -z only enables NUL separation of its input; output always has munged pathnames. This bit me trying to use it as plumbing.

What do you mean by munged pathnames? As long as the path doesn't contain the sequence ": " it seems like the output should be unambiguous.

-Kevin Ballard

author
#2 lore raw
Quoted 9 lines · Kevin Ballard
Quoted 5 lines · Joey Hess

First, thanks to all for supporting -z in various commands like git ls-files and git diff. Big help for plumbing, as I'm sure you know.

But, git check-attr -z only enables NUL separation of its input; output always has munged pathnames. This bit me trying to use it as plumbing.

What do you mean by munged pathnames? As long as the path doesn't contain the sequence ": " it seems like the output should be unambiguous.

Quoted with quote_c_style()

$ perl -e 'print shift()."\n\0"' '¡hello!' | git check-attr eol -z --stdin
"\302\241hello!\n": foo: unspecified

Maybe -Z could enable this output:

¡hello!\n\0foo\0unspecified\0

Signature · 1 line
see shy jo