From: Daniel Trstenjak <Daniel.Trstenjak@science-computing.de>
To: spearce@spearce.org
Cc: git@vger.kernel.org
Subject: [PATCH] Showing stash state in bash prompt
Date: Wed, 13 May 2009 11:44:48 +0200 [thread overview]
Message-ID: <20090513094448.GC2106@bug.science-computing.de> (raw)
[-- 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
next reply other threads:[~2009-05-13 10:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 9:44 Daniel Trstenjak [this message]
2009-05-13 10:53 ` [PATCH] Showing stash state in bash prompt 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
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=20090513094448.GC2106@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.