Skip to content

GitButler thinks branch is not incorperated upstream. #8457

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

Open
Icantjuddle opened this issue May 8, 2025 · 5 comments
Open

GitButler thinks branch is not incorperated upstream. #8457

Icantjuddle opened this issue May 8, 2025 · 5 comments
Assignees
Labels
bug Something isn't working V3 The ominous upcoming major release should address this issue, eventually

Comments

@Icantjuddle
Copy link

Version

Version 0.14.19 (20250428.160452)

Operating System

macOS

Distribution Method

dmg (Mac OS - Apple Silicon)

Describe the issue

After merging a PR made with gitbutler using the squash and merge strategy on github, my local gitbutler client will not remove my local branch and rather thinks it is conflicted.

Image

How to reproduce (Optional)

  1. create a PR with with gb
  2. Merge with squash and merge and delete the branch on github
  3. Update workspace on local gitbutler

Expected behavior (Optional)

It recognizes that the branch is incorporated upstream and offers to delete the local branch.

Relevant log output (Optional)

@Icantjuddle Icantjuddle added the bug Something isn't working label May 8, 2025
@Byron Byron added the V3 The ominous upcoming major release should address this issue, eventually label May 9, 2025
@Byron
Copy link
Collaborator

Byron commented May 9, 2025

Thanks a lot for reporting!
It seems that the failure to detect that the branch is already integrated allowed to perform a rebase which then had to cause a conflict.
I hope we can tackle this in the next major release.

@Icantjuddle
Copy link
Author

Is there a better way to work around this thank to manually fixup the .git/gitbutler/virtual_branches.toml to make it forget about it?

UI operations seem to end up in some loop of conflicted states that cannot be resolved?

@Byron
Copy link
Collaborator

Byron commented May 12, 2025

Altering the configuration file directly might be possible - there are flags for whether something is integrated or not. Maybe @krlvi can advise?

@krlvi
Copy link
Member

krlvi commented May 12, 2025

I have an idea for approaching this.

The root cause here is that whenever there is a squash commit, it is difficult to recognize that the branch that is still in the workspace is indeed integrated - the commits will be different, and the commit message of the squash commit is not reliable either.

The app also looks at the content - i.e. "does the incoming version contain the exact code that is in the branch". But if there were follow up changes, e.g. the branch was squash merged but then the code was modified by another merged PR it can no longer detect it.

--

So I am thinking about implementing a "treat as integrated" override option for the workspace update operation. This override can be triggered by the UI, based on the Pull Request status.

This solution is a little bit cheating because it would not work universally, especially if a person does not have a forge integration enabled. But maybe helping some of the cases is better than helping none

@Byron
Copy link
Collaborator

Byron commented May 13, 2025

I like this approach, i.e. also to use other signals to determine if something is merged. This was also my feeling when integrating the data types as the frontend uses them with the data that is actually present, and a couple of states aren't currently handled that may relate to whether or not something is integrated.

Over time, we should be able to chip away at this problem, one test at a time.

@krlvi krlvi self-assigned this May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working V3 The ominous upcoming major release should address this issue, eventually
Projects
None yet
Development

No branches or pull requests

3 participants