git-prompt: add a describe style for any tags

git-prompt has various describe styles, among them "describe" (by annotated tags) and "default" (by exact match with any tag). Add a mode "tag" that describes by any tag, annotated or not. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael J Gruber committed Mar 15, 2017 at 14:15 UTC 9f0b4dd0b82b764e7873ce6779766415ebc7f1ea
1 file changed +3
contrib/completion/git-prompt.sh
+3
@@ -82,6 +82,7 @@
82 # contains relative to newer annotated tag (v1.6.3.2~35)
83 # branch relative to newer tag or branch (master~4)
84 # describe relative to older annotated tag (v1.6.3.1-13-gdd42c2f)
85 +# tag relative to any older tag (v1.6.3.1-13-gdd42c2f)
86 # default exactly matching tag
87 #
88 # If you would like a colored hint about the current dirty state, set
@@ -443,6 +444,8 @@ __git_ps1 ()
444 git describe --contains HEAD ;;
445 (branch)
446 git describe --contains --all HEAD ;;
447 + (tag)
448 + git describe --tags HEAD ;;
449 (describe)
450 git describe HEAD ;;
451 (* | default)