-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
importing ugit module breaks git prompt #260
Comments
@aldrichtr this is actually posh-git's problem, and they are fixing it (as I understand it, the fix is already in master, but there is not yet a release). If you want to understand more about why, let me know. |
I may have it wrong, but I think posh-git gets it's status from the output of the git status command. When uGit is loaded, this command is remapped to On my system I get: [26704]…\projects\testproject [main +1 ~0 -0 | +5 ~0 -0 !]
PS> get-command git
CommandType Name Version Source
----------- ---- ------- ------
Application git.exe 2.44.0.1 C:\Program Files\Git\cmd\git.exe
[26704]…\projects\testproject [main +1 ~0 -0 | +5 ~0 -0 !]
PS> Import-Module ugit
[26704]…\projects\testproject
PS> get-command git
CommandType Name Version Source
----------- ---- ------- ------
Alias git -> Use-Git 0.4.2 ugit I'm thinking that any module / function that uses the output of git will have the same issue, right? |
@aldrichtr that's right. Each tool that wants to use both should reference the git application directly (not just any command named git). They could also choose to simply require ugit and depend on its output (which contains the original text beneath, if they still need to parse it directly) The alternative would be callstack peeking and blacklisting certain commands in the callstack, which creates a game of whack-a-mole in ugit's codebase, instead of a simple fix in any other codebase (it also creates a reporting gap). Out of curiosity, what parts of posh-git do you use, aside from the prompt? |
I'm getting an actual error from posh-git, and this problem I believe does exist in ugit. I get the following error as soon as I import ugit: [PoshGitVcsPrompt error: Cannot bind parameter because parameter 'c' is specified more than once. To provide multiple values to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,value3".] I tracked this down to an error being thrown by Use-Git. The error is caused from parsing the git command line that posh-git uses. The start of the command is |
The module posh-git provides the ability to show the status of the current git repository in the prompt.
The issue is that
posh-git
usesgit status
and regexen to build the prompt.Perhaps ugit could provide a replacement for
posh-git\Write-VcsStatus
?The text was updated successfully, but these errors were encountered: