git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] log-tree: let format-patch not indent notes
@ 2014-09-25 16:10 Uwe Kleine-König
  2014-09-25 17:24 ` Junio C Hamano
  2014-09-25 17:56 ` Jeff King
  0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2014-09-25 16:10 UTC (permalink / raw)
  To: git; +Cc: kernel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-25 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-25 16:10 [PATCH RFC] log-tree: let format-patch not indent notes Uwe Kleine-König
2014-09-25 17:24 ` Junio C Hamano
2014-09-25 18:08   ` Uwe Kleine-König
2014-09-25 17:56 ` Jeff King

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).