12345678910111213141516#!/bin/shset -eHASH=`git show $1 --pretty=format:"%H" -q`shiftgit commit -m "fixup! $HASH" $*[ -n "$(git diff-files)" ] && git stash && DIRTY=1git rebase $HASH^^ -i --autosquash[ -n "$DIRTY" ] && git stash pop