Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 475788 - Specifying a non-existing master branch does not abort Gitflow initialization
Summary: Specifying a non-existing master branch does not abort Gitflow initialization
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Gitflow (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.1   Edit
Assignee: Max Hohenegger CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-25 06:45 EDT by Max Hohenegger CLA
Modified: 2015-09-10 07:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Hohenegger CLA 2015-08-25 06:45:21 EDT
Mathias reported the following behavior:
If a repository already contains a commit and a master branch and the user chooses a non-default name e.g. "master1" for the master branch this branch doesn't exist at that point. If later a release is finished gitflow tries to switch to the non existing non-default master branch "master1". Since this doesn't exist it raises an internal error:

An internal error occurred during: "Finishing release...".
No branch 'master1' found.

https://git.eclipse.org/r/#/c/54282/1

The reference implementation (1.9.0-dev.33 (AVH Edition)) behaves as follows:
$ git init
Initialized empty Git repository in tmp_foobar/.git/
$ touch foobar.txt
$ git add foobar.txt
$ git commit -m "foobar"
[master (root-commit) b257519] foobar
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foobar.txt
$ git flow init
Which branch should be used for bringing forth production releases?
   - master
Branch name for production releases: [master] master1
Fatal: Local branch 'master1' does not exist.

I think at the very least, EGit should behave the same way, and not let the initialization finish, if the specified master-branch does not exist.
For convenience, we could also offer to create the branch on demand.

This came up during implementation of 475293.
Comment 1 Eclipse Genie CLA 2015-08-29 08:23:27 EDT
New Gerrit change created: https://git.eclipse.org/r/54832
Comment 2 Eclipse Genie CLA 2015-09-10 07:46:42 EDT
Gerrit change https://git.eclipse.org/r/54832 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=02c3e6afc1e9e0b3a90e78e37ee04c14db2159fb
Comment 3 Matthias Sohn CLA 2015-09-10 07:48:11 EDT
submitted