From: Stephen Finucane Date: Wed, 30 Nov 2016 18:29:37 +0000 (+0000) Subject: tools: Update to use 'hasher' X-Git-Tag: v2.0.0-rc1~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eda57a915378de582ed3e8c3a0ac5c4d800bba74;p=thirdparty%2Fpatchwork.git 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 --- 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" }