]> git.ozlabs.org Git - patchwork/blobdiff - tools/post-receive.hook
login: Focus the username field on load
[patchwork] / tools / post-receive.hook
index 4f76fa6cd26a0cd02f7c2ae64b70f174fd62fcfc..8f05b8d85dc3e98c3c63a4a3ca0b813ae26e79c8 100755 (executable)
@@ -8,8 +8,14 @@ set -eu
 
 #TODO: the state map should really live in the repo's git-config
 STATE_MAP="refs/heads/master:Accepted"
+#
+# ignore all commits already present in these refs
+# e.g.,
+#   EXCLUDE="refs/heads/upstream refs/heads/other-project"
+#
+EXCLUDE=""
 
-PWDIR=/srv/patchwork/apps/patchwork
+PWDIR=/srv/patchwork/patchwork
 
 do_exit=0
 trap "do_exit=1" INT
@@ -39,7 +45,8 @@ 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-parse --not ${EXCLUDE} |
+               git rev-list --stdin --no-merges --reverse ${1}..${2}); do
     if [ "$do_exit" = 1 ]; then
       echo "I: exiting..." >&2
       break
@@ -67,6 +74,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