Issue 299: create-project --branch does not create a branches table entry
Status:  Released
Owner: ----
Closed:  Mar 2012
Reported by grim...@gmail.com, Oct 12, 2009
Affected Version: 2.0.23
Environment: linux/jdk 1.6.15, MySQL, jetty 6.0.19

What steps will reproduce the problem?
1. issue a gerrit create-project command with --branch option
2.
3.

What is the expected output? What do you see instead?
expect a branches table entry to be made.  would be nice to create and
commit a branch.

Please provide any additional information below.
the --branch option does not seem to work.  I have gerrit 2.0.23 installed
on a server and created a project using the --branch option and there is no
db entry for a branch or branch existent in the repository.
Oct 21, 2009
Project Member #1 bklarson@gmail.com
I did some quick testing and can see an entry made in the branches table.

This might be confusing because the entry doesn't show up in the list of branches in 
Gerrit.  I suspect this is caused because the branch is empty and doesn't exist in git 
yet.  I'll do a little more debugging.
Oct 29, 2009
#2 sop+code@google.com
I think bklarson is right, the branch record should be created in the branches table, 
but the web UI shows the Git repository contents, and Git won't show a branch until it 
has at least 1 commit in it.  Since the project is new and empty, there is no commit 
on the branch, and the branch does not display.

I think its working as designed.  Though maybe we should consider creating a union of 
the branches table and the Git repository when displaying the branches in the Branches 
tab of a project.
Status: Accepted
Oct 29, 2009
Project Member #3 bklarson@gmail.com
A while ago we had a discussion on the groups about removing the branches table, but I 
can't find it anymore.  I think you decided to leave it around because it is helpful 
for permissions shortcomings.  Is it something we could consider dropping in the 
future?  This seems similar to the change to drop the patches table and just 
load/cache from git directly.

Also, just curious, would it be problematic if we created a new empty commit during 
create-project so the branch would exist in git?
Oct 29, 2009
#4 sop+code@google.com
Right, we probably just want to remove the branches table entirely.  Right now its 
only reason for being there is to prevent users from uploading changes for review to 
certain branches, but that's really difficult and error prone to manage anyway.

Hmm, given that, maybe we should just close this bug as WontFix and start dropping 
that table out of the database.  :-)
Nov 2, 2009
#5 sop+code@google.com
Fixed by changes
If19f3474a7b5e3adba3b09c470a01927fe46cb58 (remove branches table)
I4745116b12af09b32881ebe2a57355b143a4ebbe (display unborn HEAD)
Status: Fixed
Labels: FixedIn-2.0.24
Mar 27, 2012
#6 sop@google.com
(No comment was entered for this change.)
Status: Released