git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC] rev-list: fix --pretty=oneline with empty message

From
Erik Faye-Lund <kusmabite@googlemail.com>
Date
Mar 20, 2010, 18:20 UTC
Message-ID
<1269109201-5768-1-git-send-email-kusmabite@gmail.com>

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
Next: Junio C Hamano
Message 1 of 2 in “rev-list: fix --pretty=oneline with empty message”
  1. rev-list: fix --pretty=oneline with empty messageErik Faye-Lund, Mar 20, 2010
  2. Junio C HamanoMar 21, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.