a712579a2a77dfc6a7a3fe258141e652b42765fb

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #2099 from mchaisse/master

Added WIP (work in progress) feature to git.plugin

Diff

 1diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
 2index aad7761897f24a271707535f749bcff388c8bdf2..bcb32384b09c4320d717b6b87e8977a01d35bf1f 100644
 3--- a/plugins/git/git.plugin.zsh
 4+++ b/plugins/git/git.plugin.zsh
 5@@ -129,3 +129,17 @@ function _git_log_prettily(){
 6 }
 7 alias glp="_git_log_prettily"
 8 compdef _git glp=git-log
 9+
10+# Work In Progress (wip)
11+# These features allow to pause a branch development and switch to another one (wip)
12+# When you want to go back to work, just unwip it
13+#
14+# This function return a warning if the current branch is a wip
15+function work_in_progress() {
16+  if $(git log -n 1 | grep -q -c wip); then
17+    echo "WIP!!"
18+  fi
19+}
20+# these alias commit and uncomit wip branches
21+alias gwip='git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m "wip"'
22+alias gunwip='git log -n 1 | grep -q -c wip && git reset HEAD~1'
23diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
24index 3eac14867e68cfbcc965a58b0f1978d2a7094f5b..d624e3afcaaa1c7942a8b2b44ae35650efcb4e81 100644
25--- a/themes/gallois.zsh-theme
26+++ b/themes/gallois.zsh-theme
27@@ -7,12 +7,12 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""
28 git_custom_status() {
29   local cb=$(current_branch)
30   if [ -n "$cb" ]; then
31-    echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
32+    echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
33   fi
34 }
35 
36 #RVM and git settings
37-if [[ -s ~/.rvm/scripts/rvm ]] ; then 
38+if [[ -s ~/.rvm/scripts/rvm ]] ; then
39   RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
40 else
41   if which rbenv &> /dev/null; then