diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2008-05-24 12:02:06 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2008-05-24 12:02:06 +0200 |
commit | 6d127fd3274dcd551e175a9c0440f80aebcb2fc2 (patch) | |
tree | 407e5d13acc9c5977a204c621625f48a5a6dc384 /01_Functions.zsh | |
parent | e2f9a952558aea3a37296f45dc911f109342748a (diff) | |
parent | bb76357c72d67b5eab803fccce27617d178f7ed3 (diff) |
Merge branch 'master' of ssh://ssh.hiegel.fr/work/repos/zdotdir
Conflicts:
host:prunelle/Aliases.zsh
host:prunelle/Environment.zsh
host:prunelle/README
net:ordener.fr
net:ordener.fr/host:prunelle/Aliases.zsh
net:ordener.fr/host:prunelle/Environment.zsh
net:ordener.fr/host:prunelle/README
net:sweethome/host:prunelle/Aliases.zsh
net:sweethome/host:prunelle/Environment.zsh
net:sweethome/host:prunelle/README
user:hugues/KeyBindings.zsh
Diffstat (limited to '01_Functions.zsh')
-rw-r--r-- | 01_Functions.zsh | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh index 3d1221d..d4c77bf 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -29,7 +29,7 @@ term_title() sun-cmd) print -Pn "\e]l%n@%m %~$1\e\\" # Never tested.. ;; - *term*|rxvt*) + *term*|rxvt*|putty) print -Pn "\e]0;%n@%m (%l) %~$1\a" # Sets term title ;; screen) @@ -83,14 +83,25 @@ get_git_branch () # a call to `get_git_branch` get_git_status () { - local my_git_status + local my_git_status cached not_up_to_date managment_folder - if [ "$(git-rev-parse --git-dir)" == "." ] - then - my_git_status="$git_colors[managment_folder]" - elif [ "$(git-diff --cached 2>&- | grep '^diff ')" != "" ] ; then + if [ "$(git-rev-parse --git-dir)" == "." ] ; then + echo "$git_colors[managment_folder]" + return + fi + + if [ "$(git-diff --cached 2>&- | grep '^diff ')" != "" ] ; then + cached="yes" + fi + if [ "$(git-ls-files -m 2>&-)" != "" ] ; then + not_up_to_date="yes" + fi + + if [ "$cached" != "" -a "$not_up_to_date" != "" ] ; then + my_git_status="$git_colors[cached_and_not_up_to_date]" + elif [ "$cached" != "" ] ; then my_git_status="$git_colors[cached]" - elif [ "$(git-ls-files -m 2>&-)" != "" ] ; then + elif [ "$not_up_to_date" != "" ] ; then my_git_status="$git_colors[not_up_to_date]" else my_git_status="$git_colors[up_to_date]" |