git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [StGIT PATCH] Bash snippet to show branch and patch in bash prompt
@ 2006-10-29 23:37 Robin Rosenberg
  2006-10-30  9:57 ` Eran Tromer
  0 siblings, 1 reply; 11+ messages in thread
From: Robin Rosenberg @ 2006-10-29 23:37 UTC (permalink / raw)
  To: catalin.marinas; +Cc: git

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\$ '
+

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH] Bash snippet to show branch and patch in bash prompt
@ 2006-10-30 10:42 Robin Rosenberg
  2006-10-30 10:46 ` Catalin Marinas
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Robin Rosenberg @ 2006-10-30 10:42 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Eran Tromer, git

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\$ '
+

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

end of thread, other threads:[~2006-11-02 11:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-29 23:37 [StGIT PATCH] Bash snippet to show branch and patch in bash prompt Robin Rosenberg
2006-10-30  9:57 ` Eran Tromer
2006-10-30 10:24   ` Catalin Marinas
2006-10-30 10:32   ` Robin Rosenberg
2006-10-30 10:59   ` [PATCH] " Robin Rosenberg
2006-10-30 15:03     ` Eran Tromer
2006-11-02 11:24       ` Catalin Marinas
  -- strict thread matches above, loose matches on Subject: below --
2006-10-30 10:42 Robin Rosenberg
2006-10-30 10:46 ` Catalin Marinas
2006-10-30 10:57 ` Robin Rosenberg
2006-10-30 10:59 ` 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).