git-cliff
git-cliff copied to clipboard
Ignore .git-blame-ignore-revs hashes
Is there an existing issue or pull request for this?
- [x] I have searched the existing issues and pull requests
Feature description
git cliff would ignore
- any commits referenced in .git-blame-ignore-revs
- any commits that modify only .git-blame-ignore-revs
(if the file exists).
Desired solution
A config to enable this in the .toml file would be great. I think it makes sense to enable the latter option by default too.
Alternatives considered
I had a convention for commits updating that file, so I wrote a pattern for it. Then halfway through the project, I updated that convention, so I wrote another pattern. But what if I didn't have a convention?
Additional context
No response
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️
Hey, thanks for creating the issue. I agree that this would be a nice addition :)
We already support a .cliffignore file for skipping commits. This is something similar to that, right? If so, that should be very straightforward.
Would you be interested in contributing this?
I am interested in contributing this! But to be honest, I'm not sure I will have the bandwidth to do so in a timely manner. If someone were to do it faster than me, I wouldn't mind and would appreciate using the feature.
But I did start drafting some edits. I created a draft PR in case you'd like to check in to see what direction I'm headed in. I'm just starting to learn Rust, so any feedback would be welcomed 👍
Hey @michen00, thanks for picking this up!
Would be better if you can submit the draft PR on this repo instead of your fork.
For the first step of the implementation, I'm thinking if we should have sane defaults instead of supporting configuration for this feature. e.g. we only support ".git-blame-ignore-revs" file and always filter_mono_commits_to_blame_ignore=true. What do you think?
What do you think?
Yeah, this sounds sensible and easier to achieve than supporting full configuration. Let's start with this for the first step.
submit the draft PR on this repo instead
I'll clean up my commits and re-submit here.
always
filter_mono_commits_to_blame_ignore=true
Yes 👍 : I can't imagine wanting (chore|docs): add yet another hash to ignore in blame in the changelog.
we only support ".git-blame-ignore-revs" file
For the next step of the implementation, I'm a little hesitant. This file can be configured via git config blame.ignoreRevsFile. Should we read it with something like git config --get blame.ignoreRevsFile? Or should it become a sane but configurable default?
I think having it as a sane default would be the way to go. I don't want to do much git operations in git-cliff - but it's worth checking out if git2 already has support for it (which is the Git handling library that git-cliff depends).