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.
Steven Allen committed
May 26, 2020 at 21:46 UTC
30dcc26be848389a6d6f0af43a1a0b140f7b9954
1 file changed
+11
-4
bin/mkreleaselog
+11
-4
@@ -33,15 +33,22 @@ AUTHORS=(
33
34
NL=$'\n'
35
36
+ROOT_DIR="$(git rev-parse --show-toplevel)"
37
+
38
msg() {
39
echo "$*" >&2
40
}
41
42
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
52
read hash
53
read name
54
read email