Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to merge release back to develop #291

Merged

Conversation

dtabuenc
Copy link
Contributor

@dtabuenc dtabuenc commented Nov 8, 2014

This preserves the correct version when merging a release back into develop.

There are some behavioral changes as shown in the edited tests:

The behavior of the +n CommitsSinceTag metadata is changed to actually represent the commits since last tag. This means that this number gets reset to zero on change of PreReleaseTag. For instance, version 1.0.0-beta.1+5 gets reset to 1.0.0-beta.2+0 for the next commit after the 1.0.0-beta.1 tag). When only one tag is present, (i.e. the first tag in the release branch) it reverts to the previous behavior which is to indicate the number of commits since the creation of the release branch.

This preserves the correct version when merging a release back into develop.
This also changes the semantics of the 0+1 part of the semantic version so that it represents the number of changes since the previous tagged release (e.g. version 1.0.0-beta.1+5 gets reset to 1.0.0-beta.2+0)
@@ -41,6 +37,11 @@ public bool FindVersion(GitVersionContext context, out SemanticVersion semanticV
return true;
}

SemanticVersionPreReleaseTag CreateDefaultPreReleaseTag(GitVersionContext context, string versionString)
{
return context.CurrentBranch.Name.Replace("-" + versionString, string.Empty) + ".1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be - or /

Thinking about it, our tests should verify both. I might do that in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not sure. I kept the existing behavior, just extracted it to a method.

JakeGinnivan added a commit that referenced this pull request Nov 16, 2014
Ability to merge release back to develop
@JakeGinnivan JakeGinnivan merged commit cdca529 into GitTools:master Nov 16, 2014
@JakeGinnivan JakeGinnivan added this to the 1.4.0 milestone Nov 16, 2014
@JakeGinnivan
Copy link
Contributor

Sweet, thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants