Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Basic support for expanding 'git tfs <tab>' and 'git tfs unshelve <tab>'

  • Loading branch information...
commit 28f4adfadcbbe6bc8c9ecb9ed27400427e9bc171 1 parent 83dfee0
@dahlbyk authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 GitTabExpansion.ps1
View
15 GitTabExpansion.ps1
@@ -10,6 +10,7 @@ $global:ops = @{
remote = 'add','rename','rm','set-head','show','prune','update'
stash = 'list','show','drop','pop','apply','branch','save','clear','create'
svn = 'init', 'fetch', 'clone', 'rebase', 'dcommit', 'branch', 'tag', 'log', 'blame', 'find-rev', 'set-tree', 'create-ignore', 'show-ignore', 'mkdirs', 'commit-diff', 'info', 'proplist', 'propget', 'show-externals', 'gc', 'reset'
+ tfs = 'bootstrap','checkin','checkintool','ct','cleanup','cleanup-workspaces','clone','diagnostics','fetch','help','init','pull','quick-clone','rcheckin','shelve','shelve-list','unshelve','verify'
}
function script:gitCmdOperations($command, $filter) {
@@ -60,6 +61,12 @@ function script:gitStashes($filter) {
foreach { "'$_'" }
}
+function script:gitTfsShelvesets($filter) {
+ (git tfs shelve-list) |
+ where { $_ -like "$filter*" } |
+ foreach { "'$_'" }
+}
+
function script:gitIndex($filter) {
if($GitStatus) {
$GitStatus.Index |
@@ -121,7 +128,8 @@ function GitTabExpansion($lastBlock) {
# Handles git remote <op>
# Handles git stash <op>
# Handles git svn <op>
- "^(?<cmd>reflog|remote|stash|svn)\s+(?<op>\S*)$" {
+ # Handles git tfs <op>
+ "^(?<cmd>reflog|remote|stash|svn|tfs)\s+(?<op>\S*)$" {
gitCmdOperations $matches['cmd'] $matches['op']
}
@@ -135,6 +143,11 @@ function GitTabExpansion($lastBlock) {
gitStashes $matches['stash']
}
+ # Handles git tfs unshelve <shelveset>
+ "^tfs +unshelve.* (?<shelveset>\S*)$" {
+ gitTfsShelvesets $matches['shelveset']
+ }
+
# Handles git branch -d|-D|-m|-M <branch name>
# Handles git branch <branch name> <start-point>
"^branch.* (?<branch>\S*)$" {
Please sign in to comment.
Something went wrong with that request. Please try again.