Commit b4edb533 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gamend: add support for commit separate files

parent 1f082bb1
...@@ -6,13 +6,20 @@ ...@@ -6,13 +6,20 @@
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "gitcam - do fast git commit amend (apply all current changes to the last commit)" echo "gitcam - do fast git commit amend (apply all current changes to the last commit)"
echo "Use: gitcam [-e]" echo "Use: gitcam [-e] [file]"
echo " -e - edit commit message" echo " -e - edit commit message"
exit 1 exit 1
fi fi
AMENDARG="-C HEAD"
if [ "$1" = "-e" ] ; then if [ "$1" = "-e" ] ; then
docmd git commit -a --amend $@ AMENDARG=
else shift
docmd git commit -a --amend -C HEAD $@
fi fi
# If no args
if [ -z "$1" ] ; then
AMENDARG="$AMENDARG -a"
fi
docmd git commit --amend $AMENDARG $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment