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
feat: support count_tags option #599
base: main
Are you sure you want to change the base?
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️ |
Before:$ GITHUB_TOKEN=*** git cliff v0.7.0..v0.7.2
🚀 Features
🐛 Bug Fixes
🚜 Refactor
📚 Documentation
🧪 Testing
⚙️ Miscellaneous Tasks
Build
New ContributorsAll ContributorsWe would like to thank the following contributors from the GreptimeDB community: @CookiePieWw, @J0HN50N133, @MichaelScofield, @Taylor-lagrange, @WenyXu, @YCCDSZXH, @ZonaHex, @dimbtp, @discord9, @etolbakov, @evenyag, @fengjiachun, @killme2008, @niebayes, @shuiyisong, @sunng87, @tisonkun, @v0y4g3r, @waynexia, @xxxuuu, @zhongzc v0.7.1Release date: March 14, 2024 Breaking changes🚀 Features
🐛 Bug Fixes
🚜 Refactor
📚 Documentation⚡ Performance
🧪 Testing⚙️ Miscellaneous Tasks
BuildNew Contributors
All ContributorsWe would like to thank the following contributors from the GreptimeDB community: @MichaelScofield, @Taylor-lagrange, @WenyXu, @ZonaHex, @crwen, @discord9, @etolbakov, @evenyag, @fengjiachun, @gcmutator, @shuiyisong, @sunng87, @tisonkun, @v0y4g3r, @waynexia, @zhongzc After:$ GITHUB_TOKEN=*** /Users/tison/Brittani/git-cliff/target/debug/git-cliff v0.7.0..v0.7.2
🚀 Features
🐛 Bug Fixes
🚜 Refactor
📚 Documentation
⚡ Performance
🧪 Testing
⚙️ Miscellaneous Tasks
Build
New Contributors
All ContributorsWe would like to thank the following contributors from the GreptimeDB community: @CookiePieWw, @J0HN50N133, @MichaelScofield, @Taylor-lagrange, @WenyXu, @YCCDSZXH, @ZonaHex, @crwen, @dimbtp, @discord9, @etolbakov, @evenyag, @fengjiachun, @gcmutator, @killme2008, @niebayes, @shuiyisong, @sunng87, @tisonkun, @v0y4g3r, @waynexia, @xxxuuu, @zhongzc |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #599 +/- ##
==========================================
- Coverage 41.27% 40.97% -0.30%
==========================================
Files 15 15
Lines 1071 1079 +8
==========================================
Hits 442 442
- Misses 629 637 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: tison <[email protected]>
47d4ef3
to
63cffa7
Compare
@@ -109,6 +109,9 @@ pub struct GitConfig { | |||
/// Regex to ignore matched tags. | |||
#[serde(with = "serde_regex", default)] | |||
pub ignore_tags: Option<Regex>, | |||
/// Regex to count matched tags. | |||
#[serde(with = "serde_regex", default)] | |||
pub count_tags: Option<Regex>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming is hard. I name it "count" because it's if "counted".
"include" may be an alternative, but .. we have two aspects here: (1) whether count the commit (2) whether count the tag.
@@ -109,6 +109,9 @@ pub struct GitConfig { | |||
/// Regex to ignore matched tags. | |||
#[serde(with = "serde_regex", default)] | |||
pub ignore_tags: Option<Regex>, | |||
/// Regex to count matched tags. | |||
#[serde(with = "serde_regex", default)] | |||
pub count_tags: Option<Regex>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, how we can support pass this option from command line?
Hey, thanks for the PR! 🐻 This option is pretty confusing to me right now, due to the fact that we have a couple of Can you remind me (with an example) in which use case this new option will come in handy? We should also mention this in the documentation as well. I'm happy to move on with this PR, or have a simpler solution based on what your use case is. |
@orhun Please take a look at #599 (comment). This is an example. Mainly, when the range selected contains multiple tags, instead of |
Sure. Where is the doc file? Also I'd like to know if it's automatically add a cli arg or I should modify other source code as well. |
@orhun as a reminder. Any further thoughts here? |
Sorry for the delay! I just took a look at this again and I think I understood your use case. But just to verify: do you want to include a tag in the changelog even if it is skipped or in the given range?
What do you mean by "breaking" the changelog here? Do you mean splitting it into two? It sounds like a very edge-case use-case though, so I'm not sure how to make this option intuitive for regular users. First step would be renaming Btw I didn't fully get the example you shared, since there were many commits and it makes it hard to read. Can you maybe share it again with minimal git history, such as git-cliff-readme-example? I just want to make sure everything is clear before moving on with this 🐻 |
I think the most understandable description is: It's hard to write reverse matches with ignore_tags, count_tags is the reverse version.
Yes. |
This is the simplified example: Before:$ GITHUB_TOKEN=*** git cliff v0.7.0..v0.7.2
v0.7.1Release date: March 14, 2024 Breaking changesAfter:$ GITHUB_TOKEN=*** /Users/tison/Brittani/git-cliff/target/debug/git-cliff v0.7.0..v0.7.2 |
@orhun do you still need extra information? |
Description
@orhun I found a patch is more expressive than issue.
This is tested locally that with
count_tags = "v0.7.2"
I can select commits fromv0.7.0..v0.7.2
and thev0.7.1
tag doesn't break changelog.I wonder how we can support pass this option from command line and if we can add some tests.
Motivation and Context
See GreptimeTeam/greptimedb#3650 (comment).
How Has This Been Tested?
Manually tested.
Screenshots / Logs (if applicable)
Types of Changes
Checklist: