[PATCH] fix git format-patch --cc=<email> format

Subsystems: the rest

DORMANTno replies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] fix git format-patch --cc=<email> format

From: Peng Tao <hidden>
Date: 2016-06-15 22:46:18

If there are multiple --cc=<email> arguments, git format-patch will generate
patches with cc lines like:
  Cc: <email>,
      <email>
which git send-email fails to parse.
git send-email only accept formats like:
  Cc: <email>
  Cc: <email>
So change git format-patch to generate patches in a proper format.

Signed-off-by: Peng Tao <redacted>
---
 builtin-log.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 60f8dd8..22bb6b6 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -907,13 +907,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	}
 
 	if (extra_cc_nr)
-		strbuf_addstr(&buf, "Cc: ");
 	for (i = 0; i < extra_cc_nr; i++) {
-		if (i)
-			strbuf_addstr(&buf, "    ");
+		strbuf_addstr(&buf, "Cc: ");
 		strbuf_addstr(&buf, extra_cc[i]);
-		if (i + 1 < extra_cc_nr)
-			strbuf_addch(&buf, ',');
 		strbuf_addch(&buf, '\n');
 	}
 

Re: [PATCH] fix git format-patch --cc=<email> format

From: Jay Soffian <hidden>
Date: 2016-06-15 22:46:18

On Sat, Feb 28, 2009 at 7:42 AM, Peng Tao [off-list ref] wrote:
If there are multiple --cc=<email> arguments, git format-patch will generate
patches with cc lines like:
 Cc: <email>,
     <email>
which git send-email fails to parse.
git send-email only accept formats like:
 Cc: <email>
 Cc: <email>
So change git format-patch to generate patches in a proper format.
This is fixed in next, but we fixed send-email instead to handle the
messages that format-patch generates, as they should be valid.

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help