From 69e1021960ab784490d1f7a85f3107c51db2d9de Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Sat, 14 Jun 2008 17:39:10 +0300 Subject: branch name now extracted from "git status" --- prompt | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'prompt') diff --git a/prompt b/prompt index 9e1472c..777f98a 100755 --- a/prompt +++ b/prompt @@ -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 -- cgit v1.2.3