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

Re: git-diff-tree -z HEAD | git-diff-helper -z fails for me

From
Linus Torvalds <torvalds@osdl.org>
Date
May 23, 2005, 18:21 UTC
Message-ID
<Pine.LNX.4.58.0505231119570.2307@ppc970.osdl.org>
In-Reply-To
<7vwtpp6goy.fsf@assigned-by-dhcp.cox.net>
On Mon, 23 May 2005, Junio C Hamano wrote:
Show 11 quoted lines
> 
> Tg> 	(faui00u) [~/work/git/yagf] git-diff-tree -z HEAD | git-diff-helper -z
> Tg> 	03c70739ae572ea9832b97dfcf9ca2594702efe8 (from 30e756ea8569bb429b7073b304acd8a960f77e4b)
> Tg> 	:100755 100755 f2e04c3b45b2a5ab5cf53228025158902c9de5be b93fd0310e51eea4d48d42c6ad83399cff8ab56egitgit(faui00u) [~/work/git/yagf]
> 
> Tg> What I am doing wrong here?
> 
> Nothing.  I'm an idiot.
> 
> Linus, do you mind if I say with "-z" git-diff-tree should not
> do _any_ header thing?

How about instead making sure that any "extra" text be NUL-terminated and never start with ':' after a NUL (which will automatically be true, since it's either "diff-tree " + ascii for the verbose case, or just the tree name).

That way git-diff-helper automatically does the right thing when it just passes lines (where "lines" is defined as being NUL-terminated) that it doesn't understand through unmodified.

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 10 in “git-diff-tree -z HEAD | git-diff-helper -z fails for me”
  1. Thomas GlanzmannMay 23, 2005
  2. Junio C HamanoMay 23, 2005
  3. Linus TorvaldsMay 23, 2005
  4. Junio C HamanoMay 23, 2005
  5. Junio C HamanoMay 23, 2005
  6. Linus TorvaldsMay 23, 2005
  7. Junio C HamanoMay 24, 2005
  8. Fix diff-pruning logic which was running prune too early.Junio C Hamano, May 24, 2005
  9. interim report on a big screwup with diff -M and -C.Junio C Hamano, May 24, 2005
  10. Redo rename/copy detection logic.Junio C Hamano, May 24, 2005

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.