[PATCH v3 5/5] tools: Update to use 'hasher'

Tom Rini trini at konsulko.com
Fri Dec 2 02:08:24 AEDT 2016


On Thu, Dec 01, 2016 at 09:46:52AM +0000, Stephen Finucane wrote:
> 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 at that.guru>
> Cc: Paul Jakma <paul at jakma.org>
> Cc: Tom Rini <trini at konsulko.com>
> ---
>  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 d0f63a9..61952c0 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 a19e1b2..9222264 100755
> --- a/tools/post-receive.hook
> +++ b/tools/post-receive.hook
> @@ -38,7 +38,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 $pwpath/hasher.py)

copy/past error, it's PWDIR not pwpath in the hook.

After fixing that and the other changes I mentioned:

Tested-by: Tom Rini <trini at konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/patchwork/attachments/20161201/d2b2ccc6/attachment-0001.sig>


More information about the Patchwork mailing list