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

[PATCH] format-patch: use raw format for notes

From
SBSam Bobroff <sam.bobroff@au1.ibm.com>
Date
Aug 28, 2017, 04:23 UTC
Message-ID
<334a7be4f61c02db24008181eb1d6c80c95772f7.1503894009.git.sam.bobroff@au1.ibm.com>

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
Next: Junio C Hamano
Message 1 of 6 in “format-patch: use raw format for notes”
  1. format-patch: use raw format for notesSam Bobroff, Aug 28, 2017
  2. Junio C HamanoSep 6, 2017
  3. Sam BobroffSep 11, 2017
  4. Stefan BellerSep 12, 2017
  5. Sam BobroffSep 13, 2017
  6. Jeff KingSep 13, 2017

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.