Black: fatal: ambiguous argument 'stable': unknown revision or path not in the working tree.

Created on 30 Apr 2020  路  4Comments  路  Source: psf/black

[INFO] Initializing environment for https://github.com/ambv/black.
An unexpected error has occurred: CalledProcessError: Command: ('/Library/Developer/CommandLineTools/usr/libexec/git-core/git', 'reset', 'stable', '--hard')
Return code: 128
Expected return code: 0
Output: (none)
Errors:
fatal: ambiguous argument 'stable': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'

bug

Most helpful comment

@hugovk It looks pre-commit does not allow that. Using one of the tags, say 19.10b0 fixes the issue.

All 4 comments

Same error here. It is trying to retrieve some commit/tag called stable, and that has been removed?

The stable tag has been deleted, there's now only calver tags:

https://github.com/psf/black/tags

It changed in March in https://github.com/psf/black/issues/760:

OK, this is solved. stable is no longer a tag, it is a branch.

The REAME still says advertises the stable tag for .pre-commit-config.yaml:

repos:
  - repo: https://github.com/psf/black
    rev: stable
    hooks:
      - id: black
        language_version: python3.6

And:

Finally, stable is a tag that is pinned to the latest release on PyPI. If you'd rather run on master, this is also an option.

Is it possible to tell pre-commit to use the stable branch?

@hugovk It looks pre-commit does not allow that. Using one of the tags, say 19.10b0 fixes the issue.

Yes, it's best to point pre-commit to immutable tags

Was this page helpful?
0 / 5 - 0 ratings

Related issues

testvinder picture testvinder  路  3Comments

decibyte picture decibyte  路  3Comments

kissgyorgy picture kissgyorgy  路  3Comments

layoaster picture layoaster  路  3Comments

dimaqq picture dimaqq  路  3Comments