Re: Fix "git log -z" behaviour
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:53
Linus Torvalds [off-list ref] 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.