Skip to content

Support Using git-cliff as Pre-commit Hook #1595

Description

@mischif

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

I want to use git-cliff to keep my changelog up-to-date. Most of the time I can remember to run it before I commit but the best way to deal with this is to not have to think about it in the first place; thus I want to use git-cliff as a pre-commit hook that runs automatically so I don't have to think about it.

Desired solution

Two parts:

  • A --check option for git-cliff that compares the current changelog to a newly-generated one: returns 0 if they're the same, returns 1 if not. It could also have the option to replace the current changelog so committing a second time just works.
  • A pre-commit hook I can add to my .pre-commit-config.yaml file to run git-cliff automatically on commit.

Alternatives considered

Writing my own pre-commit hook:

  • I could do this, but I likely wouldn't keep up with updates like the project maintainers; I think this could be easily added to some update pipeline, and the ruff hook suggests creating one wouldn't be so hard.

Additional context

No response

Activity

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

Metadata

Metadata

Assignees

Labels

feature/requestNew feature or requestwontfixThis will not be worked on

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions