github.com/imran-kn/cilium-fork@v1.6.9/contrib/scripts/extract_authors.sh (about)

     1  #!/bin/bash
     2  
     3  function extract_authors() {
     4  	authors=$(git shortlog --summary | awk '{$1=""; print $0}' | sed -e 's/^ //')
     5  	IFS=$'\n'
     6  	pad=$(printf '%0.1s' " "{1..60})
     7  	padlen=40
     8  	for i in $authors; do
     9  		name=$(git log --use-mailmap --author="$i" --format="%aN" | head -1)
    10  		mail=$(git log --use-mailmap --author="$i" --format="%aE" | head -1)
    11  		printf '%s' "$name"
    12  		printf '%*.*s' 0 $((padlen - ${#name})) "$pad"
    13  		printf '%s\n' "$mail"
    14  	done
    15  }
    16  
    17  extract_authors | uniq | sort