summaryrefslogtreecommitdiff
path: root/git-prompt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-prompt.sh')
-rwxr-xr-xgit-prompt.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/git-prompt.sh b/git-prompt.sh
index 094424c..9ba0b35 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -7,7 +7,8 @@
##### read config file if any.
- unset dir_color rc_color root_id_color init_vcs_color clean_vcs_color modified_vcs_color added_vcs_color mixed_vcs_color untracked_vcs_color op_vcs_color detached_vcs_color
+ unset dir_color rc_color root_id_color init_vcs_color clean_vcs_color
+ unset modified_vcs_color added_vcs_color mixed_vcs_color untracked_vcs_color op_vcs_color detached_vcs_color
conf=git-prompt.conf; [[ -r $conf ]] && . $conf
conf=/etc/git-prompt.conf; [[ -r $conf ]] && . $conf
@@ -55,7 +56,7 @@
##################################################################### post config
################# make PARSE_VCS_STATUS
-
+ 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"
@@ -345,12 +346,20 @@ parse_git_status() {
/^# Changed but not updated:/,/^# [A-Z]/ {
s/^# Changed but not updated:/modified=modified;/p
+ s/^# modified: \.\./: SKIP/
s/^# modified: \(.*\)/modified_files[${#modified_files[@]}+1]=\"\1\"/p
+ s/^# unmerged: \.\./: SKIP/
s/^# unmerged: \(.*\)/modified_files[${#modified_files[@]}+1]=\"\1\"/p
}
/^# Changes to be committed:/,/^# [A-Z]/ {
s/^# Changes to be committed:/added=added;/p
+
+ s/^# modified: \.\./: SKIP/
+ s/^# new file: \.\./: SKIP/
+ s/^# renamed:[^>]*> \.\./: SKIP/
+ s/^# copied:[^>]*> \.\./: SKIP/
+
s/^# modified: \(.*\)/added_files[${#added_files[@]}+1]=\"\1\"/p
s/^# new file: \(.*\)/added_files[${#added_files[@]}+1]=\"\1\"/p
s/^# renamed:[^>]*> \(.*\)/added_files[${#added_files[@]}+1]=\"\1\"/p