-
Notifications
You must be signed in to change notification settings - Fork 4
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
gh changelog new gets confused if there are multiple branches #145
Comments
Hey @joshcooper ! It's been a while. Hope you are well. It looks like I missed something when I originally built the extension.. I mainly used the module repos as test cases and they only tag on main. Life/Work has been a bit crazy this month so haven't had much mental capacity to dedicate to my open source stuff. However I'll free some time to look at this and #144 this week. I'll do what I can to get you folks up and running. 🙂 |
👋 Your test using The extension only looks at tags for the repo and not the specific commits associated with a branch, so pretty sure this is why you are seeing the strange results. I used your examples as test cases.. Example 1 on
|
Hey @joshcooper So I've been playing around with this quite a bit. As i mentioned above, i'm now using merge-base to determine if a tag is an ancestor of the current branch. Also, i've added a So for example, on puppets main branch:
Gives me what looks like a reasonable output of tags for puppet 8.
Does this align with behaviour you expected? |
I think the problem is simply a limitation of the GH tag rest api. Doesn't seem to allow you to restrict the returned tags to just those associated to a specific branch. Would it be worth re-working the gitclient/go GetTags function to search the local repo? This works a treat for annotated tags: git for-each-ref refs/tags --sort='-taggerdate' --format='%(refname:short)' --merged=HEAD Or this for all tags: git for-each-ref refs/tags --sort='-*creatordate' --format='%(refname:short)' --merged=HEAD |
I also think the |
Hi @chelnak, the
gh changelog new
command seems to get confused if there multiple active branches and tags.For example, https://github.com/puppetlabs/facter only has one active branch (
main
), so this works:But puppet has two active branches. If I'm on
main
, then this doesn't work:And neither does checking out the
7.x
branch:If I remove
--next-version
, then it generates the changelog, but interleaves the tags from different branches:Note the last line going from
8.5.1...7.30.0
. For example, git knows 8.5.1 is not an ancestor of 7.x, but is of main:I was hoping
gh changelog new
would only report on pull requests whose merge commits are contained within the specified--from-version
to--next-version
range.I don't believe this is a dup of #144 (but maybe related)?
The text was updated successfully, but these errors were encountered: