From baf13b2e1af98040394c7e4a7bce0507a69f03eb Mon Sep 17 00:00:00 2001 From: Roger Clotet Date: Wed, 12 Feb 2014 11:46:17 +0100 Subject: [PATCH] Displaying current tag in git prompt --- lib/git.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/git.zsh b/lib/git.zsh index 305a77aff..a7c426ba3 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -2,6 +2,7 @@ function git_prompt_info() { if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ + ref=$(command git describe --exact-match --tags $(git log -n1 --pretty='%h' 2> /dev/null) 2> /dev/null) || \ ref=$(command git rev-parse --short HEAD 2> /dev/null) || return echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" fi