hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 4a5771e0a935f4183859dd75dde6ad4e17625412
parent 73cd71026c8a65de21092e9d4168885dda413d1a
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat,  3 Jun 2023 21:44:02 -0400

contributors.sh: read Co-authored-by

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mcontrib/contributors.sh | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/contrib/contributors.sh b/contrib/contributors.sh @@ -1,6 +1,7 @@ #!/bin/sh -eu authors= +commits= while true; do files=${1:-.} @@ -13,6 +14,11 @@ while true; do # Format as: Author Name <test@example.com> while read -r line; do + if printf '%s' "$line" | grep -qE '^[0-9a-f]{40} \d+ \d+ \d+$'; then + commits=$(printf '%s\n%s' "$commits" \ + "$(printf '%s' "$line" | cut -d' ' -f1)") + continue + fi case "$line" in "author "*) author=$(printf '%s' "$line" | sed 's/author //') ;; "author-mail "*) mail=$(printf '%s' "$line" | sed 's/author-mail //') ;; @@ -30,5 +36,12 @@ EOF shift 1 done +# Get co-authors of commits +for commit in $(printf '%s' "$commits" | sort -u); do + coauthors=$(git show "$commit" | grep '^ Co-authored-by:' \ + | sed 's/ Co-authored-by: *//g') + authors=$(printf '%s\n%s' "$authors" "$coauthors") +done + # Get only the unique author names printf '%s\n' "$authors" | tail -n+2 | sort -u