Re: [PATCH] Add __git_ps1_pc to use as PROMPT_COMMAND
- From
- Simon Oosthoek <soosthoek@nieuwland.nl>
- Date
- Oct 1, 2012, 19:27 UTC
- Message-ID
- <5069EE8D.6050200@nieuwland.nl>
- In-Reply-To
- <7v4nmec8fi.fsf@alter.siamese.dyndns.org>
On 01/10/12 21:13, Junio C Hamano wrote:
Show 6 quoted lines
> Hrm, let me ask a stupid question. Why do we even need __git_ps1_pc > in the first place? Wouldn't it be just the matter of > > PROMPT_COMMAND='__git_ps1 "%s"' > > once you have __git_ps1 that works?
Apart from one small detail, PS1 must be set directly when __git_ps1 is called as a PROMPT_COMMAND, while in command substitution mode, __git_ps1 needs to put out a string value to substitute...
This is the way it works now (I'll send the patch later this week, I want to test it some more...)
/Simon