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, 23:47 UTC
Message-ID
<Pine.LNX.4.58.0505231644560.2307@ppc970.osdl.org>
In-Reply-To
<7vpsvh3hp0.fsf@assigned-by-dhcp.cox.net>
On Mon, 23 May 2005, Junio C Hamano wrote:
Show 8 quoted lines
> 
> LT> How about instead making sure that any "extra" text be NUL-terminated and
> LT> never start with ':' after a NUL (which will automatically be true, since
> LT> it's either "diff-tree " + ascii for the verbose case, or just the tree
> LT> name).
> 
> Makes much more sense although it has certain amount of Yuck
> factor ;-).
Actually, your solution is the yucky one.

You didn't realize that your whole DIFF_FORMAT_MACHINE case really can be written as just

	printf("%s%c", header, 0);

ie you print the header as _one_ long line, instead of splitting it up into many. It's still a perfectly valid line, and perfectly unrecognizable as such.

Now, maybe diff-helper is unhappy about such long lines, but that should be solvable..

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 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.