feat(git): skip commits listed in .git-blame-ignore-revs#1548
Open
arieleli01212 wants to merge 6 commits into
Open
feat(git): skip commits listed in .git-blame-ignore-revs#1548arieleli01212 wants to merge 6 commits into
arieleli01212 wants to merge 6 commits into
Conversation
…ching feature When a user's template references variables like `github.contributors` or `commit.gitlab` but the binary was compiled without the corresponding feature flag (`github`, `gitlab`, etc.), the rendering silently produces empty output with no indication of why. Add a `warn_if_remote_template_variables_without_feature` check in `Changelog::build` that emits a `tracing::warn` for each remote whose template variables are present but whose Cargo feature is absent. Fixes orhun#659
…abled The warn_if_remote_template_variables_without_feature function declared a `templates` Vec that was only accessed inside cfg-gated blocks. When all remote features are compiled in (the default build), every `#[cfg(not(feature = "..."))]` condition is false, so `templates` is never read — triggering an unused-variable error under `-D warnings`. Restructure: move the templates array construction inline inside each macro expansion. Each branch is self-contained and only compiled when the corresponding feature is absent, so there is no unused variable in any build configuration.
Track all PR numbers for a contributor within a single release in a new `pr_numbers: Vec<i64>` field, sorted in ascending order. The existing `pr_number` field is preserved for backward compatibility.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1548 +/- ##
==========================================
+ Coverage 48.65% 48.65% +0.01%
==========================================
Files 26 26
Lines 2288 2296 +8
==========================================
+ Hits 1113 1117 +4
- Misses 1175 1179 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
orhun
reviewed
Jun 20, 2026
orhun
left a comment
Owner
There was a problem hiding this comment.
Thanks for the PR! It looks good, however it seems like there are some unrelated changes included (in changelog, commit, etc. modules) Can you check?
Comment on lines
+789
to
+798
| let blame_ignore_file = repository.root_path()?.join(BLAME_IGNORE_REVS_FILE); | ||
| if blame_ignore_file.exists() { | ||
| let contents = fs::read_to_string(&blame_ignore_file)?; | ||
| let commits = contents | ||
| .lines() | ||
| .filter(|v| !(v.starts_with('#') || v.trim().is_empty())) | ||
| .map(|v| String::from(v.trim())) | ||
| .collect::<Vec<String>>(); | ||
| skip_list.extend(commits); | ||
| } |
Owner
There was a problem hiding this comment.
I think this the essence of this PR and it looks good :)
We can remove the rest of the changes (and possibly update the documentation about this change)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1084.
When a
.git-blame-ignore-revsfile exists at the repository root, git-cliff now automatically skips any commit whose SHA is listed in it.This follows the same approach as
.cliffignore: the file is parsed for non-comment, non-empty lines (each line being a commit SHA), and each SHA is added to the skip list as aCommitParserwithskip = true. No configuration is needed — it's always-on when the file is present, matching the "sane defaults" direction discussed in the issue.The
.git-blame-ignore-revsformat is identical to whatgit blame --ignore-revs-fileexpects:#are comments and are ignoredChanges:
git-cliff-core/src/lib.rs— addBLAME_IGNORE_REVS_FILEconstantgit-cliff/src/lib.rs— read the file and extend the skip list, right after the existing.cliffignorehandling