ref-filter: add mailmap support
commita3d2e83a17d6ab9c50d14cfdff9f70a69de5c4c4
authorKousik Sanagavarapu <five231003@gmail.com>
Mon, 25 Sep 2023 17:43:10 +0000 (25 23:13 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Sep 2023 21:52:34 +0000 (25 14:52 -0700)
tree0d3d9dc773e35086f6ce4d9ddde81e28260e94a1
parent0144f0de77edc96c6cd72ab9d50a68fc4c9c092e
ref-filter: add mailmap support

Add mailmap support to ref-filter formats which are similar in
pretty. This support is such that the following pretty placeholders are
equivalent to the new ref-filter atoms:

%aN = authorname:mailmap
%cN = committername:mailmap

%aE = authoremail:mailmap
%aL = authoremail:mailmap,localpart
%cE = committeremail:mailmap
%cL = committeremail:mailmap,localpart

Additionally, mailmap can also be used with ":trim" option for email by
doing something like "authoremail:mailmap,trim".

The above also applies for the "tagger" atom, that is,
"taggername:mailmap", "taggeremail:mailmap", "taggeremail:mailmap,trim"
and "taggername:mailmap,localpart".

The functionality of ":trim" and ":localpart" remains the same. That is,
":trim" gives the email, but without the angle brackets and ":localpart"
gives the part of the email before the '@' character (if such a
character is not found then we directly grab everything between the
angle brackets).

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-for-each-ref.txt
ref-filter.c
t/t6300-for-each-ref.sh