[kernel] r19012 - people/benh
Ben Hutchings
benh at alioth.debian.org
Sat May 19 15:36:31 UTC 2012
Author: benh
Date: Sat May 19 15:36:28 2012
New Revision: 19012
Log:
Process any 'Cc: stable' lines when formatting for backport
Patches in a stable queue should not include the Cc: stable line.
There may be a comment after the address specifying which versions
will need it; print that out after the filename so it's not lost.
Modified:
people/benh/git-format-patch-for-backport
Modified: people/benh/git-format-patch-for-backport
==============================================================================
--- people/benh/git-format-patch-for-backport Sat May 19 15:31:36 2012 (r19011)
+++ people/benh/git-format-patch-for-backport Sat May 19 15:36:28 2012 (r19012)
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2010 Ben Hutchings
+# Copyright 2010,2012 Ben Hutchings
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,11 +18,19 @@
set -e
git format-patch "$@" | while read name; do
- printf '%s\n' "$name"
+ printf '%s' "$name"
mv "$name" "$name".orig
- awk 'FNR == 1 { hash = $2 }
-FNR > 1 { print $0 }
-/^$/ && hash != "" { print "commit", hash, "upstream."; print; hash = "" }' \
- "$name".orig > "$name"
+ awk 'BEGIN { comment = 0; IGNORECASE = 1 }
+FNR == 1 { hash = $2 }
+/^Cc: <?stable@(vger\.)?kernel\.org/ {
+ gsub("^Cc:\\s*(.*<)?stable@(vger\\.)?kernel\\.org>? *", "");
+ print "", $0 >"/dev/stderr"
+ comment = 1
+ next
+}
+FNR > 1 { print }
+/^$/ && hash != "" { print "commit", hash, "upstream."; print; hash = "" }
+END { if (!comment) print "" >"/dev/stderr" }' \
+ "$name".orig 2>&1 >"$name"
rm "$name".orig
done
More information about the Kernel-svn-changes
mailing list