rkotze/git-mob

Ability to add coauthors via GitHub usernames or issue/pull request urls

introt opened this issue · 3 comments

Summary

Add the ability to add coauthors via GitHub usernames or issue/pull request urls using the GitHub REST API.

Motivation

Adding unknown people, especially if you don't know their emails, is time consuming. This feature would make it as simple as git add-coauthor ir introt, or git add-coauthor ir https://github.com/findmypast-oss/git-mob/issues/74.

Describe alternatives you've considered

Using an external tool.

Additional context

Reference implementation for API usage: https://gist.github.com/introt/ad30bcbdf789aed5bba43082741c7769

Hi @introt

Thanks for the idea and it could be a valuable addition to Git Mob.

Using the GitHub username to form the co-author metadata is what we should start with.

What I understand from your script and GitHub API restrictions, it's only possible to construct their anonymous email because their public email would only be available using authentication. Does this sound correct to you?

Hi @rkotze

Yes, only anonymous emails are available without authentication1, but creating a personal access token2 to access public emails is pretty straight-forward.

I personally prefer using the anonymous emails as they'll "never" stop working3, but using public emails with anonymous ones as a fallback is imo an important option to have for people working in a corporate context.

Footnotes

  1. https://docs.github.com/en/rest/guides/getting-started-with-the-rest-api#authentication

  2. https://github.com/settings/tokens - needs no extra scopes

  3. Changing ones login doesn't affect their id number, while people might want to change their email address along with their legal name

Feature released with v2.3.1.