-
-
Notifications
You must be signed in to change notification settings - Fork 811
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
Can I show the current revision/version of the branch in the prompt? #69
Comments
This is not currently supported. What do you have in mind? |
An easy way to retrieve the hash to be shown on the prompt. I created a function:
This is slow and not really usable for the prompt but it is useful when you want to create a version number in which you want to include the hash. |
You can do this without relying on
|
Or let git truncate for you: I'm not comfortable adding the revision to $GitPromptSettings.AfterBranchScript = {
param($status, $backgroundColor, $foregroundColor)
Write-Prompt " ($(?? (Get-GitRevision -Short) 'new'))" `
-BackgroundColor $backgroundColor -ForegroundColor $foregroundColor
} On my machine, that displays the short revision after the branch, in the same color as the branch:
What do you think? |
See issue #345. I think a better approach to such niche customization is to make it easier for folks to customize the content of the Git status summary text rather than adding more & more options to posh-git. |
Posh shows the current branch in the commandprompt but it would be nice if it could also show the current branch revision/version/shorthash.
Maybe this is already possible but I'm not a powershell wizard yet.
The text was updated successfully, but these errors were encountered: