From: Jeff King Date: Mon, 03 Dec 2007 07:53:57 GMT Subject: Re: [PATCH 6/6] builtin-commit: Add newline when showing which commit was created Message-ID: <20071203075357.GB3614@sigill.intra.peff.net> In-Reply-To: <7vzlwsmdvb.fsf@gitster.siamese.dyndns.org> On Sun, Dec 02, 2007 at 11:33:28PM -0800, Junio C Hamano wrote: > After reverting this, recording a merge commit seems to have lost the > newline. Can be easily reproduced with: > > $ git merge --no-commit some-branch > $ git commit -a -m 'foo' See, I knew reverting would flush it out. ;) Unfortunately, the fix isn't terribly obvious. log_tree_commit produces output either from log_tree_diff, which appends a newline, or from show_log, which doesn't, and returns the same value in either case. I tried adding a '%n' to the format specifier (which is "%h: %s"), but that has inconsistent results, since another newline is always placed between the diffstat and the log, anyway. The design of --pretty=format is a bit inflexible here, since you are stuck with the "$log\n$diff" format. But changing it would impact users, and is likely to require a lot of surgery in the log machinery. So short of munging log_tree_commit to add the newline, I'm not sure how to fix it, and I'm a little wary of messing with that function. -Peff