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

Project has a 'main' virtual branch that does not exist #4942

Open
eproxus opened this issue Sep 18, 2024 · 6 comments
Open

Project has a 'main' virtual branch that does not exist #4942

eproxus opened this issue Sep 18, 2024 · 6 comments
Labels
bug Something isn't working feedback requested Feedback was requested to help resolve the issue

Comments

@eproxus
Copy link

eproxus commented Sep 18, 2024

Version

0.12.25 (20240912.103915)

Operating System

Mac OS X

Distribution Method

dmg (Apple Silicon)

Describe the issue

I have a project that has a local virtual branch called main and when I click on it I just get an error popup saying "Failed to find branch". I also have another private branch with a different name that behaves just the same.

How to reproduce

No idea. If I remove the GitButler project and remove the gitbutler/target and gitbutler/workspace branches manually and then add it back, I still have these broken virtual branches in GitButler.

Expected behavior

They either shouldn't show up at all or it should be possible to delete them somehow.

Relevant log output

No response

@eproxus eproxus added the bug Something isn't working label Sep 18, 2024
@Byron
Copy link
Collaborator

Byron commented Sep 18, 2024

Thanks a lot for reporting!

I would expect that the issue goes away if the .git/gitbutler/virtual_branches.toml gets deleted, or renamed, as it's the source of truth for which virtual branches exist.

Also, I am aware that GitButler can create its own virtual branches - in the moment there is a single change in the worktree it auto-creates a virtual branch to capture it. However, typically these actually exist afterwards.

Maybe you could try to remove or rename the aforementioned file and see if it fixes the problem. It would be my guess that it's fixed initially and then re-occours. And when that happens, maybe we find a way to reproduce it here as well.

Thanks a lot for your help.

@Byron Byron added the feedback requested Feedback was requested to help resolve the issue label Sep 18, 2024
@eproxus
Copy link
Author

eproxus commented Sep 19, 2024

Deleting .git/gitbutler/virtual_branches.toml got rid of the "virtual main" branch, but not the other branch.

@eproxus
Copy link
Author

eproxus commented Sep 19, 2024

The other branch turned out to be a real branch in my repo that GitButler couldn't apply for some reason (the error was the same, "Failed to find branch"). Once I deleted that in the Git repo itself, it also disappeared from the GitButler UI.

@eproxus
Copy link
Author

eproxus commented Sep 19, 2024

Now I'm in another weird state (I have no virtual branches) where clicking Update in the workspace generates the error "Failed to update workspace: Projects has active conflicts" even though there are no changes whatsoever...

@eproxus
Copy link
Author

eproxus commented Sep 19, 2024

Deleting .git/gitbutler/** and deleting the gitbutler/target and gitbutler/workspace and restarting GitButler creates the "virtual main" branch again in the project and the update still doesn't work, showing the above error.

@eproxus
Copy link
Author

eproxus commented Sep 19, 2024

I think I found the culprit. There seems to be a GitButler WIP Commit on my main branch (!). This is something that should never happen, I think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback requested Feedback was requested to help resolve the issue
Projects
None yet
Development

No branches or pull requests

2 participants