Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions bullet-train.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ if [ ! -n "${BULLETTRAIN_PROMPT_ORDER+1}" ]; then
rust
elixir
git
git_tag
hg
cmd_exec_time
)
Expand Down Expand Up @@ -209,6 +210,9 @@ fi
if [ ! -n "${BULLETTRAIN_GIT_PROMPT_CMD+1}" ]; then
BULLETTRAIN_GIT_PROMPT_CMD="\$(git_prompt_info)"
fi
if [ ! -n "${BULLETTRAIN_GIT_TAG_PROMPT_CMD+1}" ]; then
BULLETTRAIN_GIT_TAG_PROMPT_CMD="\$(git describe --abbrev=0 --tags)"
fi

# PERL
if [ ! -n "${BULLETTRAIN_PERL_BG+1}" ]; then
Expand Down Expand Up @@ -439,6 +443,24 @@ prompt_git() {
fi
}

prompt_git_tag() {
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" == "1" ]]; then
return
fi

local repo_path git_tag_prompt
repo_path=$(git rev-parse --git-dir 2>/dev/null)

if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
if $(git describe --abbrev=0 --tags >/dev/null 2>&1); then
prompt_segment $BULLETTRAIN_GIT_BG $BULLETTRAIN_GIT_FG

eval git_tag_prompt=${BULLETTRAIN_GIT_TAG_PROMPT_CMD}
echo -n ${git_tag_prompt}
fi
fi
}

prompt_hg() {
local rev status
if $(hg id >/dev/null 2>&1); then
Expand Down