diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2007-10-09 09:35:22 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-10-15 20:24:27 -0400 |
commit | 304b5af64f9b5a6b5e9455e2dcab381c568452b6 (patch) | |
tree | 475eab770fc6f36a88593ba7b17f958c0ad9fb4f /log-tree.c | |
parent | 99516e35d096f41e7133cacde8fbed8ee9a3ecd0 (diff) | |
download | git-304b5af64f9b5a6b5e9455e2dcab381c568452b6.tar.gz |
Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT
This fixes an unnecessary empty line that we add to the log message when
we generate diffs, but don't actually end up printing any due to having
DIFF_FORMAT_NO_OUTPUT set.
This can happen with pickaxe or with rename following. The reason is that
we normally add an empty line between the commit and the diff, but we do
that even for the case where we've then suppressed the actual printing of
the diff.
This also updates a couple of tests that assumed the extraneous empty
line would exist at the end of output.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'log-tree.c')
-rw-r--r-- | log-tree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/log-tree.c b/log-tree.c index a6423718e7..b509c0c7ec 100644 --- a/log-tree.c +++ b/log-tree.c @@ -321,7 +321,8 @@ int log_tree_diff_flush(struct rev_info *opt) * output for readability. */ show_log(opt, opt->diffopt.msg_sep); - if (opt->verbose_header && + if ((opt->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT) && + opt->verbose_header && opt->commit_format != CMIT_FMT_ONELINE) { int pch = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH; if ((pch & opt->diffopt.output_format) == pch) |