feat(git): skip commits listed in .git-blame-ignore-revs#1548
feat(git): skip commits listed in .git-blame-ignore-revs#1548arieleli01212 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 Harness. 🚀 New features to boost your workflow:
|
orhun
left a comment
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?
| 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); | ||
| } |
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)
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