diff options
author | Leonid Volnitsky <Leonid@Volnitsky.com> | 2008-11-21 18:15:40 +0200 |
---|---|---|
committer | Leonid Volnitsky <Leonid@Volnitsky.com> | 2008-11-21 18:15:40 +0200 |
commit | 0a631b0bce88d8b58f3a9de9204d14c646652920 (patch) | |
tree | 6b63ae6fb5363fc8360869b5a82f52f1e75f53ee | |
parent | added test if shell is interactive (diff) | |
download | git-prompt-0a631b0bce88d8b58f3a9de9204d14c646652920.tar.gz git-prompt-0a631b0bce88d8b58f3a9de9204d14c646652920.tar.bz2 git-prompt-0a631b0bce88d8b58f3a9de9204d14c646652920.zip |
fixed: handling files with spaces
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | git-prompt.sh | 14 |
2 files changed, 11 insertions, 9 deletions
@@ -34,9 +34,11 @@ TODO - TO FIX: when file list is too long, git-prompt truncates it. Sometimes this truncation can be on color escape sequence. - external config at /etc/git-prompt.conf and ~/.git-prompt.conf - - wiki/screen-shots for labels and svn module + - new mail (howto at: http://kikhome.net/?p=11) + - ^Z subshell indicator + - wiki/screenshots for labels and svn module - VIM module needs to be moved out of GIT module - - make module (to show generated, stale files) + - make module (to show generated, stale files) - How detect current merge? (current method through .git/MERGE_HEAD not always works) DONE - limit number of files displayed diff --git a/git-prompt.sh b/git-prompt.sh index 54ef999..4aa962b 100644 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -294,19 +294,19 @@ parse_git_dir() { s/^# Initial commit/init=init/p /^# Untracked files:/,/^[^#]/{ s/^# Untracked files:/untracked=untracked;/p - s/^# \([^.]\)/untracked_files[${#untracked_files[@]}+1]=\1/p + s/^# \([^.]*\)/untracked_files[${#untracked_files[@]}+1]=\"\1\"/p } /^# Changed but not updated:/,/^# [A-Z]/ { s/^# Changed but not updated:/modified=modified;/p - s/^# modified: \([^.]\)/modified_files[${#modified_files[@]}+1]=\1/p - s/^# unmerged: \([^.]\)/modified_files[${#modified_files[@]}+1]=\1/p + s/^# modified: \([^.]*\)/modified_files[${#modified_files[@]}+1]=\"\1\"/p + 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: \([^.]\)/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 - s/^# copied:[^>]*> \([^.]\)/added_files[${#added_files[@]}+1]=\1/p + 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 + s/^# copied:[^>]*> \([^.]*\)/added_files[${#added_files[@]}+1]=\"\1\"/p } ' ` |