Browse Source

Adds terminalRemoveRemote command

main
Eric Amodio 7 years ago
parent
commit
1d1de14741
4 changed files with 27 additions and 4 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -1
      README.md
  3. +16
    -2
      package.json
  4. +9
    -1
      src/views/explorerCommands.ts

+ 1
- 0
CHANGELOG.md View File

@ -35,6 +35,7 @@ ATTENTION! To support multi-root workspaces some underlying fundamentals had to
- Adds `Squash Branch into Commit (via Terminal)` command (`gitlens.terminalSquashBranchIntoCommit`) to branch node(s) of the `GitLens` custom view
- Adds `Rebase Commit (via Terminal)` command (`gitlens.terminalRebaseCommit`) to commit node(s) of the `GitLens` custom view
- Adds `Reset Commit (via Terminal)` command (`gitlens.terminalResetCommit`) to commit node(s) of the `GitLens` custom view
- Adds `Remove Remote (via Terminal)` command (`gitlens.terminalRemoveRemote`) to remote node(s) of the `GitLens` custom view
- Adds ability to specify the url protocol used with user-defined remote services via `gitlens.remotes` setting -- thanks to [PR #192](https://github.com/eamodio/vscode-gitlens/pull/192) by Helmut Januschka ([@hjanuschka](https://github.com/hjanuschka))!
### Changed

+ 1
- 1
README.md View File

@ -180,7 +180,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Provides a context menu on each revision (commit) with `Open Commit in Remote`, `Open All Changes`, `Open All Changes with Working Tree`, `Open Files`, `Open Revisions`, `Copy Commit ID to Clipboard`, `Copy Commit Message to Clipboard`,`Show Commit Details`, and `Refresh` commands
- Provides a context menu on each changed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, `Apply Changes`, `Show File History`, and `Show Commit File Details` commands
- Provides a context menu on each remote branch with `Open Branch in Remote`, `Checkout Branch (via Terminal)`, `Create Branch (via Terminal)...`, `Delete Branch (via Terminal)`, `Squash Branch into Commit (via Terminal)`, and `Refresh` commands
- Provides a context menu on each remote with `Open Branches in Remote`, `Open Repository in Remote`, and `Refresh` commands
- Provides a context menu on each remote with `Open Branches in Remote`, `Open Repository in Remote`, `Remove Remote (via Terminal)`, and `Refresh` commands
- Provides a context menu with a `Refresh` command
- `Stashes` node — provides a list of stashed changes

+ 16
- 2
package.json View File

@ -1359,6 +1359,11 @@
"command": "gitlens.gitExplorer.terminalResetCommit",
"title": "Reset Commit (via Terminal)",
"category": "GitLens"
},
{
"command": "gitlens.gitExplorer.terminalRemoveRemote",
"title": "Remove Remote (via Terminal)",
"category": "GitLens"
}
],
"menus": {
@ -1618,6 +1623,10 @@
{
"command": "gitlens.gitExplorer.terminalResetCommit",
"when": "false"
},
{
"command": "gitlens.gitExplorer.terminalRemoveRemote",
"when": "false"
}
],
"editor/context": [
@ -2123,15 +2132,20 @@
},
{
"command": "gitlens.openBranchesInRemote",
"when": "gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:remote",
"when": "view == gitlens.gitExplorer && viewItem == gitlens:remote",
"group": "1_gitlens@1"
},
{
"command": "gitlens.openRepoInRemote",
"when": "gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:remote",
"when": "view == gitlens.gitExplorer && viewItem == gitlens:remote",
"group": "1_gitlens@2"
},
{
"command": "gitlens.gitExplorer.terminalRemoveRemote",
"when": "view == gitlens.gitExplorer && viewItem == gitlens:remote",
"group": "8_gitlens@1"
},
{
"command": "gitlens.openRepoInRemote",
"when": "gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:repository",
"group": "1_gitlens@1"

+ 9
- 1
src/views/explorerCommands.ts View File

@ -3,7 +3,7 @@ import { commands, Disposable, InputBoxOptions, Terminal, TextDocumentShowOption
import { ExtensionKey, ExtensionTerminalName } from '../constants';
import { BranchHistoryNode, ExplorerNode, GitExplorer, GitExplorerView } from '../views/gitExplorer';
import { configuration, GitExplorerFilesLayout } from '../configuration';
import { CommitFileNode, CommitNode, StashNode, StatusUpstreamNode } from './explorerNodes';
import { CommitFileNode, CommitNode, RemoteNode, StashNode, StatusUpstreamNode } from './explorerNodes';
import { Commands, DiffWithCommandArgs, DiffWithCommandArgsRevision, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs, openEditor, OpenFileInRemoteCommandArgs, OpenFileRevisionCommandArgs } from '../commands';
import { GitService, GitUri } from '../gitService';
@ -43,6 +43,7 @@ export class ExplorerCommands extends Disposable {
commands.registerCommand('gitlens.gitExplorer.terminalSquashBranchIntoCommit', this.terminalSquashBranchIntoCommit, this);
commands.registerCommand('gitlens.gitExplorer.terminalRebaseCommit', this.terminalRebaseCommit, this);
commands.registerCommand('gitlens.gitExplorer.terminalResetCommit', this.terminalResetCommit, this);
commands.registerCommand('gitlens.gitExplorer.terminalRemoveRemote', this.terminalRemoveRemote, this);
}
dispose() {
@ -206,6 +207,13 @@ export class ExplorerCommands extends Disposable {
this.sendTerminalCommand(command);
}
terminalRemoveRemote(node: ExplorerNode) {
if (!(node instanceof RemoteNode)) return;
const command = `remote remove ${node.remote.name}`;
this.sendTerminalCommand(command);
}
private ensureTerminal(): Terminal {
if (this._terminal === undefined) {
this._terminal = window.createTerminal(ExtensionTerminalName);

Loading…
Cancel
Save