3 if [ "$#" -lt 1 ]; then
4 printf 'Usage: %s <commit range>\n' "$0" 1>&2
8 commits=$(git rev-list --no-merges "$@")
9 if [ -z "$commits" ]; then
14 declare -a author_missing committer_missing
18 if [ "$#" -eq 1 ]; then
29 if [ "$#" -gt 1 ]; then
34 printf 'Commit%s\n\n' "$s"
35 git log --no-walk --pretty='format: %h ("%s")' "$@"
36 printf '\n%s missing a Signed-off-by from %s %s%s.\n\n' \
37 "$is" "$its" "$t" "$s"
41 ae=$(git log -1 --format='<%ae>%n<%aE>%n %an %n %aN ' "$c" | sort -u)
42 ce=$(git log -1 --format='<%ce>%n<%cE>%n %cn %n %cN ' "$c" | sort -u)
43 sob=$(git log -1 --format='%b' "$c" |
44 sed -En 's/^\s*Signed-off-by:?\s*/ /ip')
46 if ! grep -i -F -q "$ae" <<<"$sob"; then
47 author_missing+=("$c")
49 if ! grep -i -F -q "$ce" <<<"$sob"; then
50 committer_missing+=("$c")
54 print_commits 'author' "${author_missing[@]}"
55 print_commits 'committer' "${committer_missing[@]}"