Message ID | 1500029844-846-5-git-send-email-i.maximets@samsung.com |
---|---|
State | Accepted |
Headers | show |
Ilya Maximets <i.maximets@samsung.com> writes: > It's better to see real commits instead of 'HEAD~n'. > > Signed-off-by: Ilya Maximets <i.maximets@samsung.com> > --- Acked-by: Aaron Conole <aconole@redhat.com>
On Fri, Jul 14, 2017 at 6:57 AM, Ilya Maximets <i.maximets@samsung.com> wrote: > It's better to see real commits instead of 'HEAD~n'. > > Signed-off-by: Ilya Maximets <i.maximets@samsung.com> > --- > utilities/checkpatch.py | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) Thanks for the patches! I applied all 4 to master. > > diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py > index 7ccec51..f61b8b7 100755 > --- a/utilities/checkpatch.py > +++ b/utilities/checkpatch.py > @@ -500,13 +500,19 @@ if __name__ == '__main__': > > if n_patches: > status = 0 > + > + git_log = 'git log --no-color --no-merges --pretty=format:"%H %s" ' > + f = os.popen(git_log + '-%d' % n_patches, 'r') > + commits = f.read().split("\n") > + f.close() > + I slightly modified this to be: @@ -502,9 +502,8 @@ if __name__ == '__main__': status = 0 git_log = 'git log --no-color --no-merges --pretty=format:"%H %s" ' - f = os.popen(git_log + '-%d' % n_patches, 'r') - commits = f.read().split("\n") - f.close() + with os.popen(git_log + '-%d' % n_patches, 'r') as f: + commits = f.read().split("\n") for i in reversed(range(0, n_patches)): revision, name = commits[i].split(" ", 1)
diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index 7ccec51..f61b8b7 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -500,13 +500,19 @@ if __name__ == '__main__': if n_patches: status = 0 + + git_log = 'git log --no-color --no-merges --pretty=format:"%H %s" ' + f = os.popen(git_log + '-%d' % n_patches, 'r') + commits = f.read().split("\n") + f.close() + for i in reversed(range(0, n_patches)): - revision = 'HEAD~%d' % i + revision, name = commits[i].split(" ", 1) f = os.popen('git format-patch -1 --stdout %s' % revision, 'r') patch = f.read() f.close() - print('== Checking %s ==' % revision) + print('== Checking %s ("%s") ==' % (revision[0:12], name)) result = ovs_checkpatch_parse(patch, revision) ovs_checkpatch_print_result(result) if result:
It's better to see real commits instead of 'HEAD~n'. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> --- utilities/checkpatch.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)