Skip to content

fix(but-workspace): stop diverged branches from replaying their own history - #16295

Draft
PavelLaptev wants to merge 2 commits into
masterfrom
fix-diverged-branch-integration
Draft

PavelLaptev wants to merge 2 commits into
masterfrom
fix-diverged-branch-integration

Conversation

@PavelLaptev

Copy link
Copy Markdown
Contributor

Two user reports: after a workspace update, a branch whose PR was updated on GitHub shows the yellow "Update local branch" button, and the recommended Pull rebase then doubles the branch's history and conflicts on files nobody else touched.

  • A remote tip that is a merge with the local tip's tree (GitHub's "Update branch") no longer counts as remote work, so only a force-push is left.
  • Pull rebase skips remote commits that a local commit is a newer version of (same change-id, or same author and message), matching what the status view already assumes.
  • @estib-vega: this reverses keeps_graph_truth_even_when_change_ids_match, now pull_rebase_skips_remote_commits_paired_with_local_ones. If a collaborator amends a remote commit but keeps its change-id, the local version wins.

…ote work

When the forge merged the target into a pushed branch while the branch was
rebased locally onto that same target, the merge stayed as the one remote
commit the local branch lacks. The desktop app then showed its yellow
"Update local branch" button, though both tips held the same tree and a
force-push was all that was left.

A remote tip that is a merge with the local tip's tree now leaves nothing
on the remote. Merges only, so an empty remote commit, like one to retrigger
CI, still shows as something a force-push would drop.
After the branch was rebased locally, its remote still holds the old copies
of the same commits. Pull rebase replayed those copies first and the local
commits on top, so every change was applied twice: mostly empty commits, and
add/add conflicts where one commit adds a file a later one changes.

Pull rebase, and Smart squash when it falls back to it, now skip remote
commits a local commit is a newer version of, paired by change-id or by
author and message as the workspace status already does. Merge and Pick
remote keep every remote commit.
@github-actions github-actions Bot added the rust Pull requests that update Rust code label Oct 11, 2026

This branch has not been deployed

No deployments
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.

1 participant