Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Git identity panel #2428

Merged
merged 17 commits into from
Apr 6, 2020
Merged

Git identity panel #2428

merged 17 commits into from
Apr 6, 2020

Conversation

smashwilson
Copy link
Contributor

Please be sure to read the contributor's guide to the GitHub package before submitting any pull requests.

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • Suggestion: You can use checklists to keep track of progress for the sections on metrics, tests, documentation, and user research.

Description of the Change

Display and edit the values of git config user.email and git config user.name in an interstitial panel in the Git tab. The Identity panel is shown automatically if either are blank (which would prevent you from performing most git operations successfully anyway). Otherwise, it can be triggered manually by clicking on your avatar image in the Git tab header.

Screenshot

identity panel

Alternate Designs

Some nice-to-haves that I opted not to include in this effort:

  • Pre-fill with values from your GitHub account after you authenticate on the GitHub tab.
  • Easily anonymize your email by setting a +noreply address.
  • Flip between a set of known account values in some kind of "recently used" list.
  • Control whether the config settings are local (per-repository) or global. (As written, this always writes to your global config.)

Benefits

This unblocks one of the biggest pieces of missing functionality in the "getting started" path. Setting these values is necessary for doing anything related to git, but requires either a separate local git installation or hand-editing a config file in a way that isn't well communicated.

With this in place, it will be possible to download Atom onto an otherwise vanilla machine and get started working with version control.

Possible Drawbacks

I still anticipate a fair amount of confusion related to the differences among:

  • Your git identity, the username and email address used in the metadata of commits written by git
  • The GitHub OAuth token you authenticate on the GitHub tab to get, which is used by this package to make API requests on your behalf, and to push and fetch git changes to https remotes
  • Your SSH key and stored git credentials used to push and fetch git changes to remotes

These are three different things and can all be changed independently! I'd love to find a way to unify them somehow, at least by default, or better communicate which is applicable where.

Applicable Issues

Fixes #932 at long last. The next big chunk of #1934.

Release Notes

  • If user.email or user.name are not set, the Git tab will prompt for them to be populated.
  • Click your avatar in the Git tab to modify the user.email and user.name used to author git commits.

@codecov
Copy link

codecov bot commented Apr 5, 2020

Codecov Report

Merging #2428 into master will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2428      +/-   ##
==========================================
+ Coverage   93.37%   93.41%   +0.03%     
==========================================
  Files         235      236       +1     
  Lines       13178    13196      +18     
  Branches     1892     1897       +5     
==========================================
+ Hits        12305    12327      +22     
+ Misses        873      869       -4     
Impacted Files Coverage Δ
lib/controllers/git-tab-header-controller.js 100.00% <ø> (ø)
lib/views/git-tab-header-view.js 100.00% <ø> (ø)
lib/containers/git-tab-container.js 100.00% <100.00%> (ø)
lib/controllers/git-tab-controller.js 85.71% <100.00%> (+5.04%) ⬆️
lib/git-shell-out-strategy.js 99.81% <100.00%> (+<0.01%) ⬆️
lib/models/author.js 100.00% <100.00%> (ø)
lib/models/repository.js 96.15% <100.00%> (-0.20%) ⬇️
lib/views/git-identity-view.js 100.00% <100.00%> (ø)
lib/views/git-tab-view.js 86.95% <100.00%> (+0.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c11d582...c804f89. Read the comment docs.

@smashwilson smashwilson merged commit d822496 into master Apr 6, 2020
@smashwilson smashwilson deleted the git-account-dialog branch April 6, 2020 12:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to setup git user.email and user.name on atom.
1 participant