summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2011-04-07 15:20:19 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2011-04-07 15:20:19 (GMT)
commita6487187b292c6d1a3886f2a8b99e8e3c51db78b (patch)
tree86be4f9c120b5c117dffd1503417dfaf5f6b707c
parent5da4a6299ac9c381de7b1912a9393605a062a1fc (diff)
downloadtip-bot-a6487187b292c6d1a3886f2a8b99e8e3c51db78b.zip
tip-bot-a6487187b292c6d1a3886f2a8b99e8e3c51db78b.tar.gz
tip-bot-a6487187b292c6d1a3886f2a8b99e8e3c51db78b.tar.bz2
tip-bot-a6487187b292c6d1a3886f2a8b99e8e3c51db78b.tar.xz
robotfmt: Recognize a specific link pattern as Message-ID override
Recognize a specific link pattern as a Message-ID override, which allows a link in a commit message to refer to its own Message-ID. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rwxr-xr-xrobotfmt.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/robotfmt.pl b/robotfmt.pl
index 29eac32..90d6d56 100755
--- a/robotfmt.pl
+++ b/robotfmt.pl
@@ -64,7 +64,6 @@ Sender: tip tree robot <${sender}>
From: \"tip-bot for %an\" <%ae>
To: linux-tip-commits\@vger.kernel.org
Subject: [tip:${branch}] %s
-Message-ID: <tip-%H\@git.kernel.org>
Git-Commit-ID: %H
X-Mailer: tip-git-log-daemon
Robot-ID: <tip-bot.git.kernel.org>
@@ -102,6 +101,7 @@ $nullref = '<tip-*@git.kernel.org>';
open(LOG, "-|", "git log -M -C -C --pretty=format:\Q${format}\E -p --stat \Q${rev}^..${rev}\E") or die;
$header = 1;
+$message_id = "<tip-${rev}\@git.kernel.org>";
while (defined($l = <LOG>)) {
chomp $l;
$header = 0 if ($l eq '');
@@ -121,7 +121,10 @@ while (defined($l = <LOG>)) {
if ($ref ne '' && $ref !~ /[^!#\$\%&'()*+,-.\/0-9:;=?\@A-Z\[\]_`a-z{|}~]/) {
$ref = '<'.$ref.'>';
$cclist{$lkml}++;
- if ($ref ne $nullref) {
+ if ($ref =~ /^\<tip-[0-9a-z]{24}\@git\.kernel\.org\>$/) {
+ # New submission magic
+ $message_id = $ref;
+ } elsif ($ref ne $nullref) {
push(@references, $ref);
}
}
@@ -149,6 +152,7 @@ $replylist{$lkml}++; # Always include LKML in Reply-To:
@moreheaders =
(
+ "Message-ID: ".$message_id."\n",
"Cc: ".join(",\n\t", keys(%cclist))."\n",
"Reply-To: ".join(",\n\t", keys(%replylist))."\n"
);