Make review script download Change-Id hook if missing.

Change-Id: I22fd093a6bcad6671700423c27f557aa045a028f
This commit is contained in:
Daniel Erat 2011-07-01 19:35:38 +00:00
parent 5ee34188f2
commit ca441a0e1a
1 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,23 @@
#!/bin/sh
set -e
TOPLEVEL_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)
HOOK_FILE="$TOPLEVEL_DIR/.git/hooks/commit-msg"
if ! test -e "$HOOK_FILE"; then
cat - <<EOF
Presubmit hook to add Change-Id to commit messages is missing.
Downloading to $HOOK_FILE...
EOF
scp -p -P 29418 $USER@camlistore.org:hooks/commit-msg "$HOOK_FILE"
cat - <<EOF
Amending last commit to add Change-Id.
Please re-save description without making changes.
Press Enter to continue.
EOF
read foo
git commit --amend
fi
git push ssh://$USER@camlistore.org:29418/camlistore HEAD:refs/for/master