[PATCH 3/3] Add support for git's mailmap.

John Keeping john at keeping.me.uk
Sat Aug 27 01:13:42 CEST 2016


On Fri, Aug 26, 2016 at 05:30:32PM -0400, Jason A. Smith wrote:
> On 08/26/2016 05:10 PM, Jason A. Smith wrote:
> > On 08/26/2016 04:12 PM, Jason A. Smith wrote:
> >>
> >> If a mailmap file is present in the repo, it will be used to coalesce
> >> commits by the same person, just like git does. When no mailmap file is
> >> found then it functions as before.
> >>
> >> Signed-off-by: Jason A. Smith <smithj4 at bnl.gov>
> >> ---
> >>  cgit.h      |  2 ++
> >>  parsing.c   | 11 +++++++++++
> >>  ui-atom.c   | 20 ++++++++++++++------
> >>  ui-commit.c | 22 ++++++++++++++++------
> >>  ui-log.c    | 11 +++++++++--
> >>  ui-refs.c   | 27 +++++++++++++++++++++------
> >>  ui-stats.c  | 13 ++++++++++---
> >>  7 files changed, 83 insertions(+), 23 deletions(-)
> >
> > Sorry, I forgot the --thread flag. I also just noticed that the branch
> > and thread lists on the summary page still do not honor the mailmap
> > because there is no general init type function in ui-refs to put the
> > read_mailmap() call, and I noticed that ui-tag also has tagger name &
> > email so that should be patched as well. I will have to fix these and
> > resend the patches, probably on Monday.
> >
> > ~Jason
> 
> Sorry for the extra email noise, but while fixing these I found two more 
> cgit_open_filter() function calls that should probably be changed to 
> cgit_open_email_filter() in the first patch:
> 
> ui-refs.c:146
> ui-tag.c:85

Those both use tagger_email, so that makes sense, I completely forgot
about that one and only converted author_email and committer_email.

The reference in ui-tag.c also needs angle brackets inserted in the
output in the !noplainemail case.  Feel free to squash that into the
first patch, and take ownership if you want.

I also noticed that we don't check the return value of read_mailmap(),
I'm not entirely sure what we should do if it fails, but it does look
like "missing mailmap" is not a failure case, so we probably should be
doing something if it returns an error.


More information about the CGit mailing list