diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index f2dfd6256..325b65ee4 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -155,8 +155,12 @@ function work_in_progress() { echo "WIP!!" fi } -# these alias commit and uncomit wip branches -alias gwip='git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"' + +# these aliases commit and uncommit wip branches +# first though, check xargs flavor for -r flag +echo | xargs -r &>/dev/null && XARGS_OPTS="-r" +alias gwip="git add -A; git ls-files --deleted -z | xargs ${XARGS_OPTS} -0 git rm; git commit -m \"--wip--\"" +unset XARGS_OPTS alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1' # these alias ignore changes to file