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

Support limiting the number of tags to process #844

Open
1 task done
dbwodlf3 opened this issue Sep 9, 2024 · 4 comments
Open
1 task done

Support limiting the number of tags to process #844

dbwodlf3 opened this issue Sep 9, 2024 · 4 comments
Assignees
Labels
feature/request New feature or request good first issue Good for newcomers

Comments

@dbwodlf3
Copy link

dbwodlf3 commented Sep 9, 2024

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

git-cliff --tag-pattern (?i)prod-.* --tag-n 3

Desired solution

If there are tags like prod-240601, prod-240701, prod-240801, prod-240901, and the latest tag prod-241001, only prod-241001, prod-240901 and prod-240801 should be selected.

Alternatives considered

already there are tag pattern options, it is very easy to add this option.

Additional context

Example shell script
#!/bin/bash

tags=$(git tag -i --sort=taggerdate -l "prod-*" | tail -n 3)
first=$(echo "$tags" | head -n 1)
last=$(echo "$tags" | tail -n 1)
range=$(echo "$first..$last")

git-cliff --tag-pattern "(?i)prod-*" $range -o changelog.md
@dbwodlf3 dbwodlf3 added the feature/request New feature or request label Sep 9, 2024
Copy link

welcome bot commented Sep 9, 2024

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

@orhun
Copy link
Owner

orhun commented Sep 9, 2024

Hello, thanks for the issue 👋🏼

Can you give more details about your use case? I'm curious if 3 is just an arbitrary number of if you have a semver-related use case of some sort.

Also, is the example shell script you attached working fine as a workaround?

already there are tag pattern options, it is very easy to add this option.

We already have limit_commits option, I think we can also add limit_tags. Would you be interested in contributing? 🐻

@orhun orhun changed the title Support Selecting a Limited Number of Tags Matching a Pattern Support limiting the number of tags to process Sep 9, 2024
@orhun orhun removed their assignment Sep 9, 2024
@orhun orhun added the good first issue Good for newcomers label Sep 9, 2024
@dbwodlf3
Copy link
Author

dbwodlf3 commented Sep 10, 2024

the 3 is just arbitrary number to test.

The example shell script works well in my pipeline. (Actually, I had to do a few things, but after a few days, git-cliff supported my wrapper code with more features, like JSON export. 😭)

We generate the git-cliff JSON, convert it to ADF (Atlassian Document Format), and post it on Confluence as part of the monthly scheduled release.

okay i will do it. If you don't mind reviewing my code

@orhun
Copy link
Owner

orhun commented Sep 15, 2024

okay i will do it. If you don't mind reviewing my code

Yup, please go ahead!

We generate the git-cliff JSON, convert it to ADF (Atlassian Document Format), and post it on Confluence as part of the monthly scheduled release.

Have you seen the new --from-context option, it sounds like it might also come in handy for your use case :)

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