summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-10-20 15:29:03 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-10-20 15:29:03 +0200
commitc983c6af4fc0fab858fc4968bb2b8b495a42d56a (patch)
tree06cc3f79101ea3e0d55dfef36824f9842d3a745d
parent43847ec87dde047b298b801eabe456215899e58b (diff)
downloaddotfiles-c983c6af4fc0fab858fc4968bb2b8b495a42d56a.zip
dotfiles-c983c6af4fc0fab858fc4968bb2b8b495a42d56a.tar.gz
dotfiles-c983c6af4fc0fab858fc4968bb2b8b495a42d56a.tar.xz
Bash config: tweak cmd prompt: get git silent on error conditions
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.bashrc6
1 files changed, 3 insertions, 3 deletions
diff --git a/.bashrc b/.bashrc
index 2b89ec7..d71b2a5 100644
--- a/.bashrc
+++ b/.bashrc
@@ -69,10 +69,10 @@ PS1='\[\033[01;34m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\[\033[$(
[ -n "${MC_SID}" ] && _ps_mc_char="#" \
|| { jobs | grep -q vim && _ps_mc_char="&" || _ps_mc_char="|"; }
klist -s && { _ps_lpar="("; _ps_rpar=")"; } || { _ps_lpar="["; _ps_rpar="]"; }
- git rev-parse --git-dir &>/dev/null \
+ git rev-parse --quiet --git-dir &>/dev/null \
&& { git diff-files --quiet \
- && { git diff-index --quiet --cached HEAD \
- && _ps_head=$(git rev-parse --abbrev-ref HEAD) \
+ && { git diff-index --quiet --cached HEAD 2>/dev/null \
+ && _ps_head=$(git rev-parse --quiet --abbrev-ref HEAD) \
|| _ps_head=C; } \
|| _ps_head=S; } \
|| _ps_head="$(($(dirs -p | head -n9 | wc -l) - 1))"