Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only add co-author from GitHub when it's desired #97

Closed
jonsmithers opened this issue Jan 17, 2023 · 3 comments
Closed

Only add co-author from GitHub when it's desired #97

jonsmithers opened this issue Jan 17, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@jonsmithers
Copy link
Contributor

Summary

In my experience with my pairs, adding usernames from GitHub (#74) is always accidental.

Just to be super clear, here's an example:

Let's say I'm Jane Doe, and I'm pairing with Amy Doe and Bob Doe. I go to add them as pairs, expecting to see this:

$ git ad bd
Jane Doe <jane@example.com>
Amy Doe <amy@example.com>
Bob Doe <bob@example.com>

But I haven't yet added them to ~/.git-coauthors, so instead I see:

$ git mob ad bd
Jane Doe <jane@example.com>
Daniel Apatin <35623+ad@users.noreply.github.com>
Ben Dean <146863+bd@users.noreply.github.com>

I've inadvertently added GitHub users ad and bd. And this is persisted in ~/.git-coauthors file.

Motivation

Avoids confusion/frustration, especially for brand new users.

Describe alternatives you've considered

Additional context

@jonsmithers
Copy link
Contributor Author

jonsmithers commented Jan 17, 2023

I have a few ideas for solutions. My personal preference is 3.

  1. Only add users from github if you specify a flag. For example:
    $ git mob ad
    ERROR: co-author with initials "ad" not found
    $ git mob --github jonsmithers
    Jane Doe <jane@example.com>
    Jon Smithers <2660313+jonsmithers@users.noreply.github.com>
  2. Only add users from github if you confirm a prompt. For example:
    $ git mob jonsmithers
    ERROR: Co-author "jonsmithers" not found.
    Would you like to add "Jon Smithers <2660313+jonsmithers@users.noreply.github.com>" from GitHub (y/n)? y
    
    Jane Doe <jane@example.com>
    Jon Smithers <2660313+jonsmithers@users.noreply.github.com>
  3. Make the behavior configurable. For example:
    $ git mob ad
    ERROR: co-author with initials "ad" not found.
    To automatically add users from GitHub, run "git config --global mob.github true"
    $ git config --global mob.github true
    $ git mob ad
    Jane Doe <jane@example.com>
    Daniel Apatin <35623+ad@users.noreply.github.com>

@rkotze
Copy link
Owner

rkotze commented Jan 18, 2023

Hey @jonsmithers

Thanks for pointing this out and I can definitely see it being confusing for newer users.

I like your suggestions and probably best to use a flag and/or the config.

@rkotze rkotze added the bug Something isn't working label Jan 22, 2023
rkotze added a commit that referenced this issue Feb 7, 2023
This needs to be set to true to find missing initials from GitHub.
Config = git-mob-config.github-fetch true

#97
@rkotze
Copy link
Owner

rkotze commented Feb 12, 2023

Fixed in version v2.3.5

@rkotze rkotze closed this as completed Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants