summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-05-21 09:44:43 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2014-06-02 00:16:15 +0200
commitf8ef0108bcc9b685c3d489079325c56f77c49e09 (patch)
treefeda738e6f9c519064185dcb99f0a5a6c80caaf6
parent525b264c8fb1c626be04880ea134a1112288f09e (diff)
git-tracker: remove shortlog for empty changes
When the input tree had changes but the output doesn't get any changes at all, then the shortlog was being generated over all commits since no files were specified. Catch this special case and instead of generating a shortlog just add a note that no commits changed generated code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rwxr-xr-xdevel/git-tracker.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/devel/git-tracker.py b/devel/git-tracker.py
index 01b1d6cc..24194908 100755
--- a/devel/git-tracker.py
+++ b/devel/git-tracker.py
@@ -93,8 +93,12 @@ def handle_commit(args, msg, branch, treename, kernelobjdir, tmpdir, wgitdir, ba
files = []
for d in git.status(tree=wdir):
files.extend(d[1:])
- msg += git.shortlog(append_shortlog[0], append_shortlog[1],
- tree=kernelobjdir, files=files)
+ if files:
+ msg += '\n' + append_shortlog[2] + '\n\n'
+ msg += git.shortlog(append_shortlog[0], append_shortlog[1],
+ tree=kernelobjdir, files=files)
+ else:
+ msg += "\nNo commits changed the generated code.\n\n"
msg += '''%(newline)s
%(PREFIX)sbackport: %(bprev)s
@@ -242,16 +246,16 @@ if __name__ == '__main__':
try:
# add information about commits that went into this
git.rev_parse('%s^2' % commit, tree=kernelobjdir)
- msg += "\nCommits in this merge:\n\n"
- append_shortlog = (prev, '%s^2' % commit)
+ append_shortlog = (prev, '%s^2' % commit,
+ "Commits in this merge:")
except git.ExecutionError as e:
# will fail if it wasn't a merge commit
pass
else:
# multiple commits
env = backport_author_env
- msg = "update multiple kernel commits\n\nCommits taken:\n\n"
- append_shortlog = (prev, commit)
+ msg = "update multiple kernel commits\n"
+ append_shortlog = (prev, commit, "Commits taken:")
failure = handle_commit(args, msg, branch, tree, kernelobjdir, branch_tmpdir,
wgitdir, backport_rev, commit, env=env,
prev_kernel_rev=prev, defconfig=defconfig,