git-send-email: fix version string to be valid perl
This makes git-send-email easier to develop and debug, skipping the need to `make git-send-email` every time. Signed-off-by: Junio C Hamano <junkio@cox.net>
Martin Langhoff committed
May 3, 2006 at 09:44 UTC
e923effb43fa952f9cb72ffe4c3625fce7655bff
1 file changed
+8
-1
git-send-email.perl
+8
-1
@@ -291,6 +291,13 @@ sub send_message
291
my $to = join (",\n\t", @recipients);
292
@recipients = unique_email_list(@recipients,@cc);
293
my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($time++));
294
+ my $gitversion = '@@GIT_VERSION@@';
295
+ if ($gitversion =~ m/..GIT_VERSION../) {
296
+ $gitversion = `git --version`;
297
+ chomp $gitversion;
298
+ # keep only what's after the last space
299
+ $gitversion =~ s/^.* //;
300
+ }
301
302
my $header = "From: $from
303
To: $to
@@ -299,7 +306,7 @@ Subject: $subject
306
Reply-To: $from
307
Date: $date
308
Message-Id: $message_id
302
-X-Mailer: git-send-email @@GIT_VERSION@@
309
+X-Mailer: git-send-email $gitversion
310
";
311
$header .= "In-Reply-To: $reply_to\n" if $reply_to;
312