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

Merge and rebase duplicates commit history and prevents subsequent pull requests #5501

Open
leokeba opened this issue Nov 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@leokeba
Copy link

leokeba commented Nov 8, 2024

Version

0.13.13

Operating System

macOS

Distribution Method

dmg (Apple Silicon)

Describe the issue

When merging a branch using the "Merge and rebase" method, updating the workspace in GitButler doesn't work as expected. Instead of matching the remote commits with the local ones, they appear on top of the local workspace as though they were different commits. I suspect this happens because github re-hashes every commit when doing the rebase.

If I commit again on the same branch (after updating my workspace) and try to make a PR, this creates all sorts of issues. Sometimes I get merge conflicts on github (but GB doesn't see them), and if I can merge the PR and update my workspace again, the following PR stays "on top" of the commit history (meaning every new commit lands "under" it instead of on top) and prevents me from creating subsequent ones.

All of this does not happen if I discard the merged branch and create a new one. However, if I want to keep the same name (like "dev"), I have to manually delete both local and remote branches before recreating it. This is quite annoying and very error-prone.

How to reproduce

  • Create a dev branch, make a commit, make a PR and merge it into your target using "Merge and rebase".
  • Update Workspace
    => This leads us to "stage one" where the commits that were just merged still appear on the dev branch on top of the target
  • Make a new commit, make a PR and merge it into the target once again (if not blocked by file conflicts)
    => This is stage two, where the PR stays on top of the dev branch, every new commit lands under it, and it's not possible to make a new PR.

Expected behavior

GitButler should match the local commits with the ones upstream and deduplicate them somehow. Basically this should work the same as when doing a regular merge, i.e. just having to update the local workspace and being able to start working again on the same branch immediately without experiencing these issues.

Relevant log output

No response

@leokeba leokeba added the bug Something isn't working label Nov 8, 2024
@Byron
Copy link
Collaborator

Byron commented Nov 8, 2024

Thanks a lot for reporting!

I admit that this is way over my head right now, but maybe @Caleb-T-Owens could help out much more easily here. Thanks everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants