moby/contrib/gitdm/generate_aliases.sh
Arnaud Porterie bf6d52bba1 Add gitdm configuration
Update .mailmap and add gitdm configuration.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2016-05-28 21:08:20 -07:00

16 lines
376 B
Bash
Executable file

#!/bin/bash
#
# This script generates a gitdm compatible email aliases file from a git
# formatted .mailmap file.
#
# Usage:
# $> ./generate_aliases <mailmap_file> > aliases
#
cat $1 | \
grep -v '^#' | \
sed 's/^[^<]*<\([^>]*\)>/\1/' | \
grep '<.*>' | sed -e 's/[<>]/ /g' | \
awk '{if ($3 != "") { print $3" "$1 } else {print $2" "$1}}' | \
sort | uniq