Skip to content
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

Merged
merged 2 commits into from
Feb 2, 2017

Conversation

rkeithhill
Copy link
Collaborator

Add Pesters tests for the prompt function. Update docs for the new prefix and the fact that abbreviate home dir is disabled by default.

Add Pesters tests for the prompt function.  Update docs for the new prefix and the fact that abbreviate home dir is disabled by default.
Copy link
Owner

@dahlbyk dahlbyk left a 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)] '
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Suffix/Prefix/

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
Copy link
Owner

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"?

@@ -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
Copy link
Owner

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?

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/fucntion/function/

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.:
Copy link
Owner

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.:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma before "e.g."?

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra newline?

Set-Location $PSScriptRoot

function global:git {
$cmdline = "$args"
Copy link
Owner

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?

Copy link
Owner

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.
@rkeithhill
Copy link
Collaborator Author

who's going to write a Markdown-to-PowerShell-help converter

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.

@dahlbyk dahlbyk merged commit 8ea665f into master Feb 2, 2017
@dahlbyk dahlbyk deleted the rkeithhill/def-prompt-prefix-setting branch February 2, 2017 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants