All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Trstenjak <Daniel.Trstenjak@science-computing.de>
To: git@vger.kernel.org
Cc: spearce@spearce.org
Subject: Re: [PATCH] Showing stash state in bash prompt
Date: Wed, 13 May 2009 13:25:35 +0200	[thread overview]
Message-ID: <20090513112535.GD2106@bug.science-computing.de> (raw)
In-Reply-To: <fabb9a1e0905130353u416086b8i5b685e750ec4b5a5@mail.gmail.com>


Showing stash state in bash prompt.

Signed-off-by: Daniel Trstenjak <daniel.trstenjak@science-computing.de>
---
 contrib/completion/git-completion.bash |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

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
-- 
1.6.2

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

  reply	other threads:[~2009-05-13 11:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20090513112535.GD2106@bug.science-computing.de \
    --to=daniel.trstenjak@science-computing.de \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.