pangenome / pggb

the pangenome graph builder
https://doi.org/10.1038/s41592-024-02430-3
MIT License
368 stars 41 forks source link

Add pggb version to its own log #408

Closed ASLeonard closed 1 month ago

ASLeonard commented 1 month ago

There is no record of what pggb version was used in the log files, which is probably useful information to check in case tool are out of sync.

On a side note, the pggb --version command only seems to work if you have the git version rather than a release tar. That gives an error like

fatal: Not a valid object name HEAD

Maybe there should be a release-pinned version as a variable to fall back on if the git version is not defined.

ASLeonard commented 1 month ago

Something like

PGGB_RELEASE_VERSION="v0.6.0"
SCRIPT_DIR=$( cd -- "$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}" )" )" &> /dev/null && pwd )
GIT_VERSION=$(cd "$SCRIPT_DIR"; git describe --always --tags --long 2> /dev/null || echo $PGGB_RELEASE_VERSION)

seems to work for both git/tar versions

AndreaGuarracino commented 1 month ago

I like that, better than nothing. Thank you for the commits and the tests!