Open StartAutomating opened 2 years ago
Since posh-git is already very useful, but doesn't return git naturally as objects, it makes sense for both modules to work together in concert.
Agree! I'll ship a new version as soon as I can get a few lingering PRs merged.
Cool!
It occurs to me that you might rely on git output being text in other places. So while this might have gotten rid of the most obvious breaking change, it's possible there are others.
It would be fairly trivial for you to save $executionContext.SessionState.InvokeCommand('git','Application')
into a variable, and call that explicitly in your scripts (it's the trick ugit is doing under the hood).
Doing this should prevent any future hijinks.
It would be fairly trivial for you to save
$executionContext.SessionState.InvokeCommand('git','Application')
into a variable
I assume you mean InvokeCommand.GetCommand('git', 'Application')
. Would this be more efficient than Get-Command git -CommandType Application
?
Sorry for the delay in response (and the typo).
Yes, $executionContext is faster than Get-Command. I'll add a Benchmark on this to Benchpress.
On my box, here's what the results were:
Technique | Time | RelativeSpeed | Throughput |
---|---|---|---|
$executionContext | 00:00:00.198679 | 1x | 503.32/s |
Get-Command | 00:00:00.266019 | 1.34x | 375.91/s |
It's so cool to see two awesome projects collaborating together! :smile: I'm looking forward to when this fix will be released as it is affecting me as well right now.
System Details
Issue Description
posh-git has a compatibility issue with ugit.
This is because ugit overrides git with a PowerShell command.
While this does support any number of arguments, PowerShell can get confused when dealing with short argument names.
Thus line 331 in Get-GitStatus blows up the prompt.
The solution for this works just fine if ugit is loaded or not.
Quote the single character arguments:
Since posh-git is already very useful, but doesn't return git naturally as objects, it makes sense for both modules to work together in concert.