github.com/moby/docker@v26.1.3+incompatible/contrib/gitdm/generate_aliases.sh (about) 1 #!/usr/bin/env bash 2 3 # 4 # This script generates a gitdm compatible email aliases file from a git 5 # formatted .mailmap file. 6 # 7 # Usage: 8 # $> ./generate_aliases <mailmap_file> > aliases 9 # 10 11 cat $1 \ 12 | grep -v '^#' \ 13 | sed 's/^[^<]*<\([^>]*\)>/\1/' \ 14 | grep '<.*>' | sed -e 's/[<>]/ /g' \ 15 | awk '{if ($3 != "") { print $3" "$1 } else {print $2" "$1}}' \ 16 | sort | uniq