aboutsummaryrefslogtreecommitdiff
path: root/pdksh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-09-07 16:10:30 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-09-07 16:12:51 +1200
commit5d61bb6546d4c4045f302c0c2daf7594820e6507 (patch)
treef204587af26451ee437ca8655e8a383a4d463834 /pdksh
parentRemove fixed issue of `kill` completion (diff)
downloaddotfiles-5d61bb6546d4c4045f302c0c2daf7594820e6507.tar.gz
dotfiles-5d61bb6546d4c4045f302c0c2daf7594820e6507.zip
Restore old code for describing Git prompt commit
I'm really confused. I could have sworn this was working correctly (i.e. the --always option spat out a short reference to the commit as a fallback), but I must have been wrong. Maybe I hadn't installed the appropriate file when I was testing it. At first I thought this was a bug introduced in Git 2.10, but the short-circuit disregarding --always if --exact-match or --candidates=0 is set seems to have been in the `describe` builtin for ages. I must have just tested poorly; I can't see any other explanation in the source. No matter; this isn't much slower.
Diffstat (limited to 'pdksh')
-rw-r--r--pdksh/pdkshrc.d/prompt.pdksh3
1 files changed, 2 insertions, 1 deletions
diff --git a/pdksh/pdkshrc.d/prompt.pdksh b/pdksh/pdkshrc.d/prompt.pdksh
index 920e21ae..7e6dd8fe 100644
--- a/pdksh/pdkshrc.d/prompt.pdksh
+++ b/pdksh/pdkshrc.d/prompt.pdksh
@@ -101,7 +101,8 @@ prompt() {
typeset name
name=$( {
git symbolic-ref --quiet HEAD ||
- git describe --all --always --exact-match HEAD
+ git describe --tags --exact-match HEAD ||
+ git rev-parse --short HEAD
} 2>/dev/null) || return
name=${name##*/}
[[ -n $name ]] || return