summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Langhoff <martin@catalyst.net.nz>2006-05-02 21:44:36 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-05-02 21:59:58 (GMT)
commite923effb43fa952f9cb72ffe4c3625fce7655bff (patch)
tree7bb053a52f3cf61d3a793254a6452a7d2ca8b396
parentced9456a27197fc038fbc5b5ebad87e55f1920d2 (diff)
downloadgit-e923effb43fa952f9cb72ffe4c3625fce7655bff.zip
git-e923effb43fa952f9cb72ffe4c3625fce7655bff.tar.gz
git-e923effb43fa952f9cb72ffe4c3625fce7655bff.tar.bz2
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>
-rwxr-xr-xgit-send-email.perl9
1 files changed, 8 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index ecfa347..703dd1f 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -291,6 +291,13 @@ sub send_message
my $to = join (",\n\t", @recipients);
@recipients = unique_email_list(@recipients,@cc);
my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($time++));
+ my $gitversion = '@@GIT_VERSION@@';
+ if ($gitversion =~ m/..GIT_VERSION../) {
+ $gitversion = `git --version`;
+ chomp $gitversion;
+ # keep only what's after the last space
+ $gitversion =~ s/^.* //;
+ }
my $header = "From: $from
To: $to
@@ -299,7 +306,7 @@ Subject: $subject
Reply-To: $from
Date: $date
Message-Id: $message_id
-X-Mailer: git-send-email @@GIT_VERSION@@
+X-Mailer: git-send-email $gitversion
";
$header .= "In-Reply-To: $reply_to\n" if $reply_to;