From: Ben Clifford Date: Fri, 27 Oct 2006 10:01:15 GMT Subject: Re: StGit-enabled bash-prompt Message-ID: In-Reply-To: <200610262317.30209.robin.rosenberg.lists@dewire.com> On Thu, 26 Oct 2006, Robin Rosenberg wrote: > Of course you will read and understand this code. I don't know how good an > idea it is to use the DEBUG trap this way. I set my prompt without using it, with something approximating this being defined in my .bash_profile. I think the use of ' instead of " causes evaluation of __prompt_githead be delayed until the prompt is displayed. PS1='$(__prompt_githead) '$PS1 __prompt_githead() { PS_GIT=$(git-symbolic-ref HEAD 2>/dev/null) || exit echo -n " $(basename $PS_GIT)" } --