prepare-commit-msg hook to include potention Co-authors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Joanne Bloggs <jo@example.com> | |
Co-authored-by: John Dowe <123456+JohnDowe@users.noereply.github.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
firstLine=$(head -n1 $1) | |
mobbers="$(dirname $0)/../.mobbers" | |
exec < /dev/tty | |
awk '{printf("%d: %s\n", NR, $0)}' $mobbers | |
read -p "Select co-authors (enter to continue): " selected | |
coauthorLines=$(echo $selected | sed -Ee 's/([0-9]+)/\1p;/g') | |
exec <&- | |
if [ -z "$firstLine" ] ;then | |
echo "\n\n${coauthorLines}$(cat "$1")" > "$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This now lets you choose your co-authors before you edit your commit message.