From: Junio C Hamano Date: Fri, 28 Sep 2012 17:58:59 GMT Subject: Re: [PATCH] Add __git_ps1_pc to use as PROMPT_COMMAND Message-ID: <7vipaym3ks.fsf@alter.siamese.dyndns.org> In-Reply-To: <50658C9B.6030809@nieuwland.nl> Simon Oosthoek writes: > +# __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.