git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] send-email: do not insert third header
@ 2014-06-07  8:09 Stepan Kasal
  2014-06-09 23:25 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Stepan Kasal @ 2014-06-07  8:09 UTC (permalink / raw)
  To: GIT Mailing-list

It is sometimes desirable to insert several header lines at the top of
the body, e.g., if From or Date differs from the mail header.
(Linus even recommends to use this second header for all kernel
submissions.)

send-email has a minimal support for this; make sure it is not applied
when there is a second header already inserted in the patch file.

Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 git-send-email.perl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 9949db0..891df13 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1456,7 +1456,9 @@ foreach my $t (@files) {
 	}
 
 	if (defined $sauthor and $sauthor ne $sender) {
-		$message = "From: $author\n\n$message";
+		if ($message !~ m/^From: /) {
+			$message = "From: $author\n\n$message";
+		}
 		if (defined $author_encoding) {
 			if ($has_content_type) {
 				if ($body_encoding eq $author_encoding) {
-- 
1.9.2.msysgit.0.496.g9a846d6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-10  7:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-07  8:09 [PATCH] send-email: do not insert third header Stepan Kasal
2014-06-09 23:25 ` Junio C Hamano
2014-06-10  5:38   ` Junio C Hamano
2014-06-10  7:05     ` Stepan Kasal

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 NNTP newsgroup(s).