# Git post-receive hook to update Patchwork patches after Git pushes
#
# Copyright © 2010 martin f. krafft <madduck@madduck.net>
-# 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
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"
}
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