Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'dahlbyk'

  • Loading branch information...
commit 37471e721fb9a156bfb4d662e3fd5d3a839df9d8 2 parents 337aa13 + 16b10f0
@eamodio authored
Showing with 11 additions and 22 deletions.
  1. +8 −22 GitTabExpansion.ps1
  2. +3 −0  GitUtils.ps1
View
30 GitTabExpansion.ps1
@@ -13,6 +13,7 @@ $subcommands = @{
stash = 'list show drop pop apply branch save clear create'
submodule = 'add status init update summary foreach sync'
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) {
@@ -120,10 +121,7 @@ function GitTabExpansion($lastBlock) {
switch -regex ($lastBlock -replace "^$(Get-AliasPattern git) ","") {
- # Handles git reflog <op>
- # Handles git remote <op>
- # Handles git stash <op>
- # Handles git svn <op>
+ # Handles git <cmd> <op>
"^(?<cmd>$($subcommands.Keys -join '|'))\s+(?<op>\S*)$" {
gitCmdOperations $matches['cmd'] $matches['op']
}
@@ -178,18 +176,14 @@ function GitTabExpansion($lastBlock) {
gitIndex $matches['path']
}
- # Handles git cherry-pick <commit>
- # Handles git diff <commit>
- # Handles git difftool <commit>
- # Handles git log <commit>
- # Handles git show <commit>
- "^(?:cherry-pick|diff|difftool|log|show).* (?<commit>\S*)$" {
- gitBranches $matches['commit'] $true
+ # Handles git <cmd> <ref>
+ "^(?:checkout|cherry-pick|diff|difftool|log|merge|rebase|reflog\s+show|reset|revert|show).* (?<ref>\S*)$" {
+ gitBranches $matches['ref'] $true
}
- # Handles git reset <commit>
- "^reset.* (?<commit>\S*)$" {
- gitBranches $matches['commit'] $true
+ # Handles git <cmd> <ref>
+ "^commit.*-C\s+(?<ref>\S*)$" {
+ gitBranches $matches['ref'] $true
}
# Handles git add <path>
@@ -206,14 +200,6 @@ function GitTabExpansion($lastBlock) {
"^rm.* (?<index>\S*)$" {
gitDeleted $matches['index']
}
-
- # Handles git checkout <branch name>
- # Handles git merge <branch name>
- # handles git rebase <branch name>
- # Handles git reflog show <branch name>
- "^(?:checkout|merge|rebase|reflog\s+show).*\s(?<branch>\S*)$" {
- gitBranches $matches['branch'] $true
- }
}
}
View
3  GitUtils.ps1
@@ -37,6 +37,9 @@ function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.Stopwatch]$sw
} elseif (Test-Path $gitDir\MERGE_HEAD) {
dbg 'Found MERGE_HEAD' $sw
$r = '|MERGING'
+ } elseif (Test-Path $gitDir\CHERRY_PICK_HEAD) {
+ dbg 'Found CHERRY_PICK_HEAD' $sw
+ $r = '|CHERRY-PICKING'
} elseif (Test-Path $gitDir\BISECT_LOG) {
dbg 'Found BISECT_LOG' $sw
$r = '|BISECTING'
Please sign in to comment.
Something went wrong with that request. Please try again.