Skip to content

Commit ba1ef77

Browse files
committed
Merge branch 'simple'
2 parents 8d895c8 + e04dba5 commit ba1ef77

File tree

4 files changed

+5
-52
lines changed

4 files changed

+5
-52
lines changed

bashrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ _ret_prompt() {
5656
}
5757

5858
_ret_same() { return $?; }
59-
. /etc/bashrc_repo &>/dev/null || alias _repo_status='_ret_same' # Fallback
59+
. /etc/bashrc_repo &>/dev/null || alias _git_branch='_ret_same' # Fallback
6060
# To be shipped together. See comments in bashrc_repo on _ret and _ret_status().
6161

6262
# Use "\w" if you want the script to display full path
6363
# How about using cut to "\w($PWD)" to give path of a certain depth?
6464
# Well, forget it.
6565
if [[ $EUID == 0 ]] ; then
66-
PS1="$RED\u $NORMAL[ \W\$(_repo_status) ]$RED \$(_ret_prompt) $NORMAL"
66+
PS1="$RED\u $NORMAL[ \W\$(_git_branch) ]$RED \$(_ret_prompt) $NORMAL"
6767
else
68-
PS1="$GREEN\u $NORMAL[ \W\$(_repo_status) ]$GREEN \$(_ret_prompt) $NORMAL"
68+
PS1="$GREEN\u $NORMAL[ \W\$(_git_branch) ]$GREEN \$(_ret_prompt) $NORMAL"
6969
fi
7070

7171
# Extra Aliases for those lazy ones :)

bashrc_git

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@ alias __git_branch="git branch 2>/dev/null | grep '*' | sed 's/*\ //g'"
3434
# From http://mediadoneright.com/content/ultimate-git-ps1-bash-prompt
3535
# Modified.
3636
_git_branch() {
37+
_ret=$?
3738
if (git branch &>/dev/null)
3839
then if (LANG=C git status | grep "nothing to commit" &>/dev/null)
3940
then printf "\e[1m@\e[0;32m$(__git_branch)\e[0m"
4041
elif (LANG=C git status | grep "nothing added to commit" &>/dev/null) # Untracked
4142
then printf "\e[1m@\e[0;35m$(__git_branch)\e[0m"
4243
else printf "\e[1m@$IRED$(__git_branch)\e[0m" # Change not added/not merged yet
4344
fi
44-
else false # Necessary, read bashrc_repo.
4545
fi
46+
return $_ret
4647
}
4748

4849

bashrc_hg

Lines changed: 0 additions & 29 deletions
This file was deleted.

bashrc_repo

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)