Jeff King [off-list ref] writes:
On Sun, Nov 11, 2007 at 05:36:52PM +0000, Johannes Schindelin wrote:
quoted
The function log_tree_commit() does not break the line, so we have to
do it ourselves.
Johannes,
Can you explain the rationale for this change in more detail?
When I run builtin-commit from the tip of next, I always get an extra
newline (as compared to the shell behavior):
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'
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