Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for .mailmap files #229

Closed
patrickdevivo opened this issue Jan 18, 2022 · 4 comments
Closed

Add support for .mailmap files #229

patrickdevivo opened this issue Jan 18, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@patrickdevivo
Copy link
Contributor

See here for context. It would be useful to be able use mappings in a .mailmap of a repo to de-duplicate authors in queries.

I'm not entirely sure how we add support for it - maybe as a helper function that takes the contents of a .mailmap and an email address, and returns the associated name.

Something like SELECT mailmap(<mailmap-contents>, 'some@email.com')

@patrickdevivo patrickdevivo added the enhancement New feature or request label Jan 18, 2022
@patrickdevivo patrickdevivo self-assigned this Jan 18, 2022
@chrisma
Copy link

chrisma commented Jan 18, 2022

It might also be an idea to represent the .mailmap file as a DB table itself, that could be written and queried.
If a query is executed that is marked as using this mailmap table, contributors would be merged. That is how the git CLI does it. When a .mailmap file is found, all further commands respect it by default.

This could mean that the mailmap config would only have to be setup once for a repo, and no additional helper functions would clutter the SQL code.

An SQL query could then be constructed that identifies those email addresses in the current contributor list of the repo, which have not yet explicitly been handled in the .mailmap file (i.e. don't have a canonical name assigned)

@patrickdevivo
Copy link
Contributor Author

First version handled in this PR: mergestat/mergestat#250

@chrisma
Copy link

chrisma commented Feb 16, 2022

Very cool! 👏

@chrisma
Copy link

chrisma commented Feb 16, 2022

I've added my idea of representing the contents of .mailmap as a table in MergeStat in a separate issue (#254) in case that's of interest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants