Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Support for co-authors #14

Open
nebbles opened this issue Nov 3, 2019 · 2 comments
Open

Support for co-authors #14

nebbles opened this issue Nov 3, 2019 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@nebbles
Copy link
Owner

nebbles commented Nov 3, 2019

To support co-authors on GitHub, the following trailer needs to be added to the commit

Co-authored-by: Firstname Lastname <[email protected]>
  • There must be at least one blank line between this line and the previous lines of the commit (two is recommended)

Additional features:

  • It would be useful if gitcommit can cache these authors and save them in a global config since typing them out every time would become a pain.
  • It would be very useful if you could type in a GitHub username e.g. nebbles@gh and gitcommit automatically detects and attempts to resolve the public email from the GitHub profile page (and possibly full name?)
@nebbles nebbles added the enhancement New feature or request label Nov 3, 2019
@nebbles nebbles added the in-development Work is in progress to resolve label Nov 5, 2019
@nebbles nebbles added this to the 1.0 milestone Nov 5, 2019
@nebbles nebbles removed the in-development Work is in progress to resolve label Dec 25, 2019
@nebbles
Copy link
Owner Author

nebbles commented May 9, 2020

As previously mentioned, the exact specification on how to add a co-author as a 'trailer' to the commit message can be found here:

https://help.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors

Support for coauthors was added to the GitHub desktop app. In this app, the authors are resolved through the API via a mentionable user.

The source code for getting mentionable for a particular repository:

https://github.com/desktop/desktop/blob/ab28d00115081f70bf773d36216dad4ab15be10a/app/src/lib/api.ts#L962

There is also an API endpoint for getting the public email addresses of a particular GitHub user:

https://developer.github.com/v3/users/emails/#list-public-email-addresses-for-a-user

This PR for Atom, discusses adding mentionable users with the GitHub GraphQL API

https://github.com/atom/github/pull/1476/files#diff-961f5e053a04f04fd4a96b42712e4dc4R133

The line of interest where the GraphQL request is made, can be found here

https://github.com/atom/github/blob/dd9647641beb263253c5678b888b7964c5c675cb/lib/models/user-store.js#L140

The documentation for the repository object on the GitHub GraphQL API can be found here

https://developer.github.com/v4/object/repository/

The Atom repository may be of interest as they also implemented using local git history in order to determine mentionable git users.

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

No branches or pull requests

1 participant