Add counter for removed files to bash git prompt
This commit is contained in:
parent
90dfa6fc12
commit
e5e62e6044
1 changed files with 5 additions and 1 deletions
6
bashrc
6
bashrc
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
alias hello='echo "Hello :)"'
|
alias hello='echo "Hello :)"'
|
||||||
alias rmd='rm --recursive'
|
alias rmd='rm --recursive'
|
||||||
alias temp='watch -t -d -n 1 sensors -A coretemp-isa-0000'
|
alias temp='watch -t -d -n 1 sensors -A coretemp-isa-0000'
|
||||||
|
@ -40,6 +39,7 @@ git__prompt () {
|
||||||
modif=`git status --short 2>/dev/null | grep -Po '^\s*M' | wc -l`
|
modif=`git status --short 2>/dev/null | grep -Po '^\s*M' | wc -l`
|
||||||
untracked=`git status --short 2>/dev/null | grep -Po '^\?\?' | wc -l`
|
untracked=`git status --short 2>/dev/null | grep -Po '^\?\?' | wc -l`
|
||||||
added=`git status --short 2>/dev/null | grep -Po '^\s*A' | wc -l`
|
added=`git status --short 2>/dev/null | grep -Po '^\s*A' | wc -l`
|
||||||
|
deleted=`git status --short 2>/dev/null | grep -Po '^\s*D' | wc -l`
|
||||||
stat=`git branch -vv | grep -P '^\*' | grep -Po '\[.*\]'`
|
stat=`git branch -vv | grep -P '^\*' | grep -Po '\[.*\]'`
|
||||||
ahead=`echo $stat | grep -Po '(?<=ahead )\d*'`
|
ahead=`echo $stat | grep -Po '(?<=ahead )\d*'`
|
||||||
behind=`echo $stat | grep -Po '(?<=behind )\d*'`
|
behind=`echo $stat | grep -Po '(?<=behind )\d*'`
|
||||||
|
@ -70,6 +70,10 @@ git__prompt () {
|
||||||
then
|
then
|
||||||
echo -ne "${green}+$added"
|
echo -ne "${green}+$added"
|
||||||
fi
|
fi
|
||||||
|
if [ $deleted -ne 0 ]
|
||||||
|
then
|
||||||
|
echo -ne "${red}-$deleted"
|
||||||
|
fi
|
||||||
if [ $untracked -ne 0 ]
|
if [ $untracked -ne 0 ]
|
||||||
then
|
then
|
||||||
echo -ne "${red}*"
|
echo -ne "${red}*"
|
||||||
|
|
Loading…
Reference in a new issue