-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Feat: Add context menu command to reset current branch to tag #3769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well! Just very minor nitpicks and one suggestion about adding a condition to a when
clause - otherwise, LGTM
package.json
Outdated
{ | ||
"command": "gitlens.graph.resetToTag", | ||
"title": "Reset Current Branch to Tag...", | ||
"category": "GitLens", | ||
"icon": "$(gitlens-reset)", | ||
"enablement": "!operationInProgress" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor nitpick: I know our package JSON is basically the "wild west" right now, and ordering is scrambled for the most part, but just to help the situation a touch, can we put this next to where the other gitlens.graph.reset...
commands are?
"command": "gitlens.graph.switchToTag", | ||
"when": "false" | ||
}, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
package.json
Outdated
{ | ||
"command": "gitlens.graph.resetToTag", | ||
"when": "!gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webviewItem =~ /gitlens:tag\\b/", | ||
"group": "1_gitlens_actions@2" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may also want to add !listMultiSelection
to the "when" clause here to make sure we're not in a multi-selection context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR introduces a new option in the Commit Graph context menu for resetting the current branch to a tag.

Solves #2373
Checklist
Fixes $XXX -
orCloses #XXX -
prefix to auto-close the issue that your PR addresses