Skip to content

Commit 9f0b4dd

Browse files
Michael J Grubergitster
authored andcommitted
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>
1 parent e7e07d5 commit 9f0b4dd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/completion/git-prompt.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
# contains relative to newer annotated tag (v1.6.3.2~35)
8383
# branch relative to newer tag or branch (master~4)
8484
# 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)
8586
# default exactly matching tag
8687
#
8788
# If you would like a colored hint about the current dirty state, set
@@ -443,6 +444,8 @@ __git_ps1 ()
443444
git describe --contains HEAD ;;
444445
(branch)
445446
git describe --contains --all HEAD ;;
447+
(tag)
448+
git describe --tags HEAD ;;
446449
(describe)
447450
git describe HEAD ;;
448451
(* | default)

0 commit comments

Comments
 (0)