parent
41b49397d1
commit
0ba5c846c2
6
bashrc
6
bashrc
@ -2,12 +2,12 @@
|
|||||||
# Get ourselves a nice prompt
|
# Get ourselves a nice prompt
|
||||||
ks() { s="$?" ; $* ; return "$s" ; }
|
ks() { s="$?" ; $* ; return "$s" ; }
|
||||||
prompt_gbranch() { git branch | sed -n 's/^\* (*\(.* \)*\([^ )]*\))*$/\2/p' ; }
|
prompt_gbranch() { git branch | sed -n 's/^\* (*\(.* \)*\([^ )]*\))*$/\2/p' ; }
|
||||||
prompt_gbehind() { git rev-list --left-only --count @{upstream}...HEAD | sed -n 's/[^0].*/⇃&/p' ; }
|
prompt_gbehind() { git status --branch --porcelain=2 | sed -n 's/^# branch\.ab.*-\([^0].*\)$/⇃\1/p' ; }
|
||||||
prompt_gbefore() { git rev-list --right-only --count @{upstream}...HEAD | sed -n 's/[^0].*/↿&/p' ; }
|
prompt_gbefore() { git status --branch --porcelain=2 | sed -n 's/^# branch\.ab +\([^0].*\) .*$/↿\1/p' ; }
|
||||||
prompt_gstatus() { git status --porcelain | sed 's/\(..\).*/\1/' | cat <(echo OK) - | tail -1 ; }
|
prompt_gstatus() { git status --porcelain | sed 's/\(..\).*/\1/' | cat <(echo OK) - | tail -1 ; }
|
||||||
prompt_git() {
|
prompt_git() {
|
||||||
if git status 2>/dev/null 1>&2; then
|
if git status 2>/dev/null 1>&2; then
|
||||||
echo " ($(prompt_gbranch)$(prompt_gbehind)$(prompt_gbefore) $(prompt_gstatus))"
|
echo " ($(prompt_gbranch)$(prompt_gbehind)$(prompt_gbefore)|$(prompt_gstatus))"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
prompt_pwd() {
|
prompt_pwd() {
|
||||||
|
Loading…
Reference in New Issue
Block a user