X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fpost-receive.hook;h=4fb741d3ea98997389cbec6d70386f6d29805954;hb=f24310486bb97291350fa84f1e895635facb4155;hp=004422f1b263ead51b6719b0a7e013ca49eb35ff;hpb=5d1b8ca30bb4ff9284ad2013c92177e31dd07562;p=patchwork diff --git a/tools/post-receive.hook b/tools/post-receive.hook index 004422f..4fb741d 100755 --- a/tools/post-receive.hook +++ b/tools/post-receive.hook @@ -3,8 +3,7 @@ # Git post-receive hook to update Patchwork patches after Git pushes # # Copyright © 2010 martin f. krafft -# Released under the terms of the Artistic Licence 2.0 -# +# Released under the GNU General Public License v2 or later. set -eu #TODO: the state map should really live in the repo's git-config @@ -26,8 +25,8 @@ get_patchwork_hash() get_patch_id() { local id - id=$($PWDIR/bin/pwclient view -h $1 2>/dev/null \ - | sed -rne 's,X-Patchwork-Id: ,,p') + id=$($PWDIR/bin/pwclient info -h $1 2>/dev/null \ + | sed -rne 's,- id[[:space:]]*: ,,p') echo $id test -n "$id" } @@ -40,7 +39,7 @@ set_patch_state() update_patches() { local cnt; cnt=0 - for rev in $(git rev-list --no-merges --reverse ${1}^..${2}); do + for rev in $(git rev-list --no-merges --reverse ${1}..${2}); do if [ "$do_exit" = 1 ]; then echo "I: exiting..." >&2 break @@ -68,6 +67,6 @@ while read oldrev newrev refname; do fi done if [ $found -eq 0 ]; then - echo "E: no mapping for refname $key" >&2 + echo "E: STATE_MAP has no mapping for branch $refname" >&2 fi done