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

[PATCH] git-send-email: Don't set author_not_sender from Cc: lines

From
HSHaavard Skinnemoen <hskinnemoen@atmel.com>
Date
Aug 22, 2006, 13:38 UTC
Message-ID
<1156253919761-git-send-email-hskinnemoen@atmel.com>

When an mbox-style patch contains a Cc: line in the header, git-send-email will check the address against the sender specified on the command line. If they don't match, sender_not_author will be set to the address obtained from the Cc line.

When this happens, git-send-email inserts a From: line at the beginning of the message body with the address obtained from the Cc line in the header, and the sender might be accused of forging patch authors.

This patch fixes this by only updating sender_not_author when processing From: lines, not when processing Cc: lines.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---

This email was sent using git-send-email with the patch applied. Junio was Cc'ed by editing the patch header -- let's see if it works...

 git-send-email.perl |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index a83c7e9..0197454 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -506,7 +506,7 @@ foreach my $t (@files) {
 				if (/^Subject:\s+(.*)$/) {
 					$subject = $1;
 
-				} elsif (/^(Cc|From):\s+(.*)$/) {
+				} elsif (/^(From):\s+(.*)$/) {
 					if ($2 eq $from) {
 						next if ($suppress_from);
 					}
@@ -516,8 +516,11 @@ foreach my $t (@files) {
 					printf("(mbox) Adding cc: %s from line '%s'\n",
 						$2, $_) unless $quiet;
 					push @cc, $2;
+				} elsif (/^(Cc):\s+(.*)$/) {
+					printf("(mbox) Adding cc: %s from line '%s'\n",
+						$2, $_) unless $quiet;
+					push @cc, $2;
 				}
-
 			} else {
 				# In the traditional
 				# "send lots of email" format,
-- 
1.4.0
Next: Junio C Hamano
Message 1 of 3 in “git-send-email: Don't set author_not_sender from Cc: lines”
  1. git-send-email: Don't set author_not_sender from Cc: linesHaavard Skinnemoen, Aug 22, 2006
  2. Junio C HamanoAug 23, 2006
  3. Haavard SkinnemoenAug 23, 2006

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.