From eda57a915378de582ed3e8c3a0ac5c4d800bba74 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 30 Nov 2016 18:29:37 +0000 Subject: [PATCH] tools: Update to use 'hasher' The old 'parser' module used to extract diffs from their surrounding mbox fluff before hashing this. Seeing as this was only used in the context of an actual git repo, avoid all of that rigmarole by just using 'git diff', which produces a plain diff, rather than 'git show'. Signed-off-by: Stephen Finucane Tested-by: Tom Rini Closes-bug: #63 --- tools/patchwork-update-commits | 2 +- tools/post-receive.hook | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/patchwork-update-commits b/tools/patchwork-update-commits index d0f63a93..61952c08 100755 --- a/tools/patchwork-update-commits +++ b/tools/patchwork-update-commits @@ -29,6 +29,6 @@ fi git rev-list --reverse "$@" | while read commit; do - hash=$(git show "$commit" | python $pwpath/parser.py -#) + hash=$(git diff "$commit~..$commit" | python $pwpath/hasher.py) $pwpath/bin/pwclient update -s Accepted -c "$commit" -h "$hash" done diff --git a/tools/post-receive.hook b/tools/post-receive.hook index 2fd037f3..42de90a3 100755 --- a/tools/post-receive.hook +++ b/tools/post-receive.hook @@ -37,7 +37,7 @@ trap "do_exit=1" INT get_patchwork_hash() { local hash - hash=$(git show -C $1 | python $PWDIR/parser.py --hash) + hash=$(git diff "$1~..$1" | python $PWDIR/hasher.py) echo $hash test -n "$hash" } -- 2.47.3