Skip to content

MashiroCl/mailmapbuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mailmapbuilder

Automatically build .mailmap for a git repository

Introduciton

.mailmap is used to map author and committer names and email addresses to canonical real names and email addresses. With mailmapbuilder, the .mailmap file can be automatically built.

How it works

It uses the GitHub API and the commit history to build the .mailmap:

  • Extract developers names and emails from the commit hisotry
  • Use the GitHub Search Uesr API and developer name as the parameter to search the developer's GitHub personal page
  • Select the top searched result as the candidate
  • Extract the developer's login and public email from the candidate
  • Use the login, public email to search in the commit history to collect the develoepr's aliases and emails in a chained way

Requirement

python3.7 and later

Build

  1. Clone this repository and install dependencies
$ git clone https://github.com/MashiroCl/mailmapbuilder
$ cd mailmapbuilder
$ pip install -r requirements.txt
  1. Creating a personal access token

The mailmapbuilder uses the GitHub API, it needs te personal access token to run.

For how to get personal access token, please refer to here

  1. Set the token as a environment variable

After you get the token, set it as an environment variable, and named the variable as MAILMAPBUILDER

For MacOS:

$ echo "export MAILMAPBUILDER=<personal-access-token>" >> ~/.bash_profile
$ source ~/.bash_profile

For Linux:

export MAILMAPBUILDER=<personal-access-token>

Run Example

$ python3 run.py -i <path-for-repository> -o <path-for-repository>

General Options

  • -i, --input: path for repository need to be built .mailmap
  • -o, --output:output path for .mailmap file

About

Automatically build .mailmap for a git repository

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages