[PATCH] Bash snippet to show branch and patch in bash prompt

From: Robin Rosenberg <robin.rosenberg@dewire.com>
Date: 2006-10-30 21:42:25
From: Robin Rosenberg <robin.rosenberg@dewire.com>

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---

 contrib/stgbashprompt.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/contrib/stgbashprompt.sh b/contrib/stgbashprompt.sh
new file mode 100755
index 0000000..792da53
--- /dev/null
+++ b/contrib/stgbashprompt.sh
@@ -0,0 +1,16 @@
+# include this in your bashrc or copy to /etc/bash_completions.d
+
+if [ "$PS1" ]; then
+    # trap 'PS1="\u@\h [$(stg top)] \w]\$ "' DEBUG
+    function stgtag
+    {
+	br=$(stg branch 2>/dev/null)
+	top=$(stg top 2>/dev/null)
+	if [[ -n "$br$top" ]];then
+	    echo "[$top@$br]"
+	    return
+	fi
+    }
+    PS1='\u@\h$(stgtag)\w\$ '
+
+fi
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Oct 30 21:41:27 2006

This archive was generated by hypermail 2.1.8 : 2006-10-30 21:42:35 EST