git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: git@vger.kernel.org
Cc: kernel@pengutronix.de
Subject: [PATCH RFC] log-tree: let format-patch not indent notes
Date: Thu, 25 Sep 2014 18:10:09 +0200	[thread overview]
Message-ID: <1411661409-24562-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)

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

             reply	other threads:[~2014-09-25 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25 16:10 Uwe Kleine-König [this message]
2014-09-25 17:24 ` [PATCH RFC] log-tree: let format-patch not indent notes Junio C Hamano
2014-09-25 18:08   ` Uwe Kleine-König
2014-09-25 17:56 ` Jeff King

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=1411661409-24562-1-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=git@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    /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).