rkotze / git-mob

Co-author commits tool. A cross-platform command-line tool for social coding. Includes co-authors in commits when pair/mob programming.
https://www.npmjs.com/package/git-mob
MIT License
183 stars 21 forks source link

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

Closed introt closed 1 year ago

introt commented 2 years ago

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

rkotze commented 2 years ago

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?

introt commented 2 years ago

Hi @rkotze

Yes, only anonymous emails are available without authentication^auth, but creating a personal access token[^token] to access public emails is pretty straight-forward.

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

[^token]: https://github.com/settings/tokens - needs no extra scopes [^work]: Changing ones login doesn't affect their id number, while people might want to change their email address along with their legal name

rkotze commented 1 year ago

Feature released with v2.3.1.