]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
tools: Update to use 'hasher'
authorStephen Finucane <stephen@that.guru>
Wed, 30 Nov 2016 18:29:37 +0000 (18:29 +0000)
committerStephen Finucane <stephen@that.guru>
Thu, 1 Dec 2016 18:52:56 +0000 (18:52 +0000)
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 <stephen@that.guru>
Tested-by: Tom Rini <trini@konsulko.com>
Closes-bug: #63

tools/patchwork-update-commits
tools/post-receive.hook

index d0f63a93e85d3996ac77bd5bddc8024c07a50d39..61952c08b5337b67c0c6b1b4e57c1bc5a4d6b367 100755 (executable)
@@ -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
index 2fd037f3594c1652637933b8ef2ddac69713ae4e..42de90a3a7c2ded0d1cdae383d2379418ab8d955 100755 (executable)
@@ -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"
 }