Skip to content
Snippets Groups Projects
Commit 76ef2fe0 authored by juga's avatar juga
Browse files

fix: Add at build time the git revion to version

Instead of having a hardcoded version, calculate the version at build
time making use of `git describe --tags --dirty --always`.

This way, even if the program is not running from inside a git
repository it still can know which was the git revision from the
source it was installed from.
If the program is launched from a path that is a git repository, it
does not gives the git revision of that other repository.

If's also able to get the version when installed from a tarball.
It does not add the git revision when it's being install from a git
tag.

`versioneer` external program is only needed the first time, because
it copies itself into the repository. So it does not add an external
dependency.

There're no changes needed to the `--version` cli argument nor to the
code that generates the bandwidth file, since they both use the
variable `__version__`.

The version previous to this commit was `1.1.1-dev0`, after
this commit, it becomes `1.1.0+xx.gyyyyyyyy`, ie. xx commits after
`1.1.0` plus the git short hash (yyyyyyyy).

Closes: #30899.
parent c36518cb
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment