diff --git a/gitprompt.sh b/gitprompt.sh index 5421acc..84b999d 100755 --- a/gitprompt.sh +++ b/gitprompt.sh @@ -528,7 +528,15 @@ function updatePrompt() { local NEW_PROMPT="$EMPTY_PROMPT" if [[ -n "$git_status_fields" ]]; then - local STATUS_PREFIX="${PROMPT_LEADING_SPACE}${GIT_PROMPT_PREFIX}${GIT_PROMPT_BRANCH}\${GIT_BRANCH}${ResetColor}${GIT_FORMATTED_UPSTREAM}" + + case "$GIT_BRANCH" in + $GIT_PROMPT_MASTER_BRANCHES) + local STATUS_PREFIX="${PROMPT_LEADING_SPACE}${GIT_PROMPT_PREFIX}${GIT_PROMPT_MASTER_BRANCH}\${GIT_BRANCH}${ResetColor}${GIT_FORMATTED_UPSTREAM}" + ;; + *) + local STATUS_PREFIX="${PROMPT_LEADING_SPACE}${GIT_PROMPT_PREFIX}${GIT_PROMPT_BRANCH}\${GIT_BRANCH}${ResetColor}${GIT_FORMATTED_UPSTREAM}" + ;; + esac local STATUS="" # __add_status KIND VALEXPR INSERT diff --git a/themes/Chmike.bgptheme b/themes/Chmike.bgptheme index dc702df..b0418bc 100644 --- a/themes/Chmike.bgptheme +++ b/themes/Chmike.bgptheme @@ -14,6 +14,7 @@ override_git_prompt_colors() { GIT_PROMPT_THEME_NAME="Chmike" GIT_PROMPT_BRANCH="${Green}" + GIT_PROMPT_MASTER_BRANCH="${Green}" GIT_PROMPT_REMOTE=" " GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="⭐" diff --git a/themes/Custom.bgptemplate b/themes/Custom.bgptemplate index d494198..6fc2e9f 100644 --- a/themes/Custom.bgptemplate +++ b/themes/Custom.bgptemplate @@ -14,6 +14,7 @@ override_git_prompt_colors() { # GIT_PROMPT_SEPARATOR="|" # separates each item # GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory + # GIT_PROMPT_MASTER_BRANCH="${Magenta}" # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES # GIT_PROMPT_STAGED="${Red}●" # the number of staged files/directories # GIT_PROMPT_CONFLICTS="${Red}✖ " # the number of files in conflict # GIT_PROMPT_CHANGED="${Blue}✚ " # the number of changed files @@ -53,6 +54,12 @@ override_git_prompt_colors() { # GIT_PROMPT_SYMBOLS_BEHIND="↓·" # The symbol for "n versions behind of origin" # GIT_PROMPT_SYMBOLS_PREHASH=":" # Written before hash of commit, if no name could be found # GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="L" # This symbol is written after the branch, if the branch is not tracked + + # branch name(s) that will use $GIT_PROMPT_MASTER_BRANCH color + # To specify multiple branches, use + # shopt -s extglob + # GIT_PROMPT_MASTER_BRANCHES='@(master|production)' + # GIT_PROMPT_MASTER_BRANCHES="master" } -reload_git_prompt_colors "Custom" \ No newline at end of file +reload_git_prompt_colors "Custom" diff --git a/themes/Default.bgptheme b/themes/Default.bgptheme index be680c5..ade65f5 100644 --- a/themes/Default.bgptheme +++ b/themes/Default.bgptheme @@ -42,6 +42,7 @@ define_undefined_git_prompt_colors() { if [ -z ${GIT_PROMPT_SEPARATOR+x} ]; then GIT_PROMPT_SEPARATOR="|"; fi # separates each item if [ -z ${GIT_PROMPT_BRANCH+x} ]; then GIT_PROMPT_BRANCH="${Magenta}"; fi # the git branch that is active in the current directory + if [ -z ${GIT_PROMPT_MASTER_BRANCH+x} ]; then GIT_PROMPT_MASTER_BRANCH="${Magenta}"; fi # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES if [ -z ${GIT_PROMPT_STAGED+x} ]; then GIT_PROMPT_STAGED="${Red}●"; fi # the number of staged files/directories if [ -z ${GIT_PROMPT_CONFLICTS+x} ]; then GIT_PROMPT_CONFLICTS="${Red}✖ "; fi # the number of files in conflict if [ -z ${GIT_PROMPT_CHANGED+x} ]; then GIT_PROMPT_CHANGED="${Blue}✚ "; fi # the number of changed files @@ -88,6 +89,12 @@ define_undefined_git_prompt_colors() { if [ -z ${GIT_PROMPT_SYMBOLS_BEHIND+x} ]; then GIT_PROMPT_SYMBOLS_BEHIND="↓·"; fi # The symbol for "n versions behind of origin" if [ -z ${GIT_PROMPT_SYMBOLS_PREHASH+x} ]; then GIT_PROMPT_SYMBOLS_PREHASH=":"; fi # Written before hash of commit, if no name could be found if [ -z ${GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING+x} ]; then GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="L"; fi # This symbol is written after the branch, if the branch is not tracked + + # branch name(s) that will use $GIT_PROMPT_MASTER_BRANCH color + # To specify multiple branches, use + # shopt -s extglob + # GIT_PROMPT_MASTER_BRANCHES='@(master|production)' + if [ -z ${GIT_PROMPT_MASTER_BRANCHES+x} ]; then GIT_PROMPT_MASTER_BRANCHES="master"; fi } # call only from theme file diff --git a/themes/Evermeet.bgptheme b/themes/Evermeet.bgptheme index 56c2f41..78d0c06 100644 --- a/themes/Evermeet.bgptheme +++ b/themes/Evermeet.bgptheme @@ -9,6 +9,7 @@ override_git_prompt_colors() { GIT_PROMPT_SEPARATOR="|" # separates each item GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory + GIT_PROMPT_MASTER_BRANCH="${Magenta}" # the git branch that is active in the current directory GIT_PROMPT_STAGED="${Cyan}●" # the number of staged files/directories GIT_PROMPT_CONFLICTS="${BoldRed}✖" # the number of files in conflict GIT_PROMPT_CHANGED="${Cyan}✚" # the number of changed files diff --git a/themes/Evermeet_Lowres.bgptheme b/themes/Evermeet_Lowres.bgptheme index 421ed76..df432ad 100644 --- a/themes/Evermeet_Lowres.bgptheme +++ b/themes/Evermeet_Lowres.bgptheme @@ -11,6 +11,7 @@ override_git_prompt_colors() { GIT_PROMPT_SEPARATOR="|" # separates each item GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory + GIT_PROMPT_MASTER_BRANCH="${Magenta}" # the git branch that is active in the current directory GIT_PROMPT_STAGED="${Cyan}●" # the number of staged files/directories GIT_PROMPT_CONFLICTS="${BoldRed}✖ " # the number of files in conflict GIT_PROMPT_CHANGED="${Cyan}✚ " # the number of changed files diff --git a/themes/Evermeet_Ubuntu.bgptheme b/themes/Evermeet_Ubuntu.bgptheme index 14077b9..b920066 100644 --- a/themes/Evermeet_Ubuntu.bgptheme +++ b/themes/Evermeet_Ubuntu.bgptheme @@ -11,6 +11,7 @@ override_git_prompt_colors() { GIT_PROMPT_SEPARATOR="|" # separates each item GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory + GIT_PROMPT_MASTER_BRANCH="${Magenta}" # the git branch that is active in the current directory GIT_PROMPT_STAGED="${Cyan}● " # the number of staged files/directories GIT_PROMPT_CONFLICTS="${BoldRed}✖ " # the number of files in conflict GIT_PROMPT_CHANGED="${Cyan}✚ " # the number of changed files diff --git a/themes/Minimal.bgptheme b/themes/Minimal.bgptheme index 622388c..a4dd06a 100644 --- a/themes/Minimal.bgptheme +++ b/themes/Minimal.bgptheme @@ -36,6 +36,7 @@ override_git_prompt_colors() { Time12a="\$(date +%H:%M:%S)" GIT_PROMPT_BRANCH="${BoldMagenta}" # the git branch that is active in the current directory + GIT_PROMPT_MASTER_BRANCH="${BoldMagenta}" # the git branch that is active in the current directory GIT_PROMPT_PREFIX="" # start of the git info string GIT_PROMPT_SUFFIX="" # the end of the git info string GIT_PROMPT_SEPARATOR="" # separates each item diff --git a/themes/Minimal_UserHost.bgptheme b/themes/Minimal_UserHost.bgptheme index bb619b0..493f959 100644 --- a/themes/Minimal_UserHost.bgptheme +++ b/themes/Minimal_UserHost.bgptheme @@ -44,6 +44,7 @@ override_git_prompt_colors() { fi GIT_PROMPT_BRANCH="${BoldMagenta}" # the git branch that is active in the current directory + GIT_PROMPT_MASTER_BRANCH="${BoldMagenta}" # the git branch that is active in the current directory GIT_PROMPT_PREFIX="" # start of the git info string GIT_PROMPT_SUFFIX="" # the end of the git info string GIT_PROMPT_SEPARATOR="" # separates each item diff --git a/themes/Single_line_Dark.bgptheme b/themes/Single_line_Dark.bgptheme index 82d73e8..52614b5 100644 --- a/themes/Single_line_Dark.bgptheme +++ b/themes/Single_line_Dark.bgptheme @@ -4,6 +4,7 @@ override_git_prompt_colors() { GIT_PROMPT_THEME_NAME="Single_line_nono031" GIT_PROMPT_BRANCH="${Cyan}" + GIT_PROMPT_MASTER_BRANCH="${Cyan}" GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}" GIT_PROMPT_CHANGED="${Yellow}✚ " GIT_PROMPT_STAGED="${Magenta}●" diff --git a/themes/Single_line_NoExitState_Gentoo.bgptheme b/themes/Single_line_NoExitState_Gentoo.bgptheme index 99b4c83..c54aa4b 100644 --- a/themes/Single_line_NoExitState_Gentoo.bgptheme +++ b/themes/Single_line_NoExitState_Gentoo.bgptheme @@ -4,6 +4,7 @@ override_git_prompt_colors() { GIT_PROMPT_THEME_NAME="Single_line_NoExitState_Gentoo" GIT_PROMPT_BRANCH="${Cyan}" + GIT_PROMPT_MASTER_BRANCH="${Cyan}" GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}" GIT_PROMPT_CHANGED="${Yellow}✚ " GIT_PROMPT_STAGED="${Magenta}●" diff --git a/themes/Single_line_NoExitState_openSUSE.bgptheme b/themes/Single_line_NoExitState_openSUSE.bgptheme index e3580d7..1874b55 100644 --- a/themes/Single_line_NoExitState_openSUSE.bgptheme +++ b/themes/Single_line_NoExitState_openSUSE.bgptheme @@ -4,6 +4,7 @@ override_git_prompt_colors() { GIT_PROMPT_THEME_NAME="Single_line_NoExitState_openSUSE" GIT_PROMPT_BRANCH="${Cyan}" + GIT_PROMPT_MASTER_BRANCH="${Cyan}" GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}" GIT_PROMPT_CHANGED="${Yellow}✚ " GIT_PROMPT_STAGED="${Magenta}●" diff --git a/themes/Single_line_openSUSE.bgptheme b/themes/Single_line_openSUSE.bgptheme index 396006a..f8ec62c 100644 --- a/themes/Single_line_openSUSE.bgptheme +++ b/themes/Single_line_openSUSE.bgptheme @@ -4,6 +4,7 @@ override_git_prompt_colors() { GIT_PROMPT_THEME_NAME="Single_line_openSUSE" GIT_PROMPT_BRANCH="${Cyan}" + GIT_PROMPT_MASTER_BRANCH="${Cyan}" GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}" GIT_PROMPT_CHANGED="${Yellow}✚ " GIT_PROMPT_STAGED="${Magenta}●"