git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* StGit-enabled bash-prompt
@ 2006-10-26 21:17 Robin Rosenberg
  2006-10-27 10:01 ` Ben Clifford
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Rosenberg @ 2006-10-26 21:17 UTC (permalink / raw)
  To: git

Hi,

I added the following snippet to my .bashrc to help me keep track of what 
patch I'm working on.  I got annoyed at typing stg top/stg series all the 
time.

This changes the bash prompt to include the current git branch and the top 
stgit patch to the prompt.

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.

NO WARRANTY (as always)

-- robin

if [ "$PS1" ]; then
    function stgtag
    {
        br=$(stg branch 2>/dev/null)
        top=$(stg top 2>/dev/null)
        if [[ -n "$br$top" ]];then
            echo " [$top@$br] "
        fi
    }
    trap 'PS1="\u@\h$(stgtag)\w]\$ "' DEBUG


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-27 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-26 21:17 StGit-enabled bash-prompt Robin Rosenberg
2006-10-27 10:01 ` Ben Clifford
2006-10-27 18:54   ` Robin Rosenberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).