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

Raise error when using branch name as rev #1255

Closed
verhovsky opened this issue Dec 28, 2019 · 1 comment
Closed

Raise error when using branch name as rev #1255

verhovsky opened this issue Dec 28, 2019 · 1 comment

Comments

@verhovsky
Copy link

verhovsky commented Dec 28, 2019

and print the SHA hash of the latest commit on that branch instead, for easier copy/pasting.

https://pre-commit.com/#using-the-latest-version-for-a-repository

pre-commit assumes that the value of rev is an immutable ref (such as a tag or SHA) and will cache based on that. Using a branch name (or HEAD) for the value of rev is not supported and will only represent the state of that mutable ref at the time of hook installation (and will NOT update automatically).

You should explicitly check for that and warn people (or error) instead of expecting them to read the docs. This repo makes that mistake for example https://github.com/doublify/pre-commit-clang-format

@asottile
Copy link
Member

this is a dupe of #974 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants