Skip to content

Small documentation change on rebase.rs#12579

Open
jonathantanmy2 wants to merge 1 commit intomasterfrom
jt/ourfix
Open

Small documentation change on rebase.rs#12579
jonathantanmy2 wants to merge 1 commit intomasterfrom
jt/ourfix

Conversation

@jonathantanmy2
Copy link
Collaborator

@jonathantanmy2 jonathantanmy2 commented Feb 25, 2026

Updated the PR to only contain a comment describing existing behavior.

Why I'm not autosubmitting: @Caleb-T-Owens could you take a look? These look reasonable to me but I just wanted a second opinion, especially 'rebase: "our" is target, "their" is incoming '. The rationale for both changes are in their respective commit messages.

There are some test differences that I don't quite understand, but note how in conflicting_merge, the results now match the comments.

@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Ignored Ignored Preview Feb 25, 2026 6:51pm

Request Review

@github-actions github-actions bot added the rust Pull requests that update Rust code label Feb 25, 2026
Copy link
Contributor

@Caleb-T-Owens Caleb-T-Owens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!

There are semantics around how we cherry-pick conflicted commits that expect the "theirs" tree to represent the user's content. If we wanted to swap tree usage, we would need to update all the locations where we write conflicted commits and all the places where we cherry-pick conflicted commits, along with some form of backward compatibility.

For now, I'd suggest updating the comments and leaving the tree writing as is.

@jonathantanmy2
Copy link
Collaborator Author

There are semantics around how we cherry-pick conflicted commits that expect the "theirs" tree to represent the user's content.

Ah thanks. Do you know offhand where in the code this is enforced? I tried looking and the closest I got was in crates/but-rebase/src/cherry_pick.rs commit_from_conflicted_tree() but there doesn't seem to be anything there that states that "theirs" is the user's content.

The function has some potentially unexpected behavior which would be too
costly to change, so just document it. (If we have a way to represent
conflicted commits agreed upon by GitButler and other projects, we could
change the behavior here, since we would already have to pay the cost of
migration, but that time is not yet.)
@jonathantanmy2
Copy link
Collaborator Author

For now, I'd suggest updating the comments and leaving the tree writing as is.

I took a further look and it seems that the parent IDs are written in the form I would expect, but the trees are swapped. Like you said, I don't think we can swap the trees to the order I would expect (swapping the parents to match the trees is out of the question, I believe). I've updated the PR to only document the existing behavior.

@jonathantanmy2 jonathantanmy2 changed the title gitbutler-branch-actions small fixes Small documentation change on rebase.rs Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants