git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Git Mailing List <git@vger.kernel.org>
Cc: Junio C Hamano <junkio@cox.net>
Subject: Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT
Date: Mon, 8 Oct 2007 13:46:52 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0710081342530.4964@woody.linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.0.999.0710081337490.4964@woody.linux-foundation.org>


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.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 log-tree.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/log-tree.c b/log-tree.c
index 2319154..62edd34 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -304,7 +304,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)

  reply	other threads:[~2007-10-08 20:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LFD.0.999.0710081337490.4964@woody.linux-foundation.org >
2007-10-08 20:42 ` Fix embarrassing "git log --follow" bug Linus Torvalds
2007-10-08 20:46   ` Linus Torvalds [this message]
2007-10-08 20:55     ` Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT Linus Torvalds
2007-10-09 16:35       ` [take 2] " Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.0.999.0710081342530.4964@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).