diff options
author | Leonid Volnitsky <Leonid@Volnitsky.com> | 2008-06-14 17:39:10 +0300 |
---|---|---|
committer | Leonid Volnitsky <Leonid@Volnitsky.com> | 2008-06-14 17:39:10 +0300 |
commit | 69e1021960ab784490d1f7a85f3107c51db2d9de (patch) | |
tree | dc986cf3f3ec02f5cb11caa6d6c3a1aab32fdbfc | |
parent | Merge branch 'git' (diff) | |
download | git-prompt-69e1021960ab784490d1f7a85f3107c51db2d9de.tar.gz git-prompt-69e1021960ab784490d1f7a85f3107c51db2d9de.tar.bz2 git-prompt-69e1021960ab784490d1f7a85f3107c51db2d9de.zip |
branch name now extracted from "git status"
-rwxr-xr-x | prompt | 23 |
1 files changed, 9 insertions, 14 deletions
@@ -229,25 +229,20 @@ PROMPT_COMMAND=' # GIT if [[ -d .git || -d ../.git || -d ../../.git ]]; then - ### branch - branch=`git branch -a |sed -n "s/^* //p"` - - ### state + ### 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: - status_msg=`git status` - status=` - git status | - sed -n -e " - s/nothing to commit (working directory clean)/clean/p - s/^# Untracked files:/untracked/p - s/^# Changed but not updated:/modified/p - s/^# Changes to be committed:/added/p - " | - head -1 + eval `git status | + sed -n " + s/^# On branch /branch=/p + s/^nothing to commit (working directory clean)/status=clean/p + s/^# Untracked files:/status=untracked/p + s/^# Changed but not updated:/status=modified/p + s/^# Changes to be committed:/status=added/p + " ` ### compose local label |