{"thread":{"id":"25618","subject":"git check-attr -z and quoting","startedAt":"2010-11-02T15:57:05Z","lastAt":"2010-11-02T22:10:29Z","messageCount":3,"participants":["Joey Hess","Kevin Ballard"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"154985","messageId":"20101102155705.GA17207@gnu.kitenet.net","threadId":"25618","inReplyTo":null,"subject":"git check-attr -z and quoting","fromName":"Joey Hess","fromEmail":"joey@kitenet.net","sentAt":"2010-11-02T15:57:05Z","receivedAt":"2010-11-02T15:57:05Z","isPatch":false,"sender":{"key":"joey@kitenet.net","avatar":"https://avatars.githubusercontent.com/u/16392?v=4"},"body":"First, thanks to all for supporting -z in various commands like \ngit ls-files and git diff. Big help for plumbing, as I'm sure you know.\n\nBut, git check-attr -z only enables NUL separation of its input; output\nalways has munged pathnames. This bit me trying to use it as plumbing.\n\n-- \nsee shy jo\n"},{"id":"155005","messageId":"7583D61F-64FA-44A8-B5C5-6E0FC329ED32@sb.org","threadId":"25618","inReplyTo":"20101102155705.GA17207@gnu.kitenet.net","subject":"Re: git check-attr -z and quoting","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-02T21:24:43Z","receivedAt":"2010-11-02T21:24:43Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 2, 2010, at 8:57 AM, Joey Hess wrote:\n\n> First, thanks to all for supporting -z in various commands like \n> git ls-files and git diff. Big help for plumbing, as I'm sure you know.\n> \n> But, git check-attr -z only enables NUL separation of its input; output\n> always has munged pathnames. This bit me trying to use it as plumbing.\n\nWhat do you mean by munged pathnames? As long as the path doesn't contain the sequence \": \" it seems like the output should be unambiguous.\n\n-Kevin Ballard"},{"id":"155006","messageId":"20101102221029.GA3646@gnu.kitenet.net","threadId":"25618","inReplyTo":"7583D61F-64FA-44A8-B5C5-6E0FC329ED32@sb.org","subject":"Re: git check-attr -z and quoting","fromName":"Joey Hess","fromEmail":"joey@kitenet.net","sentAt":"2010-11-02T22:10:29Z","receivedAt":"2010-11-02T22:10:29Z","isPatch":false,"sender":{"key":"joey@kitenet.net","avatar":"https://avatars.githubusercontent.com/u/16392?v=4"},"body":"Kevin Ballard wrote:\n> On Nov 2, 2010, at 8:57 AM, Joey Hess wrote:\n> \n> > First, thanks to all for supporting -z in various commands like \n> > git ls-files and git diff. Big help for plumbing, as I'm sure you know.\n> > \n> > But, git check-attr -z only enables NUL separation of its input; output\n> > always has munged pathnames. This bit me trying to use it as plumbing.\n> \n> 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.\n\nQuoted with quote_c_style()\n\n$ perl -e 'print shift().\"\\n\\0\"' '¡hello!' | git check-attr eol -z --stdin\n\"\\302\\241hello!\\n\": foo: unspecified\n\nMaybe -Z could enable this output:\n\n¡hello!\\n\\0foo\\0unspecified\\0\n\n-- \nsee shy jo\n"}]}