git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: git@vger.kernel.org
Subject: StGit-enabled bash-prompt
Date: Thu, 26 Oct 2006 23:17:29 +0200	[thread overview]
Message-ID: <200610262317.30209.robin.rosenberg.lists@dewire.com> (raw)

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


             reply	other threads:[~2006-10-26 21:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-26 21:17 Robin Rosenberg [this message]
2006-10-27 10:01 ` StGit-enabled bash-prompt Ben Clifford
2006-10-27 18:54   ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200610262317.30209.robin.rosenberg.lists@dewire.com \
    --to=robin.rosenberg.lists@dewire.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).