Skip to content

Commit

Permalink
mirror: Add .mailmap to the repository, sync with kernel's
Browse files Browse the repository at this point in the history
Add a script to grep for the relevant entries in the .mailmap file of
the kernel repository, and use it to build a .mailmap file for the
mirror repo.

Signed-off-by: Quentin Monnet <[email protected]>
  • Loading branch information
qmonnet committed Apr 25, 2024
1 parent 5e1f2ea commit 744e0cd
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Changbin Du <[email protected]> <[email protected]>
Geliang Tang <[email protected]> <[email protected]>
Herbert Xu <[email protected]>
Maxim Mikityanskiy <[email protected]> <[email protected]>
Quentin Monnet <[email protected]> <[email protected]>
37 changes: 37 additions & 0 deletions scripts/mailmap-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

set -eu

usage () {
echo "USAGE: ./update-mailmap.sh <bpftool-repo> <linux-repo>"
exit 1
}

BPFTOOL_REPO=${1-""}
LINUX_REPO=${2-""}

if [ -z "${BPFTOOL_REPO}" ] || [ -z "${LINUX_REPO}" ]; then
echo "Error: bpftool or linux repos are not specified"
usage
fi

BPFTOOL_MAILMAP="${BPFTOOL_REPO}/.mailmap"
LINUX_MAILMAP="${LINUX_REPO}/.mailmap"

tmpfile="$(mktemp)"
cleanup() {
rm -f "${tmpfile}"
}
trap cleanup EXIT

grep_lines() {
local pattern="$1"
local file="$2"
grep "${pattern}" "${file}" || true
}

while read -r email; do
grep_lines "${email}$" "${LINUX_MAILMAP}" >> "${tmpfile}"
done < <(git log --format='<%ae>' | sort -u)

sort -u "${tmpfile}" > "${BPFTOOL_MAILMAP}"

0 comments on commit 744e0cd

Please sign in to comment.