diff --git a/git-prompt-help.sh b/git-prompt-help.sh index b9c699b..ca6c5de 100644 --- a/git-prompt-help.sh +++ b/git-prompt-help.sh @@ -3,7 +3,7 @@ # being displayed. git_prompt_help() { - cat <&2 + cat <|] BRANCH is a branch name, such as "master" or "stage", a tag name, or commit @@ -12,44 +12,46 @@ hash prefixed with ':'. TRACKING indicates how the local branch differs from the remote branch. It can be empty, or one of: - ↑N - ahead of remote by N commits - ↓N - behind remote by N commits - ↓M↑N - branches diverged, other by M commits, yours by N commits + ${GIT_PROMPT_BRANCH}${ResetColor}${GIT_PROMPT_REMOTE}↑·N${ResetColor} - ahead of remote by N commits + ${GIT_PROMPT_BRANCH}${ResetColor}${GIT_PROMPT_REMOTE}↓·N${ResetColor} - behind remote by N commits + ${GIT_PROMPT_BRANCH}${ResetColor}${GIT_PROMPT_REMOTE}↓·M↑·N${ResetColor} - branches diverged, other by M commits, yours by N commits LOCALSTATUS is one of the following: - ✔ - repository clean - ●N - N staged files - ✖N - N unmerged files - ✚N - N changed but *unstaged* files - …N - N untracked files - ⚑N - N stash entries + ${GIT_PROMPT_CLEAN}${ResetColor} - repository clean + ${GIT_PROMPT_STAGED}N${ResetColor} - N staged files + ${GIT_PROMPT_CONFLICTS}N${ResetColor} - N conflicted files + ${GIT_PROMPT_CHANGED}N${ResetColor} - N changed but *unstaged* files + ${GIT_PROMPT_UNTRACKED}N${ResetColor} - N untracked files + ${GIT_PROMPT_STASHED}N${ResetColor} - N stash entries See "git_prompt_examples" for examples. EOF } + help_git_prompt() { git_prompt_help ; } git_prompt_examples() { - cat <&2 + cat < [http://github.com/aks] # change those symbols to whatever you prefer -declare -a symbols -symbols['ahead']='↑·' -symbols['behind']='↓·' -symbols['prehash']=':' +symbols_ahead='↑·' +symbols_behind='↓·' +symbols_prehash=':' gitsym=`git symbolic-ref HEAD` @@ -52,7 +51,7 @@ if [[ -z "$branch" ]]; then if [[ -n "$tag" ]]; then branch="$tag" else - branch="${symbols['prehash']}`git rev-parse --short HEAD`" + branch="${symbols_prehash}`git rev-parse --short HEAD`" fi else remote_name=`git config branch.${branch}.remote` @@ -73,10 +72,10 @@ else num_ahead=`count_lines "^>"` num_behind=$(( num_revs - num_ahead )) if (( num_behind > 0 )) ; then - remote="${remote}${symbols['behind']}${num_behind}" + remote="${remote}${symbols_behind}${num_behind}" fi if (( num_ahead > 0 )) ; then - remote="${remote}${symbols['ahead']}${num_ahead}" + remote="${remote}${symbols_ahead}${num_ahead}" fi fi if [[ -z "$remote" ]] ; then