diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-11-27 09:05:23 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-11-27 09:05:23 -0700 |
commit | 38bc9283bfeb1b10f695e82e40e49bbf0e510553 (patch) | |
tree | 3506f50aa424e377a48cef3b2fb60d1a5c2723a6 /notmuch-extract-patch/notmuch-extract-patch | |
parent | 72ce929c86b9404e566b84f94769f03686066745 (diff) | |
parent | 0f4661cde91646c0481d00413d1188cf538829d5 (diff) | |
download | mailscripts-38bc9283bfeb1b10f695e82e40e49bbf0e510553.tar.gz |
Merge tag 'debian/0.15-1' into buster-bpo
mailscripts release 0.15-1 for unstable (sid) [dgit]
[dgit distro=debian no-split --quilt=linear]
# gpg: Signature made Thu 21 Nov 2019 03:34:55 PM MST
# gpg: using RSA key 9B917007AE030E36E4FC248B695B7AE4BF066240
# gpg: Good signature from "Sean Whitton <spwhitton@spwhitton.name>" [ultimate]
# Primary key fingerprint: 8DC2 487E 51AB DD90 B5C4 753F 0F56 D055 3B6D 411B
# Subkey fingerprint: 9B91 7007 AE03 0E36 E4FC 248B 695B 7AE4 BF06 6240
Diffstat (limited to 'notmuch-extract-patch/notmuch-extract-patch')
-rwxr-xr-x | notmuch-extract-patch/notmuch-extract-patch | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/notmuch-extract-patch/notmuch-extract-patch b/notmuch-extract-patch/notmuch-extract-patch index 4cfda4c..d67e542 100755 --- a/notmuch-extract-patch/notmuch-extract-patch +++ b/notmuch-extract-patch/notmuch-extract-patch @@ -56,10 +56,19 @@ def has_reroll_count(msg, v): or (v == 1 and not any(entry[0] == 'v' for entry in subject_prefix)) def get_subject_prefix(s): - match = re.search(r'''^\[(.*PATCH.*)\]''', s) + match = re.search(r'''\[(.*PATCH.*)\]''', s) if match: return match.group(1).split() +# if Subject: contains [PATCH nn/mm] then any text before that should +# be stripped, as it should not form part of the commit message. (The +# debbugs system prepends 'Bug#nnnnnn: ') +def munge_subject(msg): + match = re.search(r'''\[(.*PATCH.*)\].*$''', msg['subject']) + if match: + del msg['subject'] + msg['subject'] = match.group(0) + def main(): try: opts, query = getopt.getopt(sys.argv[1:], "v:", ["reroll-count="]) @@ -81,6 +90,7 @@ def main(): for m in in_mb: if is_git_patch(m) and has_reroll_count(m, reroll_count): sys.stderr.write(m['subject']+"\n") + munge_subject(m) out_mb.add(m) out_mb.flush() print(open(out_mb_file.name).read()) |