Skip to content

Commit 30dcc26

Browse files
committed
feat: support the mailmap file in mkreleasenotes
This will use either the mailmap file in the current repo, or the mailmap file in the target repo, when generating the contributor stats.
1 parent 7c56366 commit 30dcc26

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

bin/mkreleaselog

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,22 @@ AUTHORS=(
3333

3434
NL=$'\n'
3535

36+
ROOT_DIR="$(git rev-parse --show-toplevel)"
37+
3638
msg() {
3739
echo "$*" >&2
3840
}
3941

4042
statlog() {
41-
rpath="$GOPATH/src/$1"
42-
start="${2:-}"
43-
end="${3:-HEAD}"
44-
git -C "$rpath" log --shortstat --no-merges --pretty="tformat:%H%n%aN%n%aE" "$start..$end" | while
43+
local rpath="$GOPATH/src/$1"
44+
local start="${2:-}"
45+
local end="${3:-HEAD}"
46+
local mailmap_file="$rpath/.mailmap"
47+
if ! [[ -e "$mailmap_file" ]]; then
48+
mailmap_file="$ROOT_DIR/.mailmap"
49+
fi
50+
51+
git -C "$rpath" -c mailmap.file="$mailmap_file" log --use-mailmap --shortstat --no-merges --pretty="tformat:%H%n%aN%n%aE" "$start..$end" | while
4552
read hash
4653
read name
4754
read email

0 commit comments

Comments
 (0)