Skip to content

Pre-commit suggestions use mutable references, not supported #560

Closed
@slhck

Description

@slhck

Type

  • Content inaccurate
  • Content missing
  • Typo

URL

https://commitizen-tools.github.io/commitizen/#integrating-with-pre-commit

Description

Using these suggestions, the following content is added to the .pre-commit-config.yaml:

---
repos:
  - repo: https://github.com/commitizen-tools/commitizen
    rev: master
    hooks:
      - id: commitizen

When I then run:

pre-commit install --hook-type commit-msg

And then perform a commit, I get the following message:

[WARNING] The 'rev' field of repo 'https://github.com/commitizen-tools/commitizen' appears to be a mutable reference (moving tag / branch). Mutable references are never updated after first install and are not supported. See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details. Hint: pre-commit autoupdate often fixes this.

The "master" reference is mutable and should not be used. Rather reference the latest published tag:

---
repos:
  - repo: https://github.com/commitizen-tools/commitizen
    rev: v2.31.0
    hooks:
      - id: commitizen

Then it can be easily updated with:

$ pre-commit autoupdate                    
Updating https://github.com/commitizen-tools/commitizen ... already up to date.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions