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

Version command #112

Merged
merged 5 commits into from
Jul 19, 2024
Merged

Version command #112

merged 5 commits into from
Jul 19, 2024

Conversation

jannis-baum
Copy link
Owner

Close #111

@jannis-baum jannis-baum force-pushed the issue/111-version-command branch from 0a98e5d to 1fd31f3 Compare July 19, 2024 11:30
@jannis-baum
Copy link
Owner Author

jannis-baum commented Jul 19, 2024

@tuurep sorry if I am being too annoying with changes/new features lately, it'll tone down a lot again soon🙈

Here I added a -v/--version to viv (by adding it to vivify-server) which I think is an important feature we have been missing.

For this to work I had to make some changes to viv that allow the things that vivify-server prints during startup to be output to the user through viv. This enables us to do all argument parsing (other than --help) in vivify-server and handle the version number there and also print an error if a requested file doesn't exist. Might also be useful for future additions.

For the releases the version number will be the same as the tag names, e.g. v0.1.6. For local builds in between it will be {previous_tag}-{number_of_commits_since}-g{hash_of_head_commit}[-dirty] with -dirty being added in case there are uncommitted changes, e.g. v0.1.6-120-g05d074c for the last commit I made here. Or, if VIV_VERSION is set during make it will be that. 1

Would you mind doing a quick check and seeing if the building and getting the version number works for you as well? I would like to merge this as the final thing before v0.2.0. If it's too much work also let me know, no worries at all!

Footnotes

  1. Not that relevant, but just for completeness: For non-release builds that the CI makes it will be {PR-number}/merge, e.g. 112/merge here, and for the ones that happen on main simply main. Adding the full description like for local builds would require checking out the full repo with all the history which might be a bit unnecessary

@jannis-baum jannis-baum requested a review from tuurep July 19, 2024 11:58
@tuurep
Copy link
Collaborator

tuurep commented Jul 19, 2024

Yeah don't worry, it's been cool feeling productive on this project :D

The new flag works just fine:

$ viv --version
vivify-server v0.1.6-120-g05d074c
$ viv -v
vivify-server v0.1.6-120-g05d074c

@tuurep
Copy link
Collaborator

tuurep commented Jul 19, 2024

$ VIV_VERSION="trolol-edition" make install
...
$ viv --version
vivify-server trolol-edition

@jannis-baum jannis-baum merged commit 88fa0d5 into main Jul 19, 2024
5 checks passed
@jannis-baum jannis-baum deleted the issue/111-version-command branch July 19, 2024 13:54
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.

Version command
2 participants