#!/usr/bin/env bash commit="$(git log -n 100 --pretty=format:'%h %s' --no-merges | fzf | cut -c -7)" if test -z "${commit}"; then echo "fixup aborted!" exit 1 fi if [[ "${commit}" = "$(git rev-parse HEAD | head -c 7)" ]]; then exec git commit --amend "$@" else exec git commit --fixup="${commit}" "$@" fi