pre-existing repo instructions were WRONG...

- fix them
  - but (at the cost of some efficiency) try to compensate if the admin
    did not follow those instructions, by running hook_1 anyway
This commit is contained in:
Sitaram Chamarty 2012-04-11 18:24:43 +05:30
parent 8c28fd2241
commit 4c5bb27739
4 changed files with 23 additions and 6 deletions

View file

@ -6,7 +6,7 @@ The following activities require command line access to the server
* changing anything in the [rc][] file
* installing custom [hooks][], whether to all repos or just some repos
* moving [existing][] (bare) repos into gitolite control
* moving [existing][] repos into gitolite control
Please read the [WARNINGS][] page first.

View file

@ -2,8 +2,21 @@
## #existing moving existing repos into gitolite
* move the repos to `$HOME/repositories`. Make sure they are all *bare*
repos, and the directory names end in ".git".
On the server:
* move the repos to `$HOME/repositories`.
* make sure that:
* they are all *bare* repos
* all the repo names end in ".git"
* all the files and directories are owned and writable by the gitolite
hosting user (especially true if you copied them as root)
* run `gitolite setup`. **If you forget this step, you can also forget
about write access control!**
Back on your workstation:
* [add them][repos] to conf/gitolite.conf in your clone of the admin repo,
then commit and push the change.
@ -11,8 +24,6 @@
If the repos are already covered by some [wild][] pattern, this is
optional.
* run `gitolite setup` to fix up the hooks on all repos, just in case.
## #moving moving servers
This is adapted from the "migrating" section of the [install][] page; if

View file

@ -1,8 +1,11 @@
# adding and removing repos
**NOTE**: this page describes how to add new repos. To bring already existing
repos into gitolite control, click [here][existing].
> ----
> *WARNING: Do NOT add repos directly on the server. Clone the
> *WARNING: Do NOT add new repos directly on the server. Clone the
> 'gitolite-admin' repo to your workstation, make changes to it, then add,
> commit, and push. When the push hits the server, the server "acts" upon
> your changes.*

View file

@ -161,6 +161,9 @@ sub new_repos {
next unless $repo =~ $REPONAME_PATT; # skip repo patterns
next if $repo =~ m(^\@|EXTCMD/); # skip groups and fake repos
# use gl-conf as a sentinel
hook_1($repo) if -d "$repo.git" and not -f "$repo.git/gl-conf";
new_repo($repo) if not -d "$repo.git";
}
}