[Pkg-ocaml-maint-commits] r5869 - /trunk/projects/git-guide/new-d-o-m-git-repo

glondu-guest at users.alioth.debian.org glondu-guest at users.alioth.debian.org
Sat Jul 19 21:02:53 UTC 2008


Author: glondu-guest
Date: Sat Jul 19 21:02:53 2008
New Revision: 5869

URL: http://svn.debian.org/wsvn/?sc=1&rev=5869
Log:
If we are in a git repos: push changes, then setup notifications

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

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=5869&op=diff
==============================================================================
--- trunk/projects/git-guide/new-d-o-m-git-repo (original)
+++ trunk/projects/git-guide/new-d-o-m-git-repo Sat Jul 19 21:02:53 2008
@@ -19,6 +19,8 @@
 ALIOTH="alioth.debian.org"
 REPODIR="/git/pkg-ocaml-maint/packages/$PACKAGE.git"
 
+
+initialize_alioth_repos () {
 echo "I: initialize (empty) remote repository on alioth.d.o"
 # see http://wiki.debian.org/Alioth/Git
 cat <<EOCMD | ssh $ALIOTH
@@ -29,8 +31,16 @@
 cd "$REPODIR"
 git --bare init --shared
 echo "$PACKAGE packaging" > description
+EOCMD
+}
 
+
+setup_notifications () {
 echo "I: set up commit notification (mail and CIA)"
+cat <<EOCMD | ssh $ALIOTH
+umask 002
+
+cd "$REPODIR"
 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"
@@ -39,10 +49,21 @@
 echo "#!/bin/sh" > hooks/post-receive
 echo "exec /usr/local/bin/git-commit-notice" >> hooks/post-receive
 chmod 775 hooks/post-receive
+EOCMD
+}
 
-EOCMD
+
+git_push () {
+   echo "I: pushing first changes to alioth.d.o"
+   git remote add origin "git+ssh://git.debian.org/$REPODIR"
+   git push --all
+   git push --all --tags
+}
+
+initialize_alioth_repos
 
 if [ "$INJECT_TARBALL" = "yes" ] ; then
+  setup_notifications
   echo "I: check in upstream tarball and setup branch layout"
   tmpdir=`mktemp -dt new-git-tmp.XXXXXXXXXX`
   trap "rm -rf $tmpdir" EXIT
@@ -54,13 +75,16 @@
    # see #475554
    #git commit --allow-empty -m 'commit root'
    #git branch upstream
-   git-import-orig --pristine-tar --no-dch "$TARBALL")
+   git-import-orig --pristine-tar --no-dch "$TARBALL"
+   git_push)
+elif git show-ref --quiet 2>/dev/null ; then
+  echo "I: we are in a git repos"
+  git_push
+  setup_notifications
+else
+  setup_notifications
 fi
 
-echo "I: pushing first changes to alioth.d.o"
-(cd $tmpdir
- git remote add origin "git+ssh://git.debian.org/$REPODIR"
- git push --all)
 
 echo "I: all done. You can now checkout your new git repo with:"
 echo




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