git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Showing stash state in bash prompt
@ 2009-05-13  9:44 Daniel Trstenjak
  2009-05-13 10:53 ` Sverre Rabbelier
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Trstenjak @ 2009-05-13  9:44 UTC (permalink / raw)
  To: spearce; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]


Greetings
Daniel

-- 
                                                                                                                                           
 Daniel Trstenjak         Tel   : +49 (0)7071-9457-264
 science + computing ag   FAX   : +49 (0)7071-9457-511
 Hagellocher Weg 73       mailto: Daniel.Trstenjak@science-computing.de
 D-72070 Tübingen         WWW   : http://www.science-computing.de/                                                                      
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


[-- Attachment #2: showing_stash_state.txt --]
[-- Type: text/plain, Size: 836 bytes --]

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 1683e6d..86e39a5 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -117,6 +117,7 @@ __git_ps1 ()
 
 		local w
 		local i
+		local s
 		local c
 
 		if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
@@ -136,15 +137,19 @@ __git_ps1 ()
 					else
 						i="#"
 					fi
+					stash_list=`git stash list`
+					if [ -n "$stash_list" ]; then
+					        s="$"
+				        fi
 				fi
 			fi
 		fi
 
 		if [ -n "$b" ]; then
 			if [ -n "${1-}" ]; then
-				printf "$1" "$c${b##refs/heads/}$w$i$r"
+				printf "$1" "$c${b##refs/heads/}$w$i$s$r"
 			else
-				printf " (%s)" "$c${b##refs/heads/}$w$i$r"
+				printf " (%s)" "$c${b##refs/heads/}$w$i$s$r"
 			fi
 		fi
 	fi

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

end of thread, other threads:[~2009-05-29  5:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-13  9:44 [PATCH] Showing stash state in bash prompt Daniel Trstenjak
2009-05-13 10:53 ` Sverre Rabbelier
2009-05-13 11:25   ` Daniel Trstenjak
2009-05-13 19:14     ` Junio C Hamano
2009-05-14 18:24       ` Thomas Rast
2009-05-15  0:57         ` Miles Bader
2009-05-15  2:11           ` Jeff King
2009-05-15  6:39             ` John Tapsell
2009-05-15  7:01               ` Brian Gernhardt
2009-05-15  7:12                 ` Miles Bader
2009-05-28  9:40             ` [RFC PATCH] Documentation: teach stash/pop workflow instead of stash/apply Thomas Rast
2009-05-29  0:59               ` Sitaram Chamarty
2009-05-29  5:37               ` Junio C Hamano

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).