summaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-07-11 22:15:17 -0500
committerJesse Luehrs <doy@tozt.net>2009-07-11 22:15:17 -0500
commitb12eddb4098247fe020b4911d7b47624a0dbcc1d (patch)
treef2c18bd98acffedb6317b51d41d72784c34509a8 /bashrc
parent10b42339d123fb36770684b83f87eb16d8fb5306 (diff)
downloadconf-b12eddb4098247fe020b4911d7b47624a0dbcc1d.tar.gz
conf-b12eddb4098247fe020b4911d7b47624a0dbcc1d.zip
if we aren't on a head, show the short hash in the prompt
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc2
1 files changed, 1 insertions, 1 deletions
diff --git a/bashrc b/bashrc
index 3958c5f..59fef9c 100644
--- a/bashrc
+++ b/bashrc
@@ -210,7 +210,7 @@ function _set_vcs {
;;
git)
vcs_dirty=$(git status -a > /dev/null 2>&1; echo $?)
- vcs_branch=$(git symbolic-ref -q HEAD 2>/dev/null)
+ vcs_branch=$(git symbolic-ref -q HEAD 2>/dev/null || git show-ref --hash=7 HEAD)
vcs_branch=${vcs_branch#refs/heads/}
if [[ "x$vcs_branch" == "xmaster" ]]; then
vcs_branch=''