-
-
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
Add prefix setting for posh-git default prompt. #393
Conversation
Add Pesters tests for the prompt function. Update docs for the new prefix and the fact that abbreviate home dir is disabled by default.
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.
So...who's going to write a Markdown-to-PowerShell-help converter? Because this double maintenance is tedious...oy! Thanks for taking the time.
A few comments, mostly trivial.
README.md
Outdated
> | ||
``` | ||
You can also customize the default prompt prefix text e.g.: | ||
``` | ||
$GitPromptSettings.DefaultPromptSuffix = '[$(hostname)] ' |
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/Suffix/Prefix/
src/en-US/about_posh-git.help.txt
Outdated
posh-git integrates Git and PowerShell with tab completion and Git | ||
status summary information displayed in the PowerShell prompt. | ||
posh-git integrates Git and PowerShell providing tab completion of Git | ||
commands, remotes and branch names. It also provides Git status summary |
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.
"commands, branch names, paths and more"?
src/en-US/about_posh-git.help.txt
Outdated
@@ -14,6 +15,10 @@ LONG DESCRIPTION | |||
via the Get-GitStatus command. Then you can display the information in | |||
your prompt however you would like. | |||
|
|||
posh-git will install a prompt function if it detects the user does not | |||
have their own customized prompt. This prompt displays Git status summary |
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.
Comma after "own," as in the readme?
src/en-US/about_posh-git.help.txt
Outdated
POWERSHELL PROMPT | ||
PowerShell generates its prompt by executing a function named "prompt", if | ||
one exists. posh-git will install its prompt function if it detects the | ||
user does not have their own, customized prompt fucntion. This prompt |
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/fucntion/function/
src/en-US/about_posh-git.help.txt
Outdated
one exists. posh-git will install its prompt function if it detects the | ||
user does not have their own, customized prompt fucntion. This prompt | ||
displays the current working directory followed by git status summary | ||
information if the current directory is located in a Git repository e.g.: |
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.
comma before "e.g."?
README.md
Outdated
@@ -5,7 +5,7 @@ | |||
|
|||
posh-git is a PowerShell module that integrates Git and PowerShell by providing Git status summary information that can be displayed in the PowerShell prompt e.g.: |
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.
Comma before "e.g."?
src/en-US/about_posh-git.help.txt
Outdated
For more information on customizing the posh-git default prompt or creating | ||
your own prompt fuction see: | ||
https://github.com/dahlbyk/posh-git/wiki/Customizing-Your-PowerShell-Prompt | ||
|
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.
Extra newline?
test/DefaultPrompt.Tests.ps1
Outdated
Set-Location $PSScriptRoot | ||
|
||
function global:git { | ||
$cmdline = "$args" |
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.
Does $OFS = ''
set above mess with this?
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.
More generally, is this mock git
function something that should be defined in Shared?
Move $OFS='' to a more specific scope. Add $ForcePoshGitPrompt param to posh-git.psm1 to force load of the posh-git prompt. Moved git function to shared.ps1. Eventually when I can figure how to remove this global function, I'd like this function to be add in BeforeAll and removed in AfterAll for the tests that actually need to mock Git.
It would be nice with the ANSI support if PowerShell could render basic markdown in the console. But a converter would be nice too. Take a look at the change. I cleaned up the typos and tweaked the tests some more. There were failing when I ran them from PowerShell where I already had a prompt/settings/posh-git loaded. These changes make this scenario work although it leaves with the default posh-git prompt. |
Add Pesters tests for the prompt function. Update docs for the new prefix and the fact that abbreviate home dir is disabled by default.