chiark / gitweb /
git-workflows: final delimiter
[dgit-junk.git] / copy-alioth-to-gideon
index f7cf913..81e2421 100755 (executable)
@@ -12,7 +12,7 @@ ssh iwj@gideon.debian.org "
        mkdir -p transfer.tmp
        cd transfer.tmp
 
        mkdir -p transfer.tmp
        cd transfer.tmp
 
-       rsync -rltHxp --delete iwj@git.debian.org:/git/dgit-repos/repos/. .
+       rsync -rltHxp --delete iwj@git.debian.org:/git/dgit-repos/repos.now-on-gideon/. .
 
        find \(         \( ! -type f ! -type d \) \
                -o      -perm +5002 -o \! -perm +2555 \
 
        find \(         \( ! -type f ! -type d \) \
                -o      -perm +5002 -o \! -perm +2555 \
@@ -26,9 +26,35 @@ ssh iwj@gideon.debian.org "
                exit 1
        fi
 
                exit 1
        fi
 
+       (
+        cd $d/transfer.tmp
+        mv irker.git irker.arrgh
+        cp -a _template irker.git
+        cd irker.git
+        git fetch -p ../irker.arrgh "+refs/heads/dgit/*:refs/dgit/*"
+       )
+
        set +x
        for f in $d/transfer.tmp/*.git; do
                cp $d/repos/_template/description $f/description
        set +x
        for f in $d/transfer.tmp/*.git; do
                cp $d/repos/_template/description $f/description
+               touch $f/git-daemon-export-ok
+               (export GIT_DIR=$f
+                master=`git for-each-ref "[r]efs/heads/master"`
+                sid=`git for-each-ref "[r]efs/dgit/sid"`
+                if [ "x$master" = x ] && [ "x$sid" != x ]; then
+                       git update-ref refs/heads/master refs/dgit/sid
+                fi)
+               (export GIT_DIR=$f
+                git for-each-ref --format="%(refname)" | while read r; do
+                       case "$r" in
+                       refs/heads/master)      ;;
+                       refs/tags/debian/*)     ;;
+                       refs/dgit/*)            ;;
+                       *)
+                               git update-ref -d "$r"
+                               ;;
+                       esac
+               done)
        done
 
        cat <<END >$d/transfer.run
        done
 
        cat <<END >$d/transfer.run
@@ -36,7 +62,11 @@ ssh iwj@gideon.debian.org "
                cd $d/transfer.tmp
                rsync -rltHxp --delete *.git $d/repos/
                # _template
                cd $d/transfer.tmp
                rsync -rltHxp --delete *.git $d/repos/
                # _template
-               echo done.
+               echo done locally, copying...
+
+               distrodir=$d/dispatch-dir/distro\=debian
+               \$distrodir/mirror-hook \$distrodir all
+               echo done all.
 END
        chmod +x $d/transfer.run
 '
 END
        chmod +x $d/transfer.run
 '