Representation of conflicts in the commit graph #11564
Replies: 4 comments 4 replies
|
This all sounds in line with my understanding as well. In general, it would be neat if in the future it becomes possible to resolve conflicts without entering "edit mode". I imagine if we were to look into implementing this, a point of integration is going to be the part of the code which performs "cherry pick" within the new graph based Rebase Engine. @Caleb-T-Owens would it be possible to point out / link to the relevant parts of the code? |
|
The main cherry pick implementation can be found here: https://github.com/gitbutlerapp/gitbutler/blob/master/crates/but-rebase/src/graph_rebase/cherry_pick.rs#L44. For writing out either unconflicted we have the function When we go to expand the conflicts we probably will do something around there. There was also the case that we talked about a little bit where we fail to cherry-pick a merge commit but either the old or the new parents end up conflicting. This case you can see on line 66 of I was thinking that it doesn't really make sense to start changing the conflict representation while we have two different rebase engines, primarily while the old one relies on functions like For this reason I was wondering if it might make sense to paralleize working on rolling out & finalising test cases for the rebase engine, before we then change how conflicts are represented? WDYT @jonathantanmy2 @krlvi |
|
It's awesome to see this kicked off! Super high value, and a feature that needs to work extremely well to prevent great surprises. Some notes from me:
That's interesting, as I at least imagined that JJ would make these go away so the user has something to work with. But maybe that's not the case and instead it makes it obvious that a conflict is now committed, and I realise that I really have to catch up on JJ here to get some intuition of its prior art. I'd be glad to receive some education here. Storing metadata elsewhere should be easy with
This would require a new-style representation of conflicts to exist. When thinking about that, I remembered that conflicts from merges and cherry-picks typically have their own semantics, i.e. the method that the conflict was created with seems to matter. This seemed true when basing operations off one or more commits that are conflicted themselves.
I can't yet fathom how that would look like, maybe we can sketch that in greater detail? On
|
|
Sorry to step backwards here, but can someone write up the problem that we're trying to solve with a new approach to the conflicted commit format? My understanding is that it has to do with single-branch mode and having a conflicted commit at the tip, which can't be checked out in a good way. Is there another use case that becomes problematic with the current storage format? The thing that's somewhat nice about the un-checkout-able format is that it's very clear that it's a special style of commit. If we store the partially-resolved tree as the root tree and metadata elsewhere then it seems like it's much more likely that people may accidentally push a partially resolved tree containing conflict markers somewhere and not realize that it's in a poor state and how to fix it. If it's a bunch of subtrees in a totally different format with a README that explains why it looks this way, then it's incredibly clear that this commit should not have been pushed somewhere. I can go on, but it's possible that I'm missing some context. Before deciding on a new conflict format, can we write up what issues we're trying to solve with an evolution of the format? |
Uh oh!
There was an error while loading. Please reload this page.
AFAIK, currently:
git checkoutdirectly, but must instead use an "Edit" feature in the GUI (not sure if there's an equivalent in the CLI).As @Caleb-T-Owens , @krlvi , and I discussed, what we can do instead is:
gc.recentObjectsHook(added sometime in 2023, but OSes and distributions are sometimes late to pick up new versions of Git) to prevent these trees from being GCed. No extra commit headers are necessary, since the mapping is already stored elsewhere.git checkoutdirectly.git rebase -ior the still-in-progress techniques that Elijah Newren demoed in Git Merge 2025), without a separate step to tell GitButler that they are done resolving the conflict. When this happens, since the commit ID changes, the mapping (from commit IDs) mentioned above no longer applies. The commit is also "clean" in the sense that there are no extra irrelevant commit headers.An interesting point in the solution space, but that probably doesn't work:
After the meeting, I thought of a possible way to proceed:
All reactions