summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2008-06-15 11:21:46 +0300
committerLeonid Volnitsky <Leonid@Volnitsky.com>2008-06-15 11:21:46 +0300
commit64664a721a0094a3cde406862ea0a53988171b45 (patch)
tree2e11555f07b5a7e0c7fb63bf21a91e11a3713b74
parentcommented out code for remote session detection (diff)
downloadgit-prompt-64664a721a0094a3cde406862ea0a53988171b45.tar.gz
git-prompt-64664a721a0094a3cde406862ea0a53988171b45.tar.bz2
git-prompt-64664a721a0094a3cde406862ea0a53988171b45.zip
eval-s are replaced with modern ${!....}, (some $ bugs probably are fixed)
-rwxr-xr-xprompt26
1 files changed, 10 insertions, 16 deletions
diff --git a/prompt b/prompt
index 092e18e..14dd047 100755
--- a/prompt
+++ b/prompt
@@ -78,12 +78,12 @@
# replace symbolic colors names to raw treminfo strings
- eval git_modified="\$$git_modified"
- eval git_untracked="\$$git_untracked"
- eval git_clean="\$$git_clean"
- eval git_added="\$$git_added"
- eval git_op="\$$git_op"
- eval git_mixed="\$$git_mixed"
+ git_modified=${!git_modified}
+ git_untracked=${!git_untracked}
+ git_clean=${!git_clean}
+ git_added=${!git_added}
+ git_op=${!git_op}
+ git_mixed=${!git_mixed}
#####################################################################
LC_ALL=C
@@ -162,9 +162,9 @@ export -f set_shell_title
esac
- eval dir_color="\$$dir_color"
- eval rc_color="\$$rc_color"
- eval root_id_color="\$$root_id_color"
+ dir_color=${!dir_color}
+ rc_color=${!rc_color}
+ root_id_color=${!root_id_color}
########################################################### HOST
@@ -248,12 +248,6 @@ PROMPT_COMMAND='
git_dir=`git-rev-parse --git-dir 2> /dev/null`
if [[ $git_dir ]]; then
- ### status
- # clean(blue) nothing to commit (working directory clean)
- # modified(red) # Changed but not updated:
- # added(green) # Changes to be committed:
- # untracked(yellow) # Untracked files:
-
eval `git status |
sed -n "
s/^# On branch /branch=/p
@@ -321,7 +315,7 @@ PROMPT_COMMAND='
status=${status:-$untracked}
# at least one should be set
: ${status?prompt internal error: git status}
- eval git_color="\${git_$status}"
+ eval git_color=\${git_$status}
git_color=${git_color:-$WHITE}
### head