Skip to content

Set version as release when there are no commits ahead#3515

Merged
dmaluka merged 1 commit into
micro-editor:masterfrom
niten94:nil-ahead-release
Oct 22, 2024
Merged

Set version as release when there are no commits ahead#3515
dmaluka merged 1 commit into
micro-editor:masterfrom
niten94:nil-ahead-release

Conversation

@niten94

@niten94 niten94 commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

The release version that is built can be detected as a development version in tools/build-version.go when the commit has another tag that is not a version number like nightly, so the release version is printed instead if there are no commits ahead in this pull request.

Comment thread tools/build-version.go Outdated
// Get the tag of the current revision.
tag, _ := getTag("--exact-match")
if tag == versionStr {
if tag == versionStr || ahead == nil {

@JoeKar JoeKar Oct 21, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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")?

@niten94 niten94 Oct 22, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@JoeKar

JoeKar commented Oct 21, 2024

Copy link
Copy Markdown
Member

@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.
@dmaluka dmaluka merged commit 2c6dc32 into micro-editor:master Oct 22, 2024
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.

3 participants