-
Notifications
You must be signed in to change notification settings - Fork 510
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
Virtual branch should be removed if there are no changes #5114
Comments
Thanks a lot for reporting! It seems the issue here is that GitButler doesn't detect if the commits in a virtual-branch were already integrated. Thus, it would allow the creation of a 'new' PR which doesn't actually contain line-changes that aren't merged into the target branch yet. When looking at the commits in the PR and trying to find them in |
Oh, this is an easy one: We do squashing to have a smaller commit history. 😅 |
That's interesting! Even though the algorithm to figure out if a local branch is merged or not is quite elaborate, I'd be a little bit surprised if it could detect that it would be able to detect this on hunk level. In a way, it would have to make a test-merge and only if it comes out without any changes, we'd know the hunks are already present in the target branch. It's the question, if I am not missing something, if one should go that far, after all the two histories would be unrelated after the squashing. |
The alternative is to be aware of GitHub's commit messages for Suqash-merged-PRs: The pattern is to reference the PR number in braces at the end of the commit message. Since GitButler knows the PR number for a virtual branch, it could just check if As a double check, it could see if the changes of the virtual branch matches those of the commit. Self-advertisting: I do that kind of parsing in my GitHub Contributors List tool, where I build a table of all contributors based on the commits of PRs linked by that number. |
Version
0.13.0
Operating System
Windows
Distribution Method
msi (Windows)
Describe the issue
When a PR was merged upstream, the virtual branch was not removed while syncing:
I re-created the PR at JabRef/jabref#11919
See: 0 files changed!
I think, gitbutler should remove virtual branches with 0 changes.
How to reproduce
(I am guessing, reproducing is hard. If you need a "strong" reproducer, I can try to create an MWE repository)
main
Expected behavior
Branch with 0 changes gone.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: