Skip to content

Commit 71f4af9

Browse files
committed
vcs: fixed conflict with git-completion
1 parent 98ece1d commit 71f4af9

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

autobuild/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rm autobuild/conffiles
88
# HACK: generate conffiles
99
cd abdist
1010
IFS=$'\n'
11-
for i in $(find .); do
11+
for i in $(find . -type f); do
1212
echo "${i/.\/}" >> autobuild/conffiles
1313
done
1414
IFS=$' \t\n'

bashrc.d/.vcs_git

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,17 @@ alias __git_branch="git branch 2>/dev/null | grep '*' | sed 's/*\ //g'"
3030

3131
# From http://mediadoneright.com/content/ultimate-git-ps1-bash-prompt
3232
# Modified.
33-
_git_branch() {
34-
if git branch &>/dev/null
35-
then if LANG=C git status | grep "nothing to commit" &>/dev/null
36-
then printf "\e[1m@\e[0;32m$(__git_branch)\e[0m"
37-
elif LANG=C git status | grep "nothing added to commit" &>/dev/null # Untracked
38-
then printf "\e[1m@\e[0;35m$(__git_branch)\e[0m"
39-
else printf "\e[1m@$IRED$(__git_branch)\e[0m" # Change not added/not merged yet
40-
fi
41-
else false # Necessary, read bashrc_repo.
42-
fi
33+
_git_status() {
34+
git branch &>/dev/null || return 1
35+
if LANG=C git status | grep -q "nothing to commit"; then
36+
printf "\e[1m@\e[0;32m$(__git_branch)\e[0m"
37+
elif LANG=C git status | grep -q "nothing added to commit"; then # Untracked
38+
printf "\e[1m@\e[0;35m$(__git_branch)\e[0m"
39+
else # Change not added/not merged yet
40+
printf "\e[1m@$IRED$(__git_branch)\e[0m"
41+
fi
4342
}
4443

4544

4645
# A shorter one without color
47-
# alias _git_branch="echo \" \$(__git_branch)\""
46+
# alias _git_status='_st="$(__git_branch)"; ((!PIPESTATUS[0])) && echo "@$_st"'

bashrc.d/.vcs_hg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ alias ha='hg add .'
1515

1616
# From http://mediadoneright.com/content/ultimate-hg-ps1-bash-prompt
1717
# Modified for hg.
18-
_hg_branch() {
18+
_hg_status() {
1919
if hg branch &>/dev/null
2020
then if LANG=C hg status | grep " " &>/dev/null
2121
then printf "\e[1m@\e[0;32m$(hg branch)\e[0m"
@@ -26,4 +26,4 @@ _hg_branch() {
2626
}
2727

2828
# A shorter one without color
29-
# alias _hg_branch="echo \" \$(hg branch 2>/dev/null)\""
29+
# alias _hg_status='_st="$(hg branch)" && echo "@$st"'

bashrc.d/20-vcs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _vcs_status() {
2626
_ret=$?
2727
local _vcs
2828
for _vcs in $_vcs_mods; do
29-
_"$_vcs"_branch && break
29+
_"$_vcs"_status && break
3030
done
3131
return $_ret
3232
}

0 commit comments

Comments
 (0)