Skip to content

Git - move compare with merge base action into the context menu#273981

Merged
lszomoru merged 1 commit intomainfrom
lszomoru/unsightly-zebra
Oct 29, 2025
Merged

Git - move compare with merge base action into the context menu#273981
lszomoru merged 1 commit intomainfrom
lszomoru/unsightly-zebra

Conversation

@lszomoru
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings October 29, 2025 15:51
@lszomoru lszomoru enabled auto-merge (squash) October 29, 2025 15:51
@lszomoru lszomoru self-assigned this Oct 29, 2025
@lszomoru lszomoru added the scm General SCM compound issues label Oct 29, 2025
@lszomoru lszomoru added this to the October 2025 milestone Oct 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the Git extension's merge base context key from a Git-specific implementation (git.currentHistoryItemHasMergeBase) to the SCM framework's generic implementation (scmCurrentHistoryItemRefHasBase). The changes align the merge base functionality with the existing pattern used for remote refs (scmCurrentHistoryItemRefHasRemote).

Key changes:

  • Adds SCMCurrentHistoryItemRefHasBase context key to the SCM framework
  • Updates the Git extension's command enablement to use the new framework context key
  • Moves the "Compare with Merge Base" menu item from scm/history/title to scm/historyItem/context with a condition that checks if the history item has the current ref
  • Removes the Git-specific context key setter in favor of framework-level management

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/vs/workbench/contrib/scm/browser/scmViewPane.ts Adds SCMCurrentHistoryItemRefHasBase context key definition to the SCM framework's context keys
src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.ts Binds the new context key and sets it based on the history provider's base ref; adds dynamic context key for menu filtering
extensions/git/src/historyProvider.ts Removes Git-specific context key setter that is now handled by the framework
extensions/git/package.json Updates command enablement to use framework context key and repositions menu item with refined condition

@lszomoru lszomoru merged commit f8e2f71 into main Oct 29, 2025
32 of 33 checks passed
@lszomoru lszomoru deleted the lszomoru/unsightly-zebra branch October 29, 2025 16:14
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

scm General SCM compound issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants