threads / discuss / 25618

git check-attr -z and quoting

Subject: git check-attr -z and quoting

## tl;dr

3 messages between Nov 2, 2010 and Nov 2, 2010.

replies: 2people: 2as markdown or json

Joey Hess· Nov 2, 2010, 15:57 UTC · lore

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.

-- 
see shy jo
Kevin Ballard· Nov 2, 2010, 21:24 UTC · re: Joey Hess · lore

Re: git check-attr -z and quoting

On Nov 2, 2010, at 8:57 AM, Joey Hess wrote:
Show 5 quoted lines
> 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
Joey Hess· Nov 2, 2010, 22:10 UTC · re: Kevin Ballard · lore

Re: git check-attr -z and quoting

Kevin Ballard wrote:
Show 9 quoted lines
> On Nov 2, 2010, at 8:57 AM, Joey Hess wrote:
> 
> > 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
-- 
see shy jo

← back to recent threads