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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:58

quoted
quoted
quoted
quoted
"LT" == Linus Torvalds [off-list ref] writes:
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 ;-).

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

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:41:58


On Mon, 23 May 2005, Junio C Hamano wrote:
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help