Re: Fix "git log -z" behaviour
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 8, 2007, 22:34 UTC
- Message-ID
- <7v7iusz3c2.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0702071139090.8424@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> For the normal case where the termination character is '\n', this > obviously doesn't change anything at all, since we just switched two > identical characters around. So it's very safe - it doesn't change any > normal usage, but it definitely fixes "git log -z".
Gaah.
I have already applied this but I think this has fallout for existing users of "-z --raw". Nothing in-tree uses "git log" as the upstream of a pipe as far as I know because in-tree stuff tend to stick to plumbing when it comes to scripting, but I think your patch would affect the plumbing level as well.
Scripts that read from "-z --raw" have been expecting to get a record whose first 7 bytes are "commit " to be a log, which is followed by an arbitrary number of records whose first byte is ":" (and then it needs variable number of records to complete one diff record). This patch removes the separator NUL between the log message and the first diff record.