htslib icon indicating copy to clipboard operation
htslib copied to clipboard

version.sh does not work for htslib as Git submodule

Open torbjoernk opened this issue 7 years ago • 2 comments

When including htslib as a Git submodule and building it from the parent project's build system via autoreconf && configure && make, the htslib version is not correctly detected.

The problem is, that in version.sh the test on whether htslib is build from a Git clone is also permitting a .git file. That is the case for submodules. However, then the subsequent git describe does not work - at least not as expected. https://github.com/samtools/htslib/blob/bcf9bff178f81c9c1cf3a052aeb6cbe32fe5fdcc/version.sh#L6-L11

To correct this, it would be better to test for .git being a directory and thus falling back to the same behaviour as for tarballs:

if [ -d .git ]

torbjoernk avatar Nov 30 '18 07:11 torbjoernk

Can you please explain in what way git describe does not work? I tried it with a submodule and it gives me the correct version back.

jkbonfield avatar Dec 04 '18 17:12 jkbonfield

the test on whether htslib is build from a Git clone is also permitting a .git file. That is the case for submodules.

I thought submodules were managed via a .gitmodules file. What's a .git file?

ryandesign avatar Apr 19 '24 22:04 ryandesign