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

Fetch commits from non-default branches on GitHub #1050

Open
1 task done
william-stacken opened this issue Feb 18, 2025 · 3 comments · May be fixed by #1086
Open
1 task done

Fetch commits from non-default branches on GitHub #1050

william-stacken opened this issue Feb 18, 2025 · 3 comments · May be fixed by #1086
Labels
feature/request New feature or request integration Related to remote integration

Comments

@william-stacken
Copy link

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

When the GitHub remote is used (and potentially for other remotes as well) the commits are fetched only from the default branch. To fetch commits from an arbitrary branch, one can use the sha query parameter when calling GitHub's API. git-cliff does not give this parameter, which means that the sha falls back to the default branch.

Desired solution

Parse the git RANGE argument given to git cliff and set the sha query param to the head of the range. For example, if the range is v1.0..v1.1, then the URL used to fetch commits becomes https://api.github.com/repos/owner/repo/commits?per_page={MAX_PAGE_SIZE}&page={page}&sha=v1.1

Alternatives considered

Create a separate cli argument, for example --commit-head, that can be used to set the sha query param instead of parsing the RANGE. Or perhaps some general solution that allows the user to configure the API calls that git cliff issues.

Additional context

We are using the trunk-based workflow while developing, which means that we occationally create hotfix branches that we create releases from. We would then like to generate release notes for this "hotfix release".

@william-stacken william-stacken added the feature/request New feature or request label Feb 18, 2025
Copy link

welcome bot commented Feb 18, 2025

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

@orhun orhun removed their assignment Feb 20, 2025
@orhun
Copy link
Owner

orhun commented Feb 20, 2025

Hey, good catch! Thanks for reporting.

I agree that re-using the commit_range parameter as sha would be a good idea, would you be down to implement this feature?

P.S. I'm not sure how this would look like for other remotes...

@orhun orhun added the integration Related to remote integration label Feb 20, 2025
@william-stacken william-stacken linked a pull request Mar 11, 2025 that will close this issue
12 tasks
@william-stacken
Copy link
Author

Sure, I have implemented support for this in #1086

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 integration Related to remote integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants