Re: [PATCH] Add __git_ps1_pc to use as PROMPT_COMMAND
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 28, 2012, 17:58 UTC
- Message-ID
- <7vipaym3ks.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <50658C9B.6030809@nieuwland.nl>
Simon Oosthoek <soosthoek@nieuwland.nl> writes:
Show 9 quoted lines
> +# __git_ps1_pc accepts 0 arguments (for now)
> +# It is meant to be used as PROMPT_COMMAND, it sets PS1
> +__git_ps1_pc ()
> +{
> + local g="$(__gitdir)"
> + if [ -n "$g" ]; then
> +...
> + fi
> +}This looks awfully similar to the existing code in __git_ps1 function. Without refactoring to share the logic between them, it won't be maintainable.