#!/usr/bin/env bash
## Adds authorship info to interactive git rebase output.
## Source: git-extra-commands

# Author: Mislav Marohnić
# https://github.com/mislav/dotfiles
#
# rebase-authors adds authorship info to interactive git rebase output

set -e

# shellcheck disable=SC2162,SC2034
while read action sha other; do
  if [ -n "$action" ]; then
    echo -n "$action "
    git show "$sha" --format="%h [%an] %s" -s
  else
    echo
  fi
done
