From: Johannes Berg <johannes.berg@xxxxxxxxx> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> --- devel/git-tracker.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/devel/git-tracker.py b/devel/git-tracker.py index 7e55fa5ccb8e..14e2f14b9a63 100755 --- a/devel/git-tracker.py +++ b/devel/git-tracker.py @@ -54,6 +54,16 @@ def update_cache_objects(gittree, objdir, input): git.set_origin(gittree, objdir) git.remote_update(objdir, env=env) +def add_changeid_to_message(msg): + have_changeid = False + for line in msg.split('\n'): + if line.lower().startswith('change-id: I'): + have_changeid = True + break + if not have_changeid: + msg += 'Change-Id: I%s\n' % hashlib.sha1(msg).hexdigest() + return msg + def handle_commit(args, msg, branch, treename, kernelobjdir, tmpdir, wgitdir, backport_rev, kernel_rev, prev_kernel_rev=None, defconfig=None, env={}, commit_failure=True, append_shortlog=None, add_changeid=False): @@ -129,13 +139,7 @@ def handle_commit(args, msg, branch, treename, kernelobjdir, tmpdir, wgitdir, ba } if add_changeid: - have_changeid = False - for line in msg.split('\n'): - if line.lower().startswith('change-id: I'): - have_changeid = True - break - if not have_changeid: - msg += 'Change-Id: I%s\n' % hashlib.sha1(msg).hexdigest() + msg = add_changeid_to_message(msg) treeid = git.write_tree(tree=wdir) git.commit_tree(treeid, msg, parents, tree=wdir, env=env) -- 2.24.1 -- To unsubscribe from this list: send the line "unsubscribe backports" in