Skip to content

Commit

Permalink
feat: support the mailmap file in mkreleasenotes
Browse files Browse the repository at this point in the history
This will use either the mailmap file in the current repo, or the mailmap file
in the target repo, when generating the contributor stats.
  • Loading branch information
Stebalien committed May 27, 2020
1 parent 7c56366 commit 30dcc26
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bin/mkreleaselog
Expand Up @@ -33,15 +33,22 @@ AUTHORS=(

NL=$'\n'

ROOT_DIR="$(git rev-parse --show-toplevel)"

msg() {
echo "$*" >&2
}

statlog() {
rpath="$GOPATH/src/$1"
start="${2:-}"
end="${3:-HEAD}"
git -C "$rpath" log --shortstat --no-merges --pretty="tformat:%H%n%aN%n%aE" "$start..$end" | while
local rpath="$GOPATH/src/$1"
local start="${2:-}"
local end="${3:-HEAD}"
local mailmap_file="$rpath/.mailmap"
if ! [[ -e "$mailmap_file" ]]; then
mailmap_file="$ROOT_DIR/.mailmap"
fi

git -C "$rpath" -c mailmap.file="$mailmap_file" log --use-mailmap --shortstat --no-merges --pretty="tformat:%H%n%aN%n%aE" "$start..$end" | while
read hash
read name
read email
Expand Down

0 comments on commit 30dcc26

Please sign in to comment.