diff options
author | Robby Russell <robby@planetargon.com> | 2014-04-17 19:57:23 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2014-04-17 19:57:23 -0700 |
commit | a9061f34d7dbb2e65d2c378dcee9402466ab63ae (patch) | |
tree | 9d2eb26baad2a4a2d7fe00659f8cef4ef0478f84 | |
parent | f8f01262ab19edcbed40fd77d959b64408ea81e2 (diff) | |
parent | 53323abdb1a18c7756ace473390ac6ca51660839 (diff) | |
download | zsh-a9061f34d7dbb2e65d2c378dcee9402466ab63ae.tar.gz zsh-a9061f34d7dbb2e65d2c378dcee9402466ab63ae.tar.bz2 zsh-a9061f34d7dbb2e65d2c378dcee9402466ab63ae.zip |
Merge pull request #2633 from redsunsoft/agnoster-theme-git-mode-addition
Added git support for merging, rebasing, and bisecting to agnoster theme
-rw-r--r-- | themes/agnoster.zsh-theme | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 85b846cb5..2b33c48bc 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -69,7 +69,9 @@ prompt_context() { # Git: branch/detached head, dirty status prompt_git() { - local ref dirty + local ref dirty mode repo_path + repo_path=$(git rev-parse --git-dir 2>/dev/null) + if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then dirty=$(parse_git_dirty) ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" @@ -79,6 +81,14 @@ prompt_git() { prompt_segment green black fi + if [[ -e "${repo_path}/BISECT_LOG" ]]; then + mode=" <B>" + elif [[ -e "${repo_path}/MERGE_HEAD" ]]; then + mode=" >M<" + elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then + mode=" >R>" + fi + setopt promptsubst autoload -Uz vcs_info @@ -90,7 +100,7 @@ prompt_git() { zstyle ':vcs_info:*' formats ' %u%c' zstyle ':vcs_info:*' actionformats ' %u%c' vcs_info - echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }" + echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }${mode}" fi } |