Set version as release when there are no commits ahead#3515
Set version as release when there are no commits ahead#3515dmaluka merged 1 commit intomicro-editor:masterfrom
Conversation
tools/build-version.go
Outdated
| // Get the tag of the current revision. | ||
| tag, _ := getTag("--exact-match") | ||
| if tag == versionStr { | ||
| if tag == versionStr || ahead == nil { |
There was a problem hiding this comment.
But doesn't that mean we've no versionStr right now?
I know we're coming from #3514 resp. termux/termux-packages#21286.
Edit:
Got it...it hits when a release will be tagged later as nightly and this tag is checked out instead of e.g. v2.0.14.
Edit2:
Should work. I tried it with a local v2.0.15 along to the actual nightly.
There was a problem hiding this comment.
If we do this if ahead is nil no matter what getTag("--exact-match") returned, why don't we check ahead before even calling getTag("--exact-match")?
There was a problem hiding this comment.
I didn't think much about checking ahead before calling getTag("--exact-match"). It does not have to be called when there are no commits between the version tag because the release version will be printed, so I will move the if statement before the call and remove tag == versionStr.
|
@dmaluka Do you agree? |
Print release version tag in tools/build-version.go even if the commit being checked has a tag that is not a version number if there are no commits ahead.
dd3826e to
48204e6
Compare
The release version that is built can be detected as a development version in
tools/build-version.gowhen the commit has another tag that is not a version number likenightly, so the release version is printed instead if there are no commits ahead in this pull request.