-
-
Notifications
You must be signed in to change notification settings - Fork 256
fix: Use current branch for GitHub API when no range is specified #1275
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
base: main
Are you sure you want to change the base?
fix: Use current branch for GitHub API when no range is specified #1275
Conversation
When running git-cliff --unreleased without a specific range, it now uses the current branch name for GitHub API calls instead of defaulting to the repository's default branch. This ensures that unreleased commits on feature/develop branches are properly matched with their corresponding pull requests. Fixes issue where GitHub metadata (PR numbers, titles) was not populated for unreleased commits on non-default branches. Also fixed .gitignore to ignore target/ insteand of /target
|
Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1275 +/- ##
==========================================
+ Coverage 43.46% 43.62% +0.16%
==========================================
Files 22 22
Lines 1972 1981 +9
==========================================
+ Hits 857 864 +7
- Misses 1115 1117 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hello, like I remarked in the issue that I opened today, I have no prior expirience with rust, I'm more familiar with nodejs, python and other languages, I do know how to write code. Therefore, with some help of the AI, I was able to locate the fix and propose a extreamly clumpsy suggestion. I hope to at least point the error and save you time! |
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.
Thanks for the PR!
This looks mostly good and makes sense :) Left a comment.
| // Get current branch name | ||
| use std::process::Command; | ||
| let output = Command::new("git") | ||
| .args(&["rev-parse", "--abbrev-ref", "HEAD"]) | ||
| .output(); | ||
|
|
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.
We should avoid running git and use git2 instead :)
This ensures that unreleased commits on feature/develop branches are properly matched with their corresponding pull requests.
Fixes issue where GitHub metadata (PR numbers, titles) was not populated for unreleased commits on non-default branches.
Also fixed .gitignore to ignore target/ insteand of /target
Description
When running git-cliff --unreleased without a specific range, it now uses
the current branch name for GitHub API calls instead of defaulting to the
repository's default branch.
Motivation and Context
Fixing of the following issue: #1274
How Has This Been Tested?
Tested against some repos in my company, where the error was discovered
Screenshots / Logs (if applicable)
Please everything is detailed in the issue linked to the PR
Types of Changes
Checklist: