git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sam Bobroff <sam.bobroff@au1.ibm.com>
To: git@vger.kernel.org
Subject: [PATCH] format-patch: use raw format for notes
Date: Mon, 28 Aug 2017 14:23:20 +1000	[thread overview]
Message-ID: <334a7be4f61c02db24008181eb1d6c80c95772f7.1503894009.git.sam.bobroff@au1.ibm.com> (raw)

If "--notes=..." is used with "git format-patch", the notes are
prefixed with the ref's local name and indented, which looks odd and
exposes the path of the ref.

Extend the test that suppresses this behaviour so that it also catches
this case, causing the notes to be included without additional
processing.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---

Notes (foo):
    Hi,
    
    I've noticed what appears to be a small cosmetic bug in git format-patch, as
    I've described in the commit message.
    
    I'm not sure if this patch is the right way to fix it (or perhaps it's not even
    a bug), but it should at least help to explain what I'm talking about.
    
    I've used "git format-patch --notes=foo" to prepare this email so that it is an
    example of the issue :-)
    
    Cheers,
    Sam.

 log-tree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/log-tree.c b/log-tree.c
index 410ab4f02..26bc21ad3 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -655,7 +655,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.oid, &notebuf,
 				     get_log_output_encoding(), raw);
 		ctx.notes_message = notebuf.len
-- 
2.11.0


             reply	other threads:[~2017-08-28  4:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  4:23 Sam Bobroff [this message]
2017-09-06  3:34 ` [PATCH] format-patch: use raw format for notes Junio C Hamano
2017-09-11  4:27   ` Sam Bobroff
2017-09-12 17:33     ` Stefan Beller
2017-09-13  0:38       ` Sam Bobroff
2017-09-13 13:03     ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=334a7be4f61c02db24008181eb1d6c80c95772f7.1503894009.git.sam.bobroff@au1.ibm.com \
    --to=sam.bobroff@au1.ibm.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).