File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,22 @@ AUTHORS=(
33
33
34
34
NL=$' \n '
35
35
36
+ ROOT_DIR=" $( git rev-parse --show-toplevel) "
37
+
36
38
msg () {
37
39
echo " $* " >&2
38
40
}
39
41
40
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
45
52
read hash
46
53
read name
47
54
read email
You can’t perform that action at this time.
0 commit comments