Simon Oosthoek [off-list ref] writes:
__git_ps1 ()
{
+ local pcmode=no
+ #defaults/examples:
+ local ps1pc_start='\u@\h:\w '
+ local ps1pc_end='\$ '
+ local printf_format='(%s)'
+ ...
This conversion is wrong, given that ...
quoted hunk
@@ -284,6 +317,12 @@ __git_ps1 ()
fi
local f="$w$i$s$u"
- printf -- "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r$p"
... the original has a SP in front. I've tentatively queued a
fix-up patch on the topic branch before merging it to 'pu'.
+ if [ $pcmode = yes ]; then
+ PS1="$ps1pc_start("
+ PS1="$PS1$c${b##refs/heads/}${f:+ $f}$r$p"
+ PS1="$PS1)$ps1pc_end"
+ else
+ printf -- "$printf_format" "$c${b##refs/heads/}${f:+ $f}$r$p"
+ fi
fi
}