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

[PATCH RFC] log-tree: let format-patch not indent notes

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
Sep 25, 2014, 16:10 UTC
Message-ID
<1411661409-24562-1-git-send-email-u.kleine-koenig@pengutronix.de>

Commit logs as shown by git-log are usually indented by four spaces so here it makes sense to do the same for commit notes.

However when using format-patch to create a patch for submission via e-mail the commit log isn't indented and also the "Notes:" header isn't really useful. So consequently don't indent and skip the header in this case. This also removes the empty line between the end-of-commit marker and the start of the notes.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
This commit changes the output of format-patch (applied on this commit) from:
	...
	case.
	Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
	---
	Notes:
	    This commit changes the output of format-patch (applied on this commit) from:
to
	...
	case.
	Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
	---
	This commit changes the output of format-patch (applied on this commit) from:
which I consider to be more useful.
 log-tree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/log-tree.c b/log-tree.c
index bcee7c596696..c1d73d8fecdf 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -585,7 +585,8 @@ void show_log(struct rev_info *opt)
 		int raw;
 		struct strbuf notebuf = STRBUF_INIT;
 
-		raw = (opt->commit_format == CMIT_FMT_USERFORMAT);
+		raw = (opt->commit_format == CMIT_FMT_USERFORMAT) ||
+			(opt->commit_format == CMIT_FMT_EMAIL);
 		format_display_notes(commit->object.sha1, &notebuf,
 				     get_log_output_encoding(), raw);
 		ctx.notes_message = notebuf.len
-- 
2.1.1.274.gb3e1830.dirty
Next: Junio C Hamano
Message 1 of 4 in “log-tree: let format-patch not indent notes”
  1. log-tree: let format-patch not indent notesUwe Kleine-König, Sep 25, 2014
  2. Junio C HamanoSep 25, 2014
  3. Uwe Kleine-KönigSep 25, 2014
  4. Jeff KingSep 25, 2014

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.