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

GitHub module changing user-global .gitconfig rather than project-local .git/config #2622

@eengstrom

Description

@eengstrom

Prerequisites

Description

It appears as the Git/GitHub module (version 0.36.2) in Atom (version 1.54.0) is choosing to modify my user global config file (i.e. ~/.gitconfig) with updated identity information, rather than use the repository/clone local file (e.g. .../project/.git/config). Moreover, it seems to happily take the value as defined in my project local config and replicate that in the global config.

Both behaviors seem unnecessary and, IMO, ill-advised as they induce changes in my global config (which I happen to keep in a git repo too).

Is there a reason that the identity information should not always be stored in the project/clone-local config, leaving the global config for, well, the default global settings?

That approach is what I've used for years, allowing me to set the identity information, especially email address, on a clone/project basis, which is terribly useful especially when I routinely transition frequently from open-source, to paid work, to consulting work, all of which use different email addresses.

Steps to Reproduce

In script form:

git config --global user.email [email protected]
grep email ~/.gitconfig
# email = [email protected]
mkdir foo; cd foo; git init .
git config --local user.email [email protected]
grep email .git/config
# email = [email protected]
atom .
grep email ~/.gitconfig
# email = [email protected]

Expected behavior:

I would expect the global config (~/.gitconfig) to be unmodified by this module and instead the local clone config (..../project/.git/config) to be modified instead.

I understand if there is NO local clone, then there would be no other option than to modify the global config, but when there is a local clone + config, that should be preferred.

Actual behavior:

Modifications to global git config (~/.gitconfig`) are made.

Reproduces how often:

Every time one switches projects w/ different local configuration, or when one enters new email address into the identity dialog.

Versions

engstrom@odin ~ % atom --version
Atom : 1.54.0
Electron: 6.1.12
Chrome : 76.0.3809.146
Node : 12.4.0

engstrom@odin ~ % apm --version
apm 2.5.2
npm 6.14.8
node 12.4.0 x64
atom 1.54.0
python 3.9.1
git 2.30.0

engstrom@odin ~ % uname -a
Darwin odin.local 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64 i386 MacBookPro16,1 Darwin

Additional Information

May be related (or perhaps even fixed) as part of one of these:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions