* [PATCH] git-tracker: remove shortlog for empty changes
@ 2014-05-21 7:44 Johannes Berg
2014-06-01 22:35 ` Hauke Mehrtens
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2014-05-21 7:44 UTC (permalink / raw)
To: backports; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
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>
---
devel/git-tracker.py | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/devel/git-tracker.py b/devel/git-tracker.py
index 05e915021c96..2820c61efae0 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,
--
2.0.0.rc0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] git-tracker: remove shortlog for empty changes
2014-05-21 7:44 [PATCH] git-tracker: remove shortlog for empty changes Johannes Berg
@ 2014-06-01 22:35 ` Hauke Mehrtens
0 siblings, 0 replies; 2+ messages in thread
From: Hauke Mehrtens @ 2014-06-01 22:35 UTC (permalink / raw)
To: Johannes Berg, backports; +Cc: Johannes Berg
On 05/21/2014 09:44 AM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> 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>
> ---
> devel/git-tracker.py | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
Thank you for the patch, it was applied, pushed and is included in the
backports-20140501 release.
Hauke
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-01 22:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 7:44 [PATCH] git-tracker: remove shortlog for empty changes Johannes Berg
2014-06-01 22:35 ` Hauke Mehrtens
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.