git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git cat-file --batch surprising carriage return behavior

From
Joey Hess <id@joeyh.name>
Date
Oct 9, 2019, 15:28 UTC
Message-ID
<20191009152851.GC19679@kitenet.net>
In-Reply-To
<20191008200050.GA26453@sigill.intra.peff.net>
Jeff King wrote:
> If we just add a new "-z", that's less disruptive_and_ easier to use.
Agreed. 
> I suspect it's not entirely sufficient for clean input, though. You're
> not feeding filenames but rather full "object names". I wouldn't be
> surprised if we mis-parse "$rev:$path" when $path has "@{}" or similar
> in it.

Nothing I've tried along the lines of "HEAD:{yesterday}" has misparsed the part after the colon as anything but a filename.

The one I can think of where there's a parse ambiguity is that while :foo gets file foo, :1:foo does not get file "1:foo". Instead it's treated as a stage number. Using either HEAD:1:foo or :./1:foo will avoid that ambiguity.

-- 
see shy jo
Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “git cat-file --batch surprising carriage return behavior”
  1. Joey HessOct 8, 2019
  2. Jeff KingOct 8, 2019
  3. Joey HessOct 9, 2019
  4. Jeff KingOct 11, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.