(adc fork) fork is now fast and space-efficient on the server
uses "git clone -l" then manually sets up the gl-creater and hooks (thanks to Jeff and the kde gang for asking ;-)
This commit is contained in:
parent
255a4ca9fa
commit
517786572d
|
@ -5,18 +5,16 @@ to=$2
|
|||
|
||||
. $(dirname $0)/adc.common-functions
|
||||
|
||||
# we cannot just say "cd $GL_REPO_BASE_ABS; git clone $from.git $to.git". That
|
||||
# won't set up the hooks or the gl-creater file that gitolite needs. So we now
|
||||
# have a new "git-init" command!
|
||||
|
||||
get_rights_and_owner $from
|
||||
[ -z "$perm_read" ] && die "no read permissions on $from"
|
||||
|
||||
get_rights_and_owner $to
|
||||
[ -z "$perm_create" ] && die "no create permissions on $to"
|
||||
|
||||
# let gitolite create the repo first
|
||||
SSH_ORIGINAL_COMMAND="git-init '$to'" $GL_BINDIR/gl-auth-command $GL_USER
|
||||
# then copy the refs from $from
|
||||
# clone $from to $to
|
||||
git clone --bare -l $GL_REPO_BASE_ABS/$from.git $GL_REPO_BASE_ABS/$to.git
|
||||
|
||||
# fix up creator, and hooks
|
||||
cd $GL_REPO_BASE_ABS/$to.git
|
||||
git fetch $GL_REPO_BASE_ABS/$from.git refs/*:refs/*
|
||||
echo $GL_USER > gl-creater
|
||||
cp -R $GL_REPO_BASE_ABS/$from.git/hooks/* $GL_REPO_BASE_ABS/$to.git/hooks
|
||||
|
|
|
@ -167,15 +167,6 @@ the client side:
|
|||
|
||||
or some such incantation.
|
||||
|
||||
**Implementation note**: you might notice that this script does not just do a
|
||||
"git clone ...". This is because creating a repo has to be done via gitolite.
|
||||
Otherwise, hooks won't get setup, and the all-important "gl-creater" file
|
||||
showing who owns the repo won't get created.
|
||||
|
||||
So now we have an actual command to just create a repo and do nothing else:
|
||||
`ssh git@server git-init \'reponame\'`. [Yes; those single quotes are
|
||||
required. Deal with it.]
|
||||
|
||||
<a name="rmrepo"></a>
|
||||
|
||||
#### rmrepo
|
||||
|
|
Loading…
Reference in a new issue