[PATCH][kteam-tools 2/2] apply-stable-patches: Stable: notes lines require (apply|do-not-apply) keyword

Kamal Mostafa kamal at canonical.com
Wed Jan 27 19:16:53 UTC 2016


To help preclude accidental regex matches, 'Stable:' pseudo-header lines
(which we add to mainline commits via git notes) must include an additional
keyword, either "apply" or "do-not-apply", e.g.:

    Stable: apply
    Stable: apply # optional version hint as for Cc: stable lines
    Stable: do-not-apply # optional comments

Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 stable/apply-stable-patches | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/stable/apply-stable-patches b/stable/apply-stable-patches
index bd15f6e..9e74191 100755
--- a/stable/apply-stable-patches
+++ b/stable/apply-stable-patches
@@ -384,7 +384,7 @@ class ApplyStablePatches(StdApp):
             cc = 1
             ccstable = compile(r'^\s*Cc:.*\b(stable)\b.*', IGNORECASE | MULTILINE)
             cchint = compile(r'((?P<for>\b(for)\b)|(?P<gr>\s*>\s*)|(?P<ge>\s*>=\s*)|(\s*))(?P<v>[v]*)(?P<kver>[0-9]\.[0-9][^\s+,\]]*)(?P<plus>[+]*)[,\]]*((?P<only>[\s]+only)|(?P<later>[\s]+and later)|(\s*))')
-            stable = compile(r'^\s*Stable:.*', IGNORECASE | MULTILINE)
+            stable = compile(r'^\s*Stable:.*\s+\b(apply|do-not-apply)\b.*', IGNORECASE | MULTILINE)
             fixes = compile(r'^\s*Fixes:.*\s+([a-f0-9]{6,}).*', IGNORECASE | MULTILINE)
             forstable = []
             fixeslist = []
@@ -396,8 +396,9 @@ class ApplyStablePatches(StdApp):
                     eout(body)
                     continue
 
-                # a "Stable:" line (e.g. which may have been added via git
-                # notes) overrides a "Cc: stable@" line
+                # a "Stable: apply" or "Stable: do-not-apply" line (e.g. which
+                # may have been added via git notes, and may also include a
+                # cchint version hint) overrides a "Cc: stable@" line.
                 s = stable.search(body)
                 if not s:
                     s = ccstable.search(body)
-- 
1.9.1





More information about the kernel-team mailing list