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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
This commit changes the output of format-patch (applied on this commit) from:

	...
	case.

	Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
	---

	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@xxxxxxxxxxxxxx>
	---
	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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]