Skip to content

Commit 5000ce8

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents bbad168 + 2e617b0 commit 5000ce8

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

gitprompt.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,15 @@ function updatePrompt() {
551551
}
552552

553553
__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
561563
__add_status "$ResetColor$GIT_PROMPT_SUFFIX"
562564

563565
NEW_PROMPT="$(gp_add_virtualenv_to_prompt)$PROMPT_START$($prompt_callback)$STATUS_PREFIX$STATUS$PROMPT_END"

gitstatus.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def get_stash():
8989
if st[0] == '#' and st[1] == '#':
9090
if re.search('Initial commit on', st[2]):
9191
branch = st[2].split(' ')[-1]
92+
elif re.search('No commits yet on', st[2]):
93+
branch = st[2].split(' ')[-1]
9294
elif re.search('no branch', st[2]): # detached status
9395
branch = get_tag_or_hash()
9496
elif len(st[2].strip().split('...')) == 1:
@@ -150,4 +152,3 @@ def get_stash():
150152
Print(out.encode('utf-8'))
151153
else:
152154
Print(out)
153-

gitstatus.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ if [[ "$branch" == *"Initial commit on"* ]]; then
7272
IFS=" " read -ra fields <<< "$branch"
7373
branch="${fields[3]}"
7474
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_"
7579
elif [[ "$branch" == *"no branch"* ]]; then
7680
tag=$( git describe --tags --exact-match )
7781
if [[ -n "$tag" ]]; then

themes/Chmike.bgptheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ override_git_prompt_colors() {
2828
GIT_PROMPT_COMMAND_FAIL="${Red}✘"
2929
}
3030

31-
reload_git_prompt_colors "Crunch"
31+
reload_git_prompt_colors "Chmike"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+

0 commit comments

Comments
 (0)