[Pkg-ocaml-maint-commits] r5455 - in /trunk/projects/git-guide: checkout-d-o-m-git-repo new-d-o-m-git-repo

zack at users.alioth.debian.org zack at users.alioth.debian.org
Wed Apr 9 20:52:46 UTC 2008


Author: zack
Date: Wed Apr  9 20:52:46 2008
New Revision: 5455

URL: http://svn.debian.org/wsvn/?sc=1&rev=5455
Log:
implement TODO items: revamp git repository creation procedure, automatically adds hooks for various kind of notifications

Modified:
    trunk/projects/git-guide/checkout-d-o-m-git-repo
    trunk/projects/git-guide/new-d-o-m-git-repo

Modified: trunk/projects/git-guide/checkout-d-o-m-git-repo
URL: http://svn.debian.org/wsvn/trunk/projects/git-guide/checkout-d-o-m-git-repo?rev=5455&op=diff
==============================================================================
--- trunk/projects/git-guide/checkout-d-o-m-git-repo (original)
+++ trunk/projects/git-guide/checkout-d-o-m-git-repo Wed Apr  9 20:52:46 2008
@@ -1,8 +1,5 @@
 #!/bin/bash
 set -e
-
-# TODO compare the procedures with http://wiki.debian.org/Alioth/Git and fix
-#      unwanted differences
 
 PACKAGE="$1"
 if [ -z "$PACKAGE" ] ; then
@@ -13,7 +10,7 @@
 REPODIR="/git/pkg-ocaml-maint/packages/$PACKAGE.git"
 
 echo "I: cloning remote repository"
-git clone git+ssh://git.debian.org/$REPODIR
+git clone "git+ssh://git.debian.org/$REPODIR"
 
 echo "I: setting up remote tracking"
 (cd $PACKAGE

Modified: trunk/projects/git-guide/new-d-o-m-git-repo
URL: http://svn.debian.org/wsvn/trunk/projects/git-guide/new-d-o-m-git-repo?rev=5455&op=diff
==============================================================================
--- trunk/projects/git-guide/new-d-o-m-git-repo (original)
+++ trunk/projects/git-guide/new-d-o-m-git-repo Wed Apr  9 20:52:46 2008
@@ -1,11 +1,9 @@
 #!/bin/bash
 set -e
 
-# TODO compare the procedures with http://wiki.debian.org/Alioth/Git and fix
-#      unwanted differences
-# TODO automatically set hooks for mail notifications to d-o-m at lists.d.o
-# TODO automatically set mail notifications to the PTS
-# TODO automatically set hooks for CIA notifications to d-o-m at lists.d.o
+#NOTIFY_EMAIL="debian-ocaml-maint at lists.debian.org"
+NOTIFY_EMAIL="zack at debian.org"
+CIA_PROJECT="debian-ocaml-maint"
 
 PACKAGE="$1"
 TARBALL="$2"
@@ -18,30 +16,51 @@
 REPODIR="/git/pkg-ocaml-maint/packages/$PACKAGE.git"
 
 echo "I: initialize (empty) remote repository on alioth.d.o"
-ssh $ALIOTH GIT_DIR=$REPODIR git init --shared=world
-ssh $ALIOTH "echo $PACKAGE packaging > $REPODIR/description"
+# see http://wiki.debian.org/Alioth/Git
+cat <<EOCMD | ssh $ALIOTH
+umask 002
+
+# create repo and add some metadata
+mkdir "$REPODIR"
+cd "$REPODIR"
+git --bare init --shared
+echo "$PACKAGE packaging" > description
+
+echo "I: set up commit notification (mail and CIA)"
+chmod a+x hooks/post-update
+git config --add hooks.mailinglist "$NOTIFY_EMAIL"
+git config --add hooks.bcc "${PACKAGE}_cvs at packages.qa.debian.org"
+git config --add hooks.cia-project "$CIA_PROJECT"
+git config --add hooks.cia-use-rpc 1
+echo "#!/bin/sh" > hooks/post-receive
+echo "exec /usr/local/bin/git-commit-notice" >> hooks/post-receive
+chmod 775 hooks/post-receive
+
+EOCMD
 
 echo "I: check in upstream tarball and setup branch layout"
-mkdir $PACKAGE
-(cd $PACKAGE
+tmpdir=`mktemp -dt new-git-tmp.XXXXXXXXXX`
+trap "rm -rf $tmpdir" EXIT
+if [ "${TARBALL:0:1}" != "/" ] ; then
+  TARBALL="`pwd`/$TARBALL"
+fi
+(cd $tmpdir
  git init
  git commit --allow-empty -m 'commit root'
  git branch upstream
  git-import-orig --pristine-tar --no-dch "$TARBALL")
- 
+
 echo "I: pushing first changes to alioth.d.o"
-(cd $PACKAGE
- git remote add origin git+ssh://git.debian.org/$REPODIR
+(cd $tmpdir
+ git remote add origin "git+ssh://git.debian.org/$REPODIR"
  git push --all)
-
-echo "I: cleaning up"
-rm -rf $PACKAGE/
 
 echo "I: all done. You can now checkout your new git repo with:"
 echo
 echo "   git clone git+ssh://git.debian.org/$REPODIR"
-echo "   cd $PACKAGE ; git branch --track upstream remotes/origin/upstream"
 echo
-echo "   # or:   checkout-d-o-m-git-repo $PACKAGE"
+echo "I: or, for extra goodies (recommended):"
+echo
+echo "   checkout-d-o-m-git-repo $PACKAGE"
 echo
 




More information about the Pkg-ocaml-maint-commits mailing list