-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
Adds aliasing support for TortoiseGit commands #394
Conversation
Also allows configuration of TortoiseGit commands
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.
Just cosmetic fixes. Thanks for the contribution!
src/GitTabExpansion.ps1
Outdated
@@ -194,7 +194,7 @@ function GitTabExpansionInternal($lastBlock) { | |||
# Handles tgit <command> (tortoisegit) | |||
if ($lastBlock -match "^$(Get-AliasPattern tgit) (?<cmd>\S*)$") { | |||
# Need return statement to prevent fall-through. | |||
return $tortoiseGitCommands | Where-Object { $_ -like "$($matches['cmd'])*" } | |||
return $Global:TortoiseGitSettings.TortoiseGitCommands.Keys.GetEnumerator() | sort | Where-Object { $_ -like "$($matches['cmd'])*" } |
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.
s/sort/Sort-Object/
(also in TortoiseGit.ps1)
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.
Good catch. PowerShell Core running on Linux or macOS does not have the sort alias defined for Sort-Object. So calling sort would execute the native sort utility.
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.
Fixed.
src/TortoiseGit.ps1
Outdated
"subupdate" = "subupdate"; | ||
"switch" = "switch"; | ||
"checkout" = "switch"; | ||
"sync" = "sync"; |
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.
Would it make sense to alias fetch
to sync
?
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.
Added.
src/TortoiseGit.ps1
Outdated
"sync", | ||
"repostatus" | ||
) | sort | ||
} |
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.
EOL @ EOF, please!
(Tip: we have a .editorconfig that will enforce this for supported editors.)
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.
Fixed :)
Changes % -> ForEach-Object Adds fetch alias for sync
💯 👏 🎉 |
Also allows configuration of TortoiseGit commands