From e7d55899f3ef1516c197c0288d0059150191b821 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 25 Feb 2011 20:33:58 +0530 Subject: [PATCH] fork adc acquired some good ideas from the KDE folks --- contrib/adc/fork | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/adc/fork b/contrib/adc/fork index 63a66b8..ff2a9cb 100755 --- a/contrib/adc/fork +++ b/contrib/adc/fork @@ -3,6 +3,7 @@ . $(dirname $0)/adc.common-functions [ -z "$GL_RC" ] && die "ENV GL_RC not set" +[ -z "$2" ] && die "Usage: fork source_repo target_repo" # get_rights_and_owner now also sets $repo; see comments in common functions get_rights_and_owner $1; from=$repo @@ -15,6 +16,8 @@ get_rights_and_owner $2; to=$repo git clone --bare -l $GL_REPO_BASE_ABS/$from.git $GL_REPO_BASE_ABS/$to.git [ $? -ne 0 ] && exit 1 +echo "$from forked to $to" + # fix up creator, gitweb owner, and hooks cd $GL_REPO_BASE_ABS/$to.git echo $GL_USER > gl-creater @@ -27,6 +30,8 @@ if [ -n "$GL_WILDREPOS_DEFPERMS" ]; then echo "$GL_WILDREPOS_DEFPERMS" > gl-perms fi +echo "$from" > gl-forked-from + # run gitolite's post-init hook if you can (hook code expects GL_REPO to be set) export GL_REPO; GL_REPO="$to" [ -x hooks/gl-post-init ] && hooks/gl-post-init