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

Improve story for adding GitVersion into legacy repository #296

Closed
gep13 opened this issue Nov 11, 2014 · 6 comments · Fixed by #308
Closed

Improve story for adding GitVersion into legacy repository #296

gep13 opened this issue Nov 11, 2014 · 6 comments · Fixed by #308
Milestone

Comments

@gep13
Copy link
Member

gep13 commented Nov 11, 2014

As discussed here:

getsentry/raven-csharp@2b08830#commitcomment-8521534

@JakeGinnivan came up with the following


I think develop version calculation is broken for this scenario...

Basically the issue is that there is 'special' version calculation logic for the develop branch, so the tags do not have to be reachable by develop. This is so after you merge the release branch into master you don't have to merge master into develop.

It looks for a merge commit with the same name on both master and develop. It then looks for a tag on that merge commit, and that is the last common version which is used to calculate.

It's crap, but you have to:

git checkout -b release-1.4.1
# touch a file
git commit -am "Touched file"
git checkout develop
git merge release-1.4.1 --no-ff
git checkout master
git merge release-1.4.1 --no-ff
git branch -d release-1.4.1
git tag 1.4.1 -f

There should be a better story for this, I haven't done much work with the GitFlow side of things. After you have done this you should be fine going forward

gep13 referenced this issue in getsentry/raven-csharp Nov 11, 2014
@asbjornu
Copy link
Member

@gep13 Thanks for creating this issue!

Having a fallback strategy would be great! As I have problems with getting GitVersion to understand another repository layout as well (as explained in #283) and there are other issues asking for configurability of the repository layout (like #292), perhaps the way to solve all of these is a way to explain to GitVersion how the layout is, what represents the branch that ultimately should produce stable NuGet packages, what branches should produce prerelease ones, how the tags look like, etc.

@gep13
Copy link
Member Author

gep13 commented Nov 12, 2014

@asbjornu yes, I think that this is something that we need to work towards as well.

@JakeGinnivan
Copy link
Contributor

Suggestion to fix:

We should fall back to the last reachable tag if the same merge commit strategy doesn't work

@JakeGinnivan JakeGinnivan added this to the 1.4.0 milestone Nov 15, 2014
@JakeGinnivan
Copy link
Contributor

Figured it out finally.

GitFlow assumes that tags are only {major}.{minor}.{patch}, having a four part version number breaks the parsing and the tag is ignored.

Easy fix!

@asbjornu
Copy link
Member

Awesome! Looks like a beautiful solution as well: 315 deletions. 😃

@JakeGinnivan
Copy link
Contributor

Love it when a fix involves deleting code!

Sent from my Windows Phone


From: Asbjørn Ulsbergmailto:notifications@github.com
Sent: ‎17/‎11/‎2014 12:03
To: ParticularLabs/GitVersionmailto:GitVersion@noreply.github.com
Cc: Jake Ginnivanmailto:jake@ginnivan.net
Subject: Re: [GitVersion] Improve story for adding GitVersion into legacy repository (#296)

Awesome! Looks like a beautiful solution as well: 315 deletions. [:smiley:]


Reply to this email directly or view it on GitHubhttps://github.com//issues/296#issuecomment-63295404.

JakeGinnivan added a commit to JakeGinnivan/GitVersion that referenced this issue Nov 30, 2014
@SimonCropp SimonCropp added the bug label Dec 16, 2014
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 a pull request may close this issue.

4 participants