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

[PATCH] git-send-email: fix version string to be valid perl

From
MLMartin Langhoff <martin@catalyst.net.nz>
Date
May 2, 2006, 21:44 UTC
Message-ID
<11466062762814-git-send-email-martin@catalyst.net.nz>

This makes git-send-email easier to develop and debug, skipping the need to `make git-send-email` every time.

---
 git-send-email.perl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
1f6dd44e0c919196f9c3d5d617a64111004f24e5
diff --git a/git-send-email.perl b/git-send-email.perl
index ecfa347..2eb4f6c 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;
 
-- 
1.3.0.rc4.ge6bf-dirty
Message 1 of 1 in “git-send-email: fix version string to be valid perl”
  1. git-send-email: fix version string to be valid perlMartin Langhoff, May 2, 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.