Issue 538: create-project creates extra repo directory when used to add an existing repo
Status:  Released
Owner: ----
Closed:  Mar 2012

Blocked on:
issue 537
Reported by ahmonda...@gmail.com, Apr 16, 2010
Scenario:
 * gerrit.basePath=/repo/git
 * There's an existing bare repo called 'xyz' (/repo/git/xyz)

I want to add this repo to gerrit's project list so I do "ssh gerrit-host 
gerrit create-project --name xyz".  The command completes successfully and 
the project is added to gerrit's list.  However, I notice as a side effect 
that a /repo/git/xyz.git directory has been created.  It seems to be a 
completely fresh repo.  However, all change submissions work against the real 
repo (/repo/git/xyz) as desired.



Apr 24, 2010
#1 sop@google.com
Gerrit didn't correctly identify the existing repository.

Fixed by I322294ff4595dc7995789bb38750c678188c2aa9 where
we now abort the create-project, because the repository is
already on disk.
Status: Fixed
Labels: FixedIn-2.1.2.3
Blockedon: 537
Apr 25, 2010
#2 dancys...@gmail.com
Does that mean one cannot add an existing repo as a gerrit project?  Or does this mean that create-project will 
do enough to add the repo to the project just, but won't attempt to actually create the repo if it already exists?

Apr 27, 2010
#3 kevin.la...@gmail.com
I'd like to know the answer to dancysoft's question, too.
Apr 27, 2010
#4 sop@google.com
Right now, create-project will fail out if the repository
already exists under basePath, even if it doesn't exist
in the database.

So there is no way to register a repository that already
exists under basePath.  However, you can run init to
rescan and import all projects into the database.

It may make sense to change create-project's behavior to
register an existing repository.  But I'd rather spend my
time on getting rid of that database altogether and rely
solely on the Git storage.  Then registration is unnecessary
and the server just picks it up automatically if its in the
proper location.

So if someone else sends a change to create-project to make
it register an existing directory, I'll merge it.  But I'm
not going to write that change myself because I'd like it to
be obsolete before the end of May.  Chasing these little bugs
that I know are just going to go away due to other features
just delays them going away.
Mar 27, 2012
#5 sop@google.com
(No comment was entered for this change.)
Status: Released