summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2009-08-21 13:13:26 +0300
committerLeonid Volnitsky <Leonid@Volnitsky.com>2009-08-24 16:19:18 +0300
commit14d3cd870bce54d3049afaafa853fc252d804160 (patch)
tree847543a93024627dab7d90a2ae0a6b7c9e6490df
parentfixed: svn status can have non-space 2nd and 3rd columns (diff)
downloadgit-prompt-14d3cd870bce54d3049afaafa853fc252d804160.tar.gz
git-prompt-14d3cd870bce54d3049afaafa853fc252d804160.tar.bz2
git-prompt-14d3cd870bce54d3049afaafa853fc252d804160.zip
added vcs_dir_ignore_list
-rw-r--r--git-prompt.conf7
-rwxr-xr-xgit-prompt.sh13
2 files changed, 14 insertions, 6 deletions
diff --git a/git-prompt.conf b/git-prompt.conf
index 503ba94..33cef6e 100644
--- a/git-prompt.conf
+++ b/git-prompt.conf
@@ -34,7 +34,12 @@
########################################################### ETC
-# upcase_hostname=on # =off
+# Some don't like hostname in uppercase
+# upcase_hostname=on # =off
+
+# Do not do VCS parsing for listed directories
+# usefull if directories are almost always dirty (home, /etc) or too big (linux src)
+## vcs_ignore_dir_list=" /etc $HOME /usr/src/git-linux "
########################################################### COLOR
diff --git a/git-prompt.sh b/git-prompt.sh
index 79890bc..8caff00 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -52,8 +52,8 @@
##################################################################### post config
################# make PARSE_VCS_STATUS
- PARSE_VCS_STATUS=""
- [[ $git_module = "on" ]] && type git >&/dev/null && PARSE_VCS_STATUS="parse_git_status"
+ unset PARSE_VCS_STATUS
+ [[ $git_module = "on" ]] && type git >&/dev/null && PARSE_VCS_STATUS+="parse_git_status"
[[ $svn_module = "on" ]] && type svn >&/dev/null && PARSE_VCS_STATUS+="||parse_svn_status"
[[ $hg_module = "on" ]] && type hg >&/dev/null && PARSE_VCS_STATUS+="||parse_hg_status"
PARSE_VCS_STATUS+="||return"
@@ -270,9 +270,11 @@ set_shell_label() {
### we don't display home host/domain $SSH_* set by SSHD or keychain
# How to find out if session is local or remote? Working with "su -", ssh-agent, and so on ?
+
## is sshd our parent?
# if { for ((pid=$$; $pid != 1 ; pid=`ps h -o pid --ppid $pid`)); do ps h -o command -p $pid; done | grep -q sshd && echo == REMOTE ==; }
#then
+
host=${HOSTNAME}
#host=`hostname --short`
host=${host#$default_host}
@@ -291,8 +293,7 @@ set_shell_label() {
host_color=${!host_color}
- # we already should have short host name, but just in case
- host=${host%.$localdomain}
+ # we might already have short host name
host=${host%.$default_domain}
@@ -506,7 +507,9 @@ parse_vcs_status() {
unset status modified untracked added init detached
unset file_list modified_files untracked_files added_files
- eval '[[ $HOME != $PWD ]]&&' $PARSE_VCS_STATUS
+ [[ $vcs_ignore_dir_list =~ $PWD ]] && return
+
+ eval $PARSE_VCS_STATUS
### status: choose primary (for branch color)