095a01d92adf6af6d33647b61718e4ad0a4cce2b

Author
Maxime Chaisse-Leal <maxime.chaisseleal@gmail.com>
Committer
Maxime Chaisse-Leal <maxime.chaisseleal@gmail.com>
Date

Message

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 6b91b4a7246c8ae59616bad386f6af1a6bde4dba..bd11d796f28b04f1bec81be70b21923be5d01002 100644
 3--- a/plugins/git/git.plugin.zsh
 4+++ b/plugins/git/git.plugin.zsh
 5@@ -126,3 +126,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'