Commits touching only .git-blame-ignore-revs are dropped from the changelog
What happened
Since 2.14.0, a commit whose only changed file is .git-blame-ignore-revs is dropped from the changelog, even though it is not listed in that file.
.git-blame-ignore-revs appears to be excluded as a path rather than only its listed revisions being excluded, so such a commit is left with no changed files and disappears. A commit that touches the ignore file alongside any other file is unaffected.
The exclusion is only active when the file contains at least one revision; an empty or comment-only file changes nothing.
This looks like a side effect of #1585 ("Ignore commits listed in .git-blame-ignore-revs").
Reproduction
#!/bin/sh
set -eu
dir="$(mktemp -d)"
cd "$dir"
git init -q .
git config user.email [email protected]
git config user.name Test
git commit -q --allow-empty -m "feat: unrelated commit"
# A commit whose only change is to .git-blame-ignore-revs.
: >.git-blame-ignore-revs
git add .git-blame-ignore-revs
git commit -q -m "chore: add .git-blame-ignore-revs"
# A commit that changes it alongside something else.
echo x >other.txt
echo "# note" >.git-blame-ignore-revs
git add other.txt .git-blame-ignore-revs
git commit -q -m "chore: touch it and another file"
git commit -q --allow-empty -m "feat: the commit we will ignore"
target="$(git log -1 --format=%H --grep='the commit we will ignore')"
echo "--- with .git-blame-ignore-revs empty ---"
: >.git-blame-ignore-revs
git cliff --unreleased 2>/dev/null | grep '^- '
echo "--- after listing only \$target in .git-blame-ignore-revs ---"
printf '%s\n' "$target" >.git-blame-ignore-revs
git cliff --unreleased 2>/dev/null | grep '^- 'Actual output (2.14.1)
--- with .git-blame-ignore-revs empty ---
- Unrelated commit
- The commit we will ignore
- Add .git-blame-ignore-revs
- Touch it and another file
--- after listing only $target in .git-blame-ignore-revs ---
- Unrelated commit
- Touch it and another fileAdd .git-blame-ignore-revs is gone. It is not listed in the file; its only distinction is that it is the one commit whose entire diff is that path.
Expected
--- after listing only $target in .git-blame-ignore-revs ---
- Unrelated commit
- Add .git-blame-ignore-revs
- Touch it and another fileOnly the listed revision should be omitted.
Why it is easy to miss
The entry disappears from a section that was released long ago, so it shows up as a deletion in a changelog regeneration rather than as anything wrong with the current release. In our case a routine git-cliff upgrade — from an unpinned install resolving to latest — removed a December entry from a release PR prepared in September, and nothing in the diff pointed at the cause.
Version
git-cliff 2.14.1, aarch64-apple-darwin, from the GitHub release archive. 2.13.1 does not exhibit it; I have not tested 2.14.0 separately.
Source: orhun/git-cliff