#!/bin/sh
# based on https://stackoverflow.com/a/21148981
set -e

if [ -z "$1" ]
then
	>&2 echo "Usage: git fixup COMMIT"
	exit 1
fi

COMMIT=$(git rev-parse "$1")
git commit --fixup="$COMMIT"
git rebase --autostash --autosquash "$COMMIT"~1
