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

Allow to retrieve extended version information at runtime #130

Merged
merged 12 commits into from
Apr 15, 2021

Conversation

andrea-iob
Copy link
Member

@andrea-iob andrea-iob commented Jan 20, 2021

I've added a function (bitpit::getVersion()) that allows to retrieve version information at runtime. The version string contains the bitpit version plus additional information about git branch/commit. For example the version string may be like the following:

1.8.0-bitpit.add.git.info.to.version-de4aebf84-dirty

where:

  • 1.8.0 is the "standard" bitpit version
  • add.git.info.to.version is the current branch
  • de4aebf84 is the current commit
  • dirty is a (configurable) label that tells if the current source has uncommitted changes.

I haven't found a way to automatically re-run cmake (and thus update the version) if there are uncommitted changes. The "dirty" label will be reliably added only if, after changing the code, cmake is run manually.

Git information will be added only if the current HEAD is not associated with a tag in the form "bitpit-X.Y.Z" where "X.Y.Z" should match the version number. In this way git information will be shown only for development builds.

Copy link
Contributor

@roccoarpa roccoarpa left a comment

Choose a reason for hiding this comment

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

Fine for me.

@andrea-iob andrea-iob merged commit 4402610 into master Apr 15, 2021
@andrea-iob andrea-iob deleted the bitpit.retrieve.version branch April 15, 2021 09:55
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