Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore .git-blame-ignore-revs hashes #1084

Open
1 task done
michen00 opened this issue Mar 10, 2025 · 6 comments
Open
1 task done

Ignore .git-blame-ignore-revs hashes #1084

michen00 opened this issue Mar 10, 2025 · 6 comments
Labels
feature/request New feature or request good first issue Good for newcomers

Comments

@michen00
Copy link

michen00 commented Mar 10, 2025

Is there an existing issue or pull request for this?

  • 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

@michen00 michen00 added the feature/request New feature or request label Mar 10, 2025
Copy link

welcome bot commented Mar 10, 2025

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

@orhun orhun removed their assignment Mar 10, 2025
@orhun
Copy link
Owner

orhun commented Mar 10, 2025

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?

@orhun orhun added the good first issue Good for newcomers label Mar 10, 2025
@michen00
Copy link
Author

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 👍

@orhun
Copy link
Owner

orhun commented Mar 14, 2025

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?

@michen00
Copy link
Author

michen00 commented Mar 15, 2025

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?

@orhun
Copy link
Owner

orhun commented Mar 19, 2025

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/request New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants