+++ /dev/null
-#!/bin/bash
-# git-push-public
-#
-# Push changes from local git repositories marked as public, via the
-# git-daemon-export-ok flag, to the public server.
-
-LOCALBASE=/var/lib/git
-PUBLICBASE=/var/cache/git
-PUBLICSERVER=oss.titaniummirror.com
-
-echo "Updating remote public repositories"
-cd $LOCALBASE
-for path in $(find . -name git-daemon-export-ok); do
- repo="${path/\/git-daemon-export-ok/}"
- repo="${repo/.\//}"
- echo "Repository $repo"
- if ! ssh $PUBLICSERVER test -d $PUBLICBASE/$repo ; then
- # Repo does not exist on public server, so create it
- echo "Creating repository $repo on remote"
- ssh $PUBLICSERVER git --git-dir=$PUBLICBASE/$repo init --bare
- ssh $PUBLICSERVER touch $PUBLICBASE/$repo/git-daemon-export-ok
- scp $repo/description $PUBLICSERVER:$PUBLICBASE/$repo/
- ssh $PUBLICSERVER "echo \"git://$PUBLICSERVER/$repo\" \
- > $PUBLICBASE/$repo/cloneurl"
- fi
- git --git-dir=$repo push --mirror $PUBLICSERVER:$PUBLICBASE/$repo
-done
+++ /dev/null
-#!/bin/sh
-#
-# server-gc -- Run git-gc on each git repository found within the provided
-# filesystem directory tree. Useful for shared on-server repos that don't
-# automatically do gc operations. This script was first posted at
-# http://groups.google.com/group/repo-discuss/web/repository-repacking
-#
-# NOTE: THIS UTILITY DOES NOT REALLY APPEAR TO BE NEEDED.
-
-if [ $(whoami) != "root" ]; then
- echo "usage: $0 must be ran as root" >&2
- exit 1
-fi
-
-TOP=$1
-if [ ! -d "$TOP" ]; then
- echo "usage: $0 <topdir>>" >&2
- exit 1
-fi
-
-cd $TOP
-for p in $(find . -type d -name \*.git | sed 's,^./,,')
-do
- d=$TOP/$p
- echo
- echo "*** Repository $d ***"
-
- git --git-dir=$d config repack.usedeltabaseoffset true
- git --git-dir=$d config pack.compression 9
- git --git-dir=$d config pack.indexversion 2
-
- git --git-dir=$d config gc.autopacklimit 4
- git --git-dir=$d config gc.packrefs true
- git --git-dir=$d config gc.reflogexpire never
- git --git-dir=$d config gc.reflogexpireunreachable never
-
- case $p in
- kernel/lk.git)
- : use defaults
- ;;
- kernel/*)
- git --git-dir=$d config pack.threads 6
- git --git-dir=$d config pack.window 250
- git --git-dir=$d config pack.depth 50
- ;;
- esac
-
- rm -rf $d/logs/refs/changes 2>/dev/null
-
- git --git-dir=$d gc --auto --aggressive --prune || break
-
- (find $d/refs/changes -type d | xargs rmdir;
- find $d/refs/changes -type d | xargs rmdir
- ) 2>/dev/null
-done
+++ /dev/null
-#!/bin/bash
-#
-# Usage: update-mirror <url of upstream> <local project dirname>
-#
-# Derived from girocco's taskd/clone.sh script. See
-# http://repo.or.cz/w/girocco.git
-
-set -e
-
-cfg_gitweburl=http://$(hostname)/gitweb
-cfg_reporoot=/var/lib/git/mirrors
-
-url=$1
-projdir=$2
-
-proj="${projdir%.git}"
-
-echo "[$proj] update mirror"
-echo "[$proj] $url -> $projdir"
-
-if [ ! -d "$cfg_reporoot/$projdir" ]; then
- echo "[$proj] $projdir is a new project"
- mkdir -p "$cfg_reporoot/$projdir"
- touch "$cfg_reporoot/$projdir/.new_clone"
-fi
-touch "$cfg_reporoot/$projdir/.clone_in_progress"
-
-cd "$cfg_reporoot/$projdir"
-trap "echo \"[$proj] clone failed\"; touch .clone_failed" EXIT
-
-mail="sysadmin"
-
-# Initial mirror
-echo "[$proj] mirroring..."
-case "$url" in
- svn://* | svn+http://* | svn+https://*)
- # we just remove svn+ here, so svn+http://... becomes http://...
- svnurl="${url#svn+}"
- if [ -f "$cfg_reporoot/$projdir/.new_clone" ]; then
- echo "[$proj] initial git-svn setup"
- git --git-dir . --bare init
- git --git-dir . svn init -s --prefix=svn-origin/ "$svnurl"
- # have git-svn store branches under svn-origin/heads/* not svn-origin/*
- # FIXME: may need to do similar when new branches are added
- git --git-dir . config svn-remote.svn.branches \
- "$(git config --get svn-remote.svn.branches | \
- sed 's|:refs/remotes/svn-origin/\*$|:refs/remotes/svn-origin/heads/*|')"
- git --git-dir . svn fetch
- # Neat Trick suggested by Miklos Vajna
- git --git-dir . config remote.origin.url .
- git --git-dir . config remote.origin.fetch \
- '+refs/remotes/svn-origin/heads/*:refs/heads/*'
- git --git-dir . config --add remote.origin.fetch \
- '+refs/remotes/svn-origin/trunk:refs/heads/master'
- git --git-dir . config --add remote.origin.fetch \
- '+refs/remotes/svn-origin/tags/*:refs/tags/*'
- rm -f "$cfg_reporoot/$projdir/.new_clone"
- fi
- echo "[$proj] fetching new commits from upstream"
- git --git-dir . svn fetch
- git --git-dir . fetch
- ;;
-
- darcs://*)
- echo "[$proj] darcs mirrors not yet supported"
- exit 1
- httpurl="${url/darcs:\/\//http://}"
- /usr/bin/darcs-fast-export --export-marks=$(pwd)/dfe-marks "$httpurl" | \
- git fast-import --export-marks=$(pwd)/gfi-marks
- # This is here because by default only the exit code of
- # git fast-import is checked
- [ ${PIPESTATUS[0]} = 0 -a ${PIPESTATUS[1]} = 0 ]
- ;;
-
- bzr://*)
- echo "[$proj] bazaar mirrors not yet supported"
- exit 1
- # we just remove bzr:// here, a typical bzr url is just
- # "lp:foo"
- bzrurl="${url#bzr://}"
- bzr fast-export --export-marks=$(pwd)/bfe-marks "$bzrurl" | \
- git fast-import --export-marks=$(pwd)/gfi-marks
- [ ${PIPESTATUS[0]} = 0 -a ${PIPESTATUS[1]} = 0 ]
- ;;
-
- *)
- if [ -f "$cfg_reporoot/$projdir/.new_clone" ]; then
- echo "[$proj] initial git setup"
- git --git-dir . --bare init
- git --git-dir . remote rm origin >/dev/null 2>&1 || :
- git --git-dir . remote add --mirror origin "$url"
- fi
- echo "[$proj] fetching new commits from upstream"
- git --git-dir . remote update
- git --git-dir . remote prune origin
- ;;
-esac
-
-# The rest
-git update-server-info
-trap "" EXIT
-rm .clone_in_progress
-echo "[$proj] clone updated. See $cfg_gitweburl/?p=mirrors/$projdir;a=summary"