summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ff790b6)
raw | patch | inline | side by side (parent: ff790b6)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 10 May 2009 08:56:21 +0000 (01:56 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 May 2009 02:46:31 +0000 (19:46 -0700) |
Introduce GIT_PS1_DESCRIBE option you can set to "contains", "branch", or
"describe" to tweak the way how a detached HEAD is described.
The default behaviour is to describe only exact match with some tag
(otherwise use the first 7 hexdigits) as before.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"describe" to tweak the way how a detached HEAD is described.
The default behaviour is to describe only exact match with some tag
(otherwise use the first 7 hexdigits) as before.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash | patch | blob | history |
index be591468dbf9314f658721392c5a38a50a4fb6f9..dd6cd250e35cb695107d4a9f610752e09ec5bbb7 100755 (executable)
fi
b="$(git symbolic-ref HEAD 2>/dev/null)" || {
- b="$(git describe --exact-match HEAD 2>/dev/null)" ||
+
+ b="$(
+ case "${GIT_PS1_DESCRIBE_STYLE-}" in
+ (contains)
+ git describe --contains HEAD ;;
+ (branch)
+ git describe --contains --all HEAD ;;
+ (describe)
+ git describe HEAD ;;
+ (* | default)
+ git describe --exact-match HEAD ;;
+ esac 2>/dev/null)" ||
+
b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)..." ||
b="unknown"
-
b="($b)"
}
fi