From 6dfc9b960f023f30d6c55a22fa8402d91beb8d1f Mon Sep 17 00:00:00 2001 From: Banst Date: Tue, 8 Nov 2022 09:34:13 +0100 Subject: [PATCH] feat(git): display tag in git-prompt when possible (#11318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- lib/git.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/git.zsh b/lib/git.zsh index be9fa7e67..f049f73c2 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -19,6 +19,7 @@ function git_prompt_info() { local ref ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) \ + || ref=$(__git_prompt_git describe --tags --exact-match HEAD 2> /dev/null) \ || ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) \ || return 0