Skip to content

Instantly share code, notes, and snippets.

@iperdomo
Last active May 13, 2021 09:06
Show Gist options
  • Save iperdomo/010ea1264a486d3fef978d1f379295ba to your computer and use it in GitHub Desktop.
Save iperdomo/010ea1264a486d3fef978d1f379295ba to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Usage: co-authored-by <name> <name-2> <name-3> ...
# Example: co-authored-by dan juan valeria
set -eu
declare -a authors
for a in "$@"; do
authors+=("$(printf '%s' "--author=${a}")")
done
git log "${authors[@]}" | awk '/^Author:/ && !seen[$2]++ {print}' | sed 's/Author:/Co-authored-by:/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment