summaryrefslogtreecommitdiffstats
path: root/gitmirror
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-30 10:03:36 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-30 10:03:36 -0700
commit090148202cb7be0012821d081ec3520662f3fb37 (patch)
tree8ac3e3f89ad2132ca9982e17417d851492b4b920 /gitmirror
parentee6eae2265dd626aec07a51e4cd5a42ffad4bbf7 (diff)
downloadnasmbuild-090148202cb7be0012821d081ec3520662f3fb37.tar.gz
nasmbuild-090148202cb7be0012821d081ec3520662f3fb37.tar.xz
nasmbuild-090148202cb7be0012821d081ec3520662f3fb37.zip
git mirror robot: use the new --mirror option to git fetch/push
Operate on a new tree cloned with git clone --mirror; use the new --mirror option to make git do the right things with the refs. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'gitmirror')
-rwxr-xr-xgitmirror/robot.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/gitmirror/robot.sh b/gitmirror/robot.sh
index 8f7a25c..a289f4b 100755
--- a/gitmirror/robot.sh
+++ b/gitmirror/robot.sh
@@ -7,31 +7,31 @@ SENDER='nasmbuild@zytor.com'
# /usr/sbin needed for sendmail
export PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin:$HOME/bin
+cd $HOME/gitmirror
+export GIT_DIR=$HOME/gitmirror/nasm.git
+
(
flock -nx 8 || exit 0
mkdir -m 0700 -p /tmp/$USER
- cd $HOME/gitmirror/git
- git fetch
- git reset --hard origin/master
- git push -f zytor
- git push --tags -f zytor
+ git fetch -f
+ git push -f --mirror zytor
- HEAD=$(git-rev-parse HEAD)
- OLD_HEAD=$(cat ../LAST_EMAIL)
+ HEAD=$(git rev-parse HEAD)
+ OLD_HEAD=$(cat LAST_EMAIL)
if [ x"$HEAD" != x"$OLD_HEAD" ]; then
mkdir -m 0700 /tmp/$USER/gitpatches.$$
# -k = no [PATCH], since we're sending to a mailing list.
- git format-patch -M -C -C -k -o /tmp/gitpatches.$$ $OLD_HEAD..$HEAD
+ git format-patch -M -C -C -k -o /tmp/$USER/gitpatches.$$ $OLD_HEAD..$HEAD
- for f in /tmp/gitpatches.$$/*; do
- ../robotfmt.pl "$MAILTO" < "$f" | sendmail -f "$SENDER" -t
+ for f in /tmp/$USER/gitpatches.$$/*; do
+ ./robotfmt.pl "$MAILTO" < "$f" | sendmail -f "$SENDER" -t
done
- echo "$HEAD" > ../LAST_EMAIL
+ echo "$HEAD" > LAST_EMAIL
rm -rf /tmp/$USER/gitpatches.$$
fi
) 8< "$0"