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

Catch untracked files (and make version.sh work on shallow checkouts) #1324

Merged
merged 2 commits into from
Sep 9, 2021

Conversation

daviesrob
Copy link
Member

This PR contains two commits. The first fixes version.sh so that it works on --depth=1 clones of the repository. This both gets rid of the annoying "No names found, cannot describe anything." messages that were printed because git describe couldn't find a tag; and it also makes the version.sh report a correct-ish version string on such clones.

The second commit adds CI test support to catch any untracked files that make be present after build and test. Finding such files usually means they need to be added to .gitignore.

Use "git describe --always" to silence "No names found, cannot
describe anything." messages on shallow checkouts where the
last tagged release may not be available.  Where this is the case,
git describe --always returns the short commit hash.  This is
appended to the hard-coded version number to make something
similar to the normal git describe output.  As we don't know
how many commits there are from the last tag in this case, that
part is set to 1 for want of anything better.
@daviesrob
Copy link
Member Author

An example of an untracked file being caught can be seen in https://github.com/daviesrob/htslib/runs/3403088881

@jmarshall
Copy link
Member

Perhaps add something to the untracked message along the lines of “Please either clean up, or add to .gitignore, or for test output files consider naming them to match *.tmp[.*]“.

Adds a check for untracked files after the tests have run.  This
is enabled for two builds - one with configure, and one without.
The others skip the new test so that it's still possible to see
that a proposed change works irrespective of issues with untracked
files.
@daviesrob
Copy link
Member Author

The updated text is a bit long, but it's a useful hint so I've added it, thanks.

@whitwham whitwham merged commit 3eada2f into samtools:develop Sep 9, 2021
@daviesrob daviesrob deleted the catch-untracked branch September 22, 2021 08: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.

4 participants