From 4fdf5df25884ecfaa6668dbc152ee5e7c573d8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Maggioni?= Date: Tue, 22 Mar 2016 18:24:34 +0100 Subject: [PATCH] Documentation --- functions/vcs.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/vcs.zsh b/functions/vcs.zsh index 92731d52..af247d9c 100644 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -61,10 +61,13 @@ function +vi-git-remotebranch() { } function +vi-git-tagname() { + # Only show the tag name if we are not in DETACHED_HEAD state, + # since in that case it would already be displayed in the branch segment if [[ -n "$(git status | grep 'HEAD detached')" ]] ; then local tag tag=$(git describe --tags --exact-match HEAD 2>/dev/null) + # Append the tag segment to the branch one [[ -n "${tag}" ]] && hook_com[branch]+=" $(print_icon 'VCS_TAG_ICON')${tag}" fi }