Browse Source

Replaces terminal checkout with switch git command

main
Eric Amodio 5 years ago
parent
commit
4584619063
3 changed files with 22 additions and 18 deletions
  1. +1
    -1
      CHANGELOG.md
  2. +19
    -15
      package.json
  3. +2
    -2
      src/views/viewCommands.ts

+ 1
- 1
CHANGELOG.md View File

@ -33,7 +33,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Changes all fetch commands to use the _fetch_ Git command
- Changes all pull commands to use the _pull_ Git command
- Changes all push commands to use the _push_ Git command
- Changes the _Checkout_ command on branches & tags to use the _switch_ Git command
- Changes the _Checkout_ command on branches, commits, and tags to use the _switch_ Git command
- Changes all the stash commands to use the new _stash_ Git command
- Changes Ansible files to use document scope for code lens — thanks to [PR #813](https://github.com/eamodio/vscode-gitlens/pull/813) by Ahmadali Shafiee ([@ahmadalli](https://github.com/ahmadalli))
- Renames _Checkout_ command to _Switch_ for branches and tags for better clarity and to align with the new Git 2.23 commands

+ 19
- 15
package.json View File

@ -2441,6 +2441,15 @@
}
},
{
"command": "gitlens.views.switchToCommit",
"title": "Switch to Commit",
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-checkout.svg",
"light": "images/light/icon-checkout.svg"
}
},
{
"command": "gitlens.views.switchToTag",
"title": "Switch to Tag",
"category": "GitLens",
@ -2776,11 +2785,6 @@
"category": "GitLens"
},
{
"command": "gitlens.views.terminalCheckoutCommit",
"title": "Checkout Commit (via Terminal)",
"category": "GitLens"
},
{
"command": "gitlens.views.terminalCherryPickCommit",
"title": "Cherry Pick Commit (via Terminal)",
"category": "GitLens"
@ -3460,6 +3464,10 @@
"when": "false"
},
{
"command": "gitlens.views.switchToCommit",
"when": "false"
},
{
"command": "gitlens.views.switchToTag",
"when": "false"
},
@ -3664,10 +3672,6 @@
"when": "false"
},
{
"command": "gitlens.views.terminalCheckoutCommit",
"when": "false"
},
{
"command": "gitlens.views.terminalCherryPickCommit",
"when": "false"
},
@ -4542,9 +4546,14 @@
"group": "inline@98"
},
{
"command": "gitlens.views.switchToCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b/",
"group": "1_gitlens@1"
},
{
"command": "gitlens.openCommitInRemote",
"when": "viewItem =~ /gitlens:commit\\b/ && gitlens:hasRemotes",
"group": "1_gitlens@1"
"group": "1_gitlens_1@1"
},
{
"command": "gitlens.views.openChangedFileChanges",
@ -4608,11 +4617,6 @@
"group": "8_gitlens@3"
},
{
"command": "gitlens.views.terminalCheckoutCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b/",
"group": "8_gitlens@4"
},
{
"command": "gitlens.views.terminalRebaseCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b/",
"group": "8_gitlens@5"

+ 2
- 2
src/views/viewCommands.ts View File

@ -128,6 +128,7 @@ export class ViewCommands {
commands.registerCommand('gitlens.views.applyChanges', this.applyChanges, this);
commands.registerCommand('gitlens.views.restore', this.restore, this);
commands.registerCommand('gitlens.views.switchToBranch', this.switch, this);
commands.registerCommand('gitlens.views.switchToCommit', this.switch, this);
commands.registerCommand('gitlens.views.switchToTag', this.switch, this);
commands.registerCommand('gitlens.views.addRemote', this.addRemote, this);
commands.registerCommand('gitlens.views.pruneRemote', this.pruneRemote, this);
@ -159,7 +160,6 @@ export class ViewCommands {
commands.registerCommand('gitlens.views.terminalCreateBranch', this.terminalCreateBranch, this);
commands.registerCommand('gitlens.views.terminalDeleteBranch', this.terminalDeleteBranch, this);
commands.registerCommand('gitlens.views.terminalCheckoutCommit', this.terminalCheckoutCommit, this);
commands.registerCommand('gitlens.views.terminalCherryPickCommit', this.terminalCherryPickCommit, this);
commands.registerCommand('gitlens.views.terminalPushCommit', this.terminalPushCommit, this);
commands.registerCommand('gitlens.views.terminalRebaseCommit', this.terminalRebaseCommit, this);
@ -314,7 +314,7 @@ export class ViewCommands {
} else {
args = {
command: 'switch',
state: { repos: [repo!], branchOrTagOrRef: { name: node.ref, ref: node.ref } }
state: { repos: [repo!], branchOrTagOrRef: { name: GitService.shortenSha(node.ref), ref: node.ref } }
};
}

Loading…
Cancel
Save