File tree 5 files changed +35
-9
lines changed
5 files changed +35
-9
lines changed Original file line number Diff line number Diff line change @@ -551,13 +551,15 @@ function updatePrompt() {
551
551
}
552
552
553
553
__chk_gitvar_status ' REMOTE' ' -n'
554
- __add_status " $GIT_PROMPT_SEPARATOR "
555
- __chk_gitvar_status ' STAGED' ' -ne 0'
556
- __chk_gitvar_status ' CONFLICTS' ' -ne 0'
557
- __chk_gitvar_status ' CHANGED' ' -ne 0'
558
- __chk_gitvar_status ' UNTRACKED' ' -ne 0'
559
- __chk_gitvar_status ' STASHED' ' -ne 0'
560
- __chk_gitvar_status ' CLEAN' ' -eq 1' -
554
+ if [[ $GIT_CLEAN -eq 0 ]] || [[ $GIT_PROMPT_CLEAN != " " ]]; then
555
+ __add_status " $GIT_PROMPT_SEPARATOR "
556
+ __chk_gitvar_status ' STAGED' ' -ne 0'
557
+ __chk_gitvar_status ' CONFLICTS' ' -ne 0'
558
+ __chk_gitvar_status ' CHANGED' ' -ne 0'
559
+ __chk_gitvar_status ' UNTRACKED' ' -ne 0'
560
+ __chk_gitvar_status ' STASHED' ' -ne 0'
561
+ __chk_gitvar_status ' CLEAN' ' -eq 1' -
562
+ fi
561
563
__add_status " $ResetColor$GIT_PROMPT_SUFFIX "
562
564
563
565
NEW_PROMPT=" $( gp_add_virtualenv_to_prompt) $PROMPT_START $( $prompt_callback ) $STATUS_PREFIX$STATUS$PROMPT_END "
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ def get_stash():
89
89
if st [0 ] == '#' and st [1 ] == '#' :
90
90
if re .search ('Initial commit on' , st [2 ]):
91
91
branch = st [2 ].split (' ' )[- 1 ]
92
+ elif re .search ('No commits yet on' , st [2 ]):
93
+ branch = st [2 ].split (' ' )[- 1 ]
92
94
elif re .search ('no branch' , st [2 ]): # detached status
93
95
branch = get_tag_or_hash ()
94
96
elif len (st [2 ].strip ().split ('...' )) == 1 :
@@ -150,4 +152,3 @@ def get_stash():
150
152
Print (out .encode ('utf-8' ))
151
153
else :
152
154
Print (out )
153
-
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ if [[ "$branch" == *"Initial commit on"* ]]; then
72
72
IFS=" " read -ra fields <<< " $branch"
73
73
branch=" ${fields[3]} "
74
74
remote=" _NO_REMOTE_TRACKING_"
75
+ elif [[ " $branch " == * " No commits yet on" * ]]; then
76
+ IFS=" " read -ra fields <<< " $branch"
77
+ branch=" ${fields[4]} "
78
+ remote=" _NO_REMOTE_TRACKING_"
75
79
elif [[ " $branch " == * " no branch" * ]]; then
76
80
tag=$( git describe --tags --exact-match )
77
81
if [[ -n " $tag " ]]; then
Original file line number Diff line number Diff line change @@ -28,4 +28,4 @@ override_git_prompt_colors() {
28
28
GIT_PROMPT_COMMAND_FAIL="${Red}✘"
29
29
}
30
30
31
- reload_git_prompt_colors "Crunch "
31
+ reload_git_prompt_colors "Chmike "
Original file line number Diff line number Diff line change
1
+ # This is a theme for gitprompt.sh,
2
+ # it uses the default Gentoo bash prompt style.
3
+
4
+ override_git_prompt_colors() {
5
+ GIT_PROMPT_THEME_NAME="Single_line_NoExitState_Gentoo"
6
+ GIT_PROMPT_BRANCH="${Cyan}"
7
+ GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}"
8
+ GIT_PROMPT_CHANGED="${Yellow}✚ "
9
+ GIT_PROMPT_STAGED="${Magenta}●"
10
+
11
+ GIT_PROMPT_START_USER="${BoldGreen}\u@\h ${BrightBlue}\w${ResetColor}"
12
+ GIT_PROMPT_START_ROOT="${BoldRed}\h ${BrightBlue}\w${ResetColor}"
13
+
14
+ GIT_PROMPT_END_USER="${BrightBlue} \$ ${ResetColor}"
15
+ GIT_PROMPT_END_ROOT="${BrightBlue} \$ ${ResetColor}"
16
+ }
17
+
18
+ reload_git_prompt_colors "Single_line_NoExitState_Gentoo"
19
+
You can’t perform that action at this time.
0 commit comments