Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 18 additions and 14 deletions.
  1. +18 −14 data/gerrit/hooks/ref-updated
@@ -12,15 +12,15 @@ NEWREV=""
O=`getopt -l project: -l refname: -l submitter: -l oldrev: -l newrev: -- p:r:s:o:n: "$@"` || exit 1
eval set -- "$O"
while true; do
case "$1" in
--project) PROJECT="$2"; shift 2;;
--refname) REFNAME="$2"; shift 2;;
--submitter) SUBMITTER="$2"; shift 2;;
--oldrev) OLDREV="$2"; shift 2;;
--newrev) NEWREV="$2"; shift 2;;
--) shift; break;;
*) echo Error: $1; exit 1;;
esac
case "$1" in
--project) PROJECT="$2"; shift 2;;
--refname) REFNAME="$2"; shift 2;;
--submitter) SUBMITTER="$2"; shift 2;;
--oldrev) OLDREV="$2"; shift 2;;
--newrev) NEWREV="$2"; shift 2;;
--) shift; break;;
*) echo Error: $1; exit 1;;
esac
done

echo "DEBUG: THE REFNAME IS: $REFNAME"
@@ -44,9 +44,9 @@ echo "Obtaining lock..."
lockfile=$GIT_DIR/receive.lock

with_lock_unlock_if_held() {
if [[ "$with_lock_has_lock" -eq 1 ]] ; then
rm -f "$lockfile"
fi
if [[ "$with_lock_has_lock" -eq 1 ]] ; then
rm -f "$lockfile"
fi
}

# grab lockfile to protect against concurrent post-receive
@@ -55,7 +55,7 @@ with_lock_has_lock=0
trap with_lock_unlock_if_held INT TERM EXIT
lockfile -1 -r 30 "$lockfile"
if [ $? -ne 0 ] ; then
exit $?
exit $?
fi
with_lock_has_lock=1

@@ -65,7 +65,11 @@ export GIT_DIR
echo "$OLDREV $NEWREV $REFNAME" | USER="$UPLOADER_USERNAME" USER_EMAIL="$UPLOADER_EMAIL" $GERRIT_SITE/hooks/receive-notify.pl

# tell buildbot about new changes
#echo "$OLDREV $NEWREV $REFNAME" | $GIT_DIR/hooks/git_buildbot.py
if [ -f "$GIT_DIR/hooks/git_buildbot.py" ] ; then
echo "Notifying buildbot of $NEWREV @ $REFNAME"
echo -n "$OLDREV $NEWREV $REFNAME" | $GIT_DIR/hooks/git_buildbot.py -v -l /tmp/git-notify-log
fi


echo "Release lock..."

No commit comments for this range

You can’t perform that action at this time.