#1638·git-cliff

Support short SHAs in commit_parsers

Author: heathsCreated Sep 12, 2026Updated Sep 14, 2026
Labelsfeature/requestgood first issue

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

We can match commits in commit_parsers like so:

toml
commit_parsers = [
  # Rewrite history
  { sha = "20246539df88431c72d65d7d0d1b82fba3deec34", group = "<!-- 0 -->Added" }, # Initial commit
]

However, this is a bit of a hassle since git cliff -vv dumps the short SHA e.g.,

TRACE git_cliff_core::process                   > process_commits: 2024653 - Grouping error: `Commit does not belong to any group` (Initial commit)

I had quite a few and while it wasn't too hard to get the full SHAs, it would be much easier if we could just block copy the short SHAs you already printed out.

Short SHAs (7+ chars) should be plenty for most repos, but people could always use more so any number of unambiguous chars should be supported, erring if there is any ambiguity just like git would.

Desired solution

Support any number of unambiguous short SHAs and err like git would when any ambiguity is hit.

Alternatives considered

Use a script or agent to resolve the short SHAs as needed, which is what I did but it would've been easier to just avoid needing to.

Additional context

No response