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