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

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 <>
 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) {

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to