First stab at git-duet prompt segment

This commit is contained in:
Daniel Garnier-Moiroux 2020-07-08 12:23:27 +02:00
commit 3542212e14
5 changed files with 18 additions and 0 deletions

View file

@ -3958,6 +3958,16 @@ prompt_vcs() {
fi
}
################################################################
# Git-duet: Support for committer/author pair in git
# see: https://github.com/git-duet/git-duet
function prompt_git_duet() {
GIT_DUET_INITIALS=$(echo $(git config --get-regexp "^duet.env.git-.*-initials" 2>/dev/null | sed -e 's/^.*-initials //') | sed -e 's/ /+/')
if [[ ! -z "$GIT_DUET_INITIALS" ]]; then
_p9k_prompt_segment $0 magenta white '' 0 '' "$GIT_DUET_INITIALS"
fi
}
################################################################
# Vi Mode: show editing mode (NORMAL|INSERT|VISUAL)
prompt_vi_mode() {