Git - move compare with merge base action into the context menu#273981
Merged
Git - move compare with merge base action into the context menu#273981
Conversation
Contributor
There was a problem hiding this comment.
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
SCMCurrentHistoryItemRefHasBasecontext 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/titletoscm/historyItem/contextwith 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 |
amunger
approved these changes
Oct 29, 2025
dmitrivMS
pushed a commit
that referenced
this pull request
Oct 29, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.