WIP Git Commit Shortcut
I was wrong; I thought I figured out the Git script I used the most everyday. Turns out, it is this:
w
It has a variation:
w 'Some commit message'
Running w
alone uses WIP
as the default commit message.
I wrote it as a fish shell function, but it should be easy to convert to a shell script:
#w and ww are the same. Except the latter has a '-n' option
function w
#set --local staged (gs | cut -c1 | ag -v "\?" | string collect | string trim)
set --local staged (git status -s | grep "^[MADRCU]" | string collect | string trim)
if test -n "$staged"
#echo "something staged"
else
#echo "nothing staged"
git add .
end
if not string length -q -- "$argv"
gc -m 'WIP'
else
gc -m "$argv"
end
end