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
182 stars 21 forks source link

d README: gh api script to generate the config file #86

Closed nitsanavni closed 1 year ago

nitsanavni commented 1 year ago

related to https://github.com/rkotze/git-mob/issues/74

if you like the idea, I'm happy to pair/mob on it :)

rkotze commented 1 year ago

Hi @nitsanavni

Thanks for putting your idea in.

From what I understand from this script it will retrieve all contributors from GitHub repository and then add all to the co-author file. The notable downside is lots of repos have many contributors which might be too many to select from and/or no longer a contributor. There might be duplicates in authors because of case sensitivity or different emails or typos, which could make the file messy.

The git suggest-coauthors command is similar this by reading the local git repo and extracting the co-authors, then the user can select which users to add. A handy feature for the suggest command could be a filter flag to find contributors.

Please detail your idea further so we can better discuss it.

nitsanavni commented 1 year ago

right :)

I should've added some more details and motivation.

The idea is to get up and running with actual collaborators as a quick-start.

Maybe it should be more interactive / or maybe rely on better stats (e.g. recent contributors, number of commits).

Would you like to discuss on a call?

nitsanavni commented 1 year ago

iso collaborators, there's a contributors api too, and if we sort it by contributions, it looks like this:

$ gh api repos/rkotze/git-mob/contributors --jq 'map({login,contributions})|sort_by(.contributions)|reverse|map(.login)|.[]' |
(xargs -L1 -I {} gh api users/{} --jq '{(.login): {email:(.email//.login+"@users.noreply.github.com") ,name}}') |
jq -s 'add'
{
  "rkotze": {
    "email": "richkotze@outlook.com",
    "name": "Richard Kotze"
  },
  "dideler": {
    "email": "dideler@users.noreply.github.com",
    "name": "Dennis Ideler"
  },
  "jackbittiner": {
    "email": "jackbittiner@hotmail.com",
    "name": "Jack Bittiner"
  },
  ...
}
rkotze commented 1 year ago

I prefer to keep discussing this in the thread for now.

I think instead of focusing on it only from a getting started point of view, it would be more valuable to handle the idea of making it easier to add new co-authors.

The scenarios to cover would be:

I'd like to have a consistent experience when a new Git Mob user starts adding co-authors for the first time it's similar to adding co-authors in the future.