* Michael P. Soulier <msoulier [ at ] digitaltorque [ dot ] ca> [090703 19:50]:
> How would you make a git alias out of this?
>
> # Simulate hg's addremove command.
> git_addremove()
> {
> git add -A || return
> removed_files=$(git ls-files --deleted -z)
> if [ -n "$removed_files" ]; then
> echo "$removed_files" | xargs -0 git rm
> fi
> }
I have not tried this, but it should work...
!git add -A && removed_files=$(git ls-files --deleted -z) && echo "$removed_files" | xargs -0 git rm
My shell is zsh, and the pattern of X=$(foo) && bar does work there.
-Bart
--
WebSig: http://www.jukie.net/~bart/sig/