Name the branch a merge is made into - #15195
Open
ameyypawar wants to merge 1 commit into
Open
Conversation
Updating the workspace with the merge strategy wrote "Merge <target> into merge", with the word merge taken literally rather than the branch. The name was already at hand: a managed workspace's head is the lane's own reference, and a direct checkout has the checked-out branch. Only a head that nothing names now falls back to stating what was merged. Reported as landing in 0.14.3 and returning with the current integration path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧠 Changes
The merge commit written when updating the workspace with the merge strategy now names the branch it is merged into. A managed workspace's head is the lane's own reference; a direct checkout has the checked-out branch, which is preferred over any other reference sitting on the same commit. A head that nothing names states only what was merged, rather than inventing a name.
☕️ Reasoning
The message was
format!("Merge {} into merge", ...), withmergea literal rather than the branch. Four committed snapshots inupstream_integration.rscarried it, including(HEAD -> A) Merge refs/remotes/origin/main into merge, where the branch is plainlyAon the same line. Those snapshots are the regression test: they now readinto Eandinto A, and the only shas that move are the merge commit and its sole descendant.Preferring the checked-out branch matters for a direct checkout, where the head is a commit rather than a reference. Walking to the nearest reference finds every branch on that commit, and
step_references()makes no ordering promise, so a second branch sitting on the tip could just as well have been named.Two notes on what this does not do:
origin/mainwould read closer togit merge, but that is a separate decision about the whole message.plan.rs'sMerge {commit_id} into previous commitis the same kind of placeholder on the per-branch integration path, and is left alone here.One case has no test: a direct checkout with a second branch on the head commit, where the checked-out branch has to win. These tests build their graph from explicit tips, so an extra reference never reaches the code under test. I wrote that test, found it passed against the old behaviour too, and removed it rather than leave an assertion that proves nothing.
🎫 Affected issues
Fixes: #5748