#!/bin/sh -e
# SPDX-License-Identifier: WTFPL
# shellcheck enable=

if [ $# -ne 2 ]
then
	cat >&2 <<- EOF
		usage: $0 <NAME> <EMAIL>

		Amends the last commit and change both author and committer names to
		NAME and emails to EMAIL. Does not touch the author timestamp.
	EOF
	exit 64  # EX_USAGE
fi

# don't use --reset-author or it will modify the author timestamp
git -c "user.name=$1" -c "user.email=$2" commit --amend --author="$1 <$2>" --no-edit --only
