Dimitrios K.
Dimitrios K.

Reputation: 1028

Git Flow - What's the develop's version when a release branch is 'active'?

I want to use git-flow in a new project. I've read a few articles and viewed some of the screencasts suggested in the github project. There's an unclear point regarding versioning. Let's assume the scenario below, where Cx is a commit and the numbers above or below the commit are the version of the branch at that point in time.

              0.1     0.1       0.1          0.2
- develop ---- C1 ---- C2 ------ C4 ------ Merge ----
- release/0.2           \ --- C3 --- C5 ---/
                             0.2    0.2

So, there is kind of a grey zone (in my opinion) after branching off release/0.2 from develop. Commit C4 is not exactly 0.1 nor 0.2. The develop branch will be bumped to 0.2 after merging release/0.2 back to develop, but C4 was not part of the 0.2 release. Personally, if I looked at a repository and saw an update to v0.2, I'd assume every commit before that merge commit was included in the release. The following is my expectation:

             0.1    0.1    0.2    0.2    0.2
- develop --- C1 --- C2 --- C3 --- C5 --- C4

Is my assumption wrong? Is it that we don't care how develop looks like, but we only care about master (since it's a result of dev + release branches)? I guess in the next release, all of those commits will be included as needed.

P.S. what's the artifact versions you use for nightlies? e.g. 0.1-SNAPSHOT? Following normal semver, 0.1-SNAPSHOT < 0.1 which doesn't hold. Also, according to git flow, you don't know what your next release version will be until you branch off, so 0.2-SNAPSHOT is also 'not allowed'.

Upvotes: 2

Views: 1386

Answers (1)

Vampire
Vampire

Reputation: 38724

I'd say you are slightly mistaken. This is how it should look like:

              0.1     0.1       0.2          0.2
- develop ---- C1 ---- C2 ------ C4 ------ Merge ----
- release/0.1           \ --- C3 --- C5 ---/
                             0.1    0.1

C3 and C5 are only bugfixes to stabilize the 0.1 release. As soon as you created the release branch, the develop branch will contain the next version. Where does git-flow say that you don't know what your next version on develop is? You should know what release you plan next and thus adjust the version accordingly, or simply increase the minor version as long as you only do backward compatible changes and bump the major version as soon as you introduce a backward incompatible change. Noone says you cannot do this on develop without releasing the intermediary version.

Upvotes: 1

Related Questions