Skip to content

Commit d70d1a7

Browse files
committed
Merge branch 'cboltz-cboltz-mastercolor'
2 parents c427520 + 6791792 commit d70d1a7

13 files changed

+34
-2
lines changed

gitprompt.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,15 @@ function updatePrompt() {
528528

529529
local NEW_PROMPT="$EMPTY_PROMPT"
530530
if [[ -n "$git_status_fields" ]]; then
531-
local STATUS_PREFIX="${PROMPT_LEADING_SPACE}${GIT_PROMPT_PREFIX}${GIT_PROMPT_BRANCH}\${GIT_BRANCH}${ResetColor}${GIT_FORMATTED_UPSTREAM}"
531+
532+
case "$GIT_BRANCH" in
533+
$GIT_PROMPT_MASTER_BRANCHES)
534+
local STATUS_PREFIX="${PROMPT_LEADING_SPACE}${GIT_PROMPT_PREFIX}${GIT_PROMPT_MASTER_BRANCH}\${GIT_BRANCH}${ResetColor}${GIT_FORMATTED_UPSTREAM}"
535+
;;
536+
*)
537+
local STATUS_PREFIX="${PROMPT_LEADING_SPACE}${GIT_PROMPT_PREFIX}${GIT_PROMPT_BRANCH}\${GIT_BRANCH}${ResetColor}${GIT_FORMATTED_UPSTREAM}"
538+
;;
539+
esac
532540
local STATUS=""
533541

534542
# __add_status KIND VALEXPR INSERT

themes/Chmike.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ override_git_prompt_colors() {
1414

1515
GIT_PROMPT_THEME_NAME="Chmike"
1616
GIT_PROMPT_BRANCH="${Green}"
17+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}"
1718
GIT_PROMPT_REMOTE=" "
1819
GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="⭐"
1920

themes/Custom.bgptemplate

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ override_git_prompt_colors() {
1414
# GIT_PROMPT_SEPARATOR="|" # separates each item
1515

1616
# GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory
17+
# GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}" # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES
1718
# GIT_PROMPT_STAGED="${Red}●" # the number of staged files/directories
1819
# GIT_PROMPT_CONFLICTS="${Red}✖ " # the number of files in conflict
1920
# GIT_PROMPT_CHANGED="${Blue}✚ " # the number of changed files
@@ -53,6 +54,12 @@ override_git_prompt_colors() {
5354
# GIT_PROMPT_SYMBOLS_BEHIND="↓·" # The symbol for "n versions behind of origin"
5455
# GIT_PROMPT_SYMBOLS_PREHASH=":" # Written before hash of commit, if no name could be found
5556
# GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="L" # This symbol is written after the branch, if the branch is not tracked
57+
58+
# branch name(s) that will use $GIT_PROMPT_MASTER_BRANCH color
59+
# To specify multiple branches, use
60+
# shopt -s extglob
61+
# GIT_PROMPT_MASTER_BRANCHES='@(master|production)'
62+
# GIT_PROMPT_MASTER_BRANCHES="master"
5663
}
5764

58-
reload_git_prompt_colors "Custom"
65+
reload_git_prompt_colors "Custom"

themes/Default.bgptheme

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ define_undefined_git_prompt_colors() {
4242
if [ -z ${GIT_PROMPT_SEPARATOR+x} ]; then GIT_PROMPT_SEPARATOR="|"; fi # separates each item
4343

4444
if [ -z ${GIT_PROMPT_BRANCH+x} ]; then GIT_PROMPT_BRANCH="${Magenta}"; fi # the git branch that is active in the current directory
45+
if [ -z ${GIT_PROMPT_MASTER_BRANCH+x} ]; then GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}"; fi # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES
4546
if [ -z ${GIT_PROMPT_STAGED+x} ]; then GIT_PROMPT_STAGED="${Red}●"; fi # the number of staged files/directories
4647
if [ -z ${GIT_PROMPT_CONFLICTS+x} ]; then GIT_PROMPT_CONFLICTS="${Red}✖ "; fi # the number of files in conflict
4748
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() {
8889
if [ -z ${GIT_PROMPT_SYMBOLS_BEHIND+x} ]; then GIT_PROMPT_SYMBOLS_BEHIND="↓·"; fi # The symbol for "n versions behind of origin"
8990
if [ -z ${GIT_PROMPT_SYMBOLS_PREHASH+x} ]; then GIT_PROMPT_SYMBOLS_PREHASH=":"; fi # Written before hash of commit, if no name could be found
9091
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
92+
93+
# branch name(s) that will use $GIT_PROMPT_MASTER_BRANCH color
94+
# To specify multiple branches, use
95+
# shopt -s extglob
96+
# GIT_PROMPT_MASTER_BRANCHES='@(master|production)'
97+
if [ -z ${GIT_PROMPT_MASTER_BRANCHES+x} ]; then GIT_PROMPT_MASTER_BRANCHES="master"; fi
9198
}
9299

93100
# call only from theme file

themes/Evermeet.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ override_git_prompt_colors() {
99
GIT_PROMPT_SEPARATOR="|" # separates each item
1010

1111
GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory
12+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}" # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES
1213
GIT_PROMPT_STAGED="${Cyan}●" # the number of staged files/directories
1314
GIT_PROMPT_CONFLICTS="${BoldRed}✖" # the number of files in conflict
1415
GIT_PROMPT_CHANGED="${Cyan}✚" # the number of changed files

themes/Evermeet_Lowres.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ override_git_prompt_colors() {
1111
GIT_PROMPT_SEPARATOR="|" # separates each item
1212

1313
GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory
14+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}" # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES
1415
GIT_PROMPT_STAGED="${Cyan}●" # the number of staged files/directories
1516
GIT_PROMPT_CONFLICTS="${BoldRed}✖ " # the number of files in conflict
1617
GIT_PROMPT_CHANGED="${Cyan}✚ " # the number of changed files

themes/Evermeet_Ubuntu.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ override_git_prompt_colors() {
1111
GIT_PROMPT_SEPARATOR="|" # separates each item
1212

1313
GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory
14+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}" # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES
1415
GIT_PROMPT_STAGED="${Cyan}● " # the number of staged files/directories
1516
GIT_PROMPT_CONFLICTS="${BoldRed}✖ " # the number of files in conflict
1617
GIT_PROMPT_CHANGED="${Cyan}✚ " # the number of changed files

themes/Minimal.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ override_git_prompt_colors() {
3636

3737
Time12a="\$(date +%H:%M:%S)"
3838
GIT_PROMPT_BRANCH="${BoldMagenta}" # the git branch that is active in the current directory
39+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_MASTER_BRANCH}" # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES
3940
GIT_PROMPT_PREFIX="" # start of the git info string
4041
GIT_PROMPT_SUFFIX="" # the end of the git info string
4142
GIT_PROMPT_SEPARATOR="" # separates each item

themes/Minimal_UserHost.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ override_git_prompt_colors() {
4444
fi
4545

4646
GIT_PROMPT_BRANCH="${BoldMagenta}" # the git branch that is active in the current directory
47+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_MASTER_BRANCH}" # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES
4748
GIT_PROMPT_PREFIX="" # start of the git info string
4849
GIT_PROMPT_SUFFIX="" # the end of the git info string
4950
GIT_PROMPT_SEPARATOR="" # separates each item

themes/Single_line_Dark.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
override_git_prompt_colors() {
55
GIT_PROMPT_THEME_NAME="Single_line_nono031"
66
GIT_PROMPT_BRANCH="${Cyan}"
7+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}"
78
GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}"
89
GIT_PROMPT_CHANGED="${Yellow}✚ "
910
GIT_PROMPT_STAGED="${Magenta}●"

themes/Single_line_NoExitState_Gentoo.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
override_git_prompt_colors() {
55
GIT_PROMPT_THEME_NAME="Single_line_NoExitState_Gentoo"
66
GIT_PROMPT_BRANCH="${Cyan}"
7+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}"
78
GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}"
89
GIT_PROMPT_CHANGED="${Yellow}✚ "
910
GIT_PROMPT_STAGED="${Magenta}●"

themes/Single_line_NoExitState_openSUSE.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
override_git_prompt_colors() {
55
GIT_PROMPT_THEME_NAME="Single_line_NoExitState_openSUSE"
66
GIT_PROMPT_BRANCH="${Cyan}"
7+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}"
78
GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}"
89
GIT_PROMPT_CHANGED="${Yellow}✚ "
910
GIT_PROMPT_STAGED="${Magenta}●"

themes/Single_line_openSUSE.bgptheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
override_git_prompt_colors() {
55
GIT_PROMPT_THEME_NAME="Single_line_openSUSE"
66
GIT_PROMPT_BRANCH="${Cyan}"
7+
GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}"
78
GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}"
89
GIT_PROMPT_CHANGED="${Yellow}✚ "
910
GIT_PROMPT_STAGED="${Magenta}●"

0 commit comments

Comments
 (0)