From 35f517070bbfb02a386b2bb8035214e382c892d7 Mon Sep 17 00:00:00 2001 From: Nicole O'Connor Date: Tue, 8 Aug 2023 13:59:59 -0700 Subject: [PATCH] git: add support for tags, fix remote support, show commit hash next to checkout name --- modules/git.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/git.zsh b/modules/git.zsh index af8f61a..d4306f8 100644 --- a/modules/git.zsh +++ b/modules/git.zsh @@ -17,7 +17,9 @@ function git_prompt() { if [[ "${branchtype}" == "refs" ]]; then branchname=$(echo ${fullbranchname} | cut -d"/" -f3) elif [[ "${branchtype}" == "remotes" ]]; then - branchname=$(echo ${commithash} | cut -d"/" -f2-) + branchname=$(echo ${fullbranchname} | cut -d"/" -f2-) + elif [[ "${branchtype}" == "tags" ]]; then + branchname=$(echo ${fullbranchname} | cut -d"/" -f2) elif [[ "${branchtype}" == "${fullbranchname}" ]]; then # git did it for us branchname=${fullbranchname} @@ -27,7 +29,7 @@ function git_prompt() { echo "warning: unrecognized branch type ${branchtype}" >&2 fi - print "%{$fg[yellow]%}${branchname}" + print "%{$fg_bold[yellow]%}${branchname} %{$fg[yellow]%}${commithash}" fi }