Tool to automate building a .mailmap file
Is there a tool to automate building a .mailmap file for开发者_如何学Go a git repository? A lot of the stuff involved in building one can be done automatically after asking some questions (like "which name/email is preferred for person A?"), and a lot more can be done heuristically (like "Is John A. Smith the same person as John Smith?").
I've found it at least a little easier using the command git log --format="%aN <%aE>" | sort -u | less
, but building up the file is still more work than it seems like it should be.
You are on the right path. git log --all
should be your starting point. From that point forward, bash piping and scripting is something you should embrace and leverage. Git itself is a bunch of shell scripts anyway - at least at the higher level commands. I've become addicted to looking at them. They can shed a lot of light of what is possible and how to do a lot of interesting things.
Hope this helps.
I've made a script. It currently only guesses canonical email addresses.
I ended up writing this tool. It should generalize nicely to other projects. It also helps keep an AUTHORS file up-to-date.
精彩评论