git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erik Faye-Lund <kusmabite@googlemail.com>
To: git@vger.kernel.org
Subject: [PATCH/RFC] rev-list: fix --pretty=oneline with empty message
Date: Sat, 20 Mar 2010 19:20:01 +0100	[thread overview]
Message-ID: <1269109201-5768-1-git-send-email-kusmabite@gmail.com> (raw)

55246aa (Dont use "<unknown>" for placeholders and suppress printing
of empty user formats) introduced a check to prevent empty
user-formats from being printed. This test didn't take empty commit
messages into account, and prevented the line-termination from being
output. This lead to multiple commits on a single line.

Correct it by guarding with a check for user-format.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
---

This is a fix for the issue I posted about with rebase -i:
http://permalink.gmane.org/gmane.comp.version-control.git/141782

 builtin/rev-list.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 5679170..133056b 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -135,7 +135,8 @@ static void show_commit(struct commit *commit, void *data)
 					putchar('\n');
 			}
 		} else {
-			if (buf.len)
+			if (revs->commit_format != CMIT_FMT_USERFORMAT ||
+			    buf.len)
 				printf("%s%c", buf.buf, info->hdr_termination);
 		}
 		strbuf_release(&buf);
-- 
1.7.0.2.456.g64f24

             reply	other threads:[~2010-03-20 18:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-20 18:20 Erik Faye-Lund [this message]
2010-03-21  2:54 ` [PATCH/RFC] rev-list: fix --pretty=oneline with empty message Junio C Hamano

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=1269109201-5768-1-git-send-email-kusmabite@gmail.com \
    --to=kusmabite@googlemail.com \
    --cc=git@vger.kernel.org \
    /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).