-
-
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
Abbreviate Git Directory Edge Cases #746
Comments
Submitted a PR (#797) to address nr 1 above. I also found another thing which I don't really understand, Utils.ps1 line 288: This means that when in the home directory root, the path won't be abbreviated, this will only when I go down one or more levels. Isn't a more standard behavior to also abbreviate the home dir to only '~'? |
On Linux yes but after using it on Windows, it seemed a bit too much of an abbreviation for the typical Windows user. We could qualify that last condition with a test for the OS so that we'd only do this on Windows. Alternatively, we could add a new setting for this that defaults differently for Windows. |
Alright, then I vote for a setting so that people who use both Windows and Linux can feel welcome at ~ :D |
After thinking about this some more, I'm really tempted to simplify and make Windows behave like Linux and just show |
Is it reasonable to default to whatever PowerShell defaults to without posh-git? |
Well, PowerShell does not abbreviate paths displayed in the prompt. Maybe we should not enable this option |
This matches Git Bash behavior, too. |
OK, I'll submit a PR to make this change later tonight! |
Two edge cases not considered by original implementation (#720):
Get-GitDirectory
inside a worktree currently returns the path to.git/worktrees/[name]
, which won't match the current path. I can think of two ways to resolve this:Get-GitDirectory
to return the contents of.git/worktrees/[name]/gitdir
. No idea what the downstream effects of this would be.$gitPath
matches.git/worktrees/
; if it does, set$gitPath
to the contents of$gitPath/gitdir
The text was updated successfully, but these errors were encountered: