git hub config - refactor, rewrite, redux
ingydotnet opened this issue · 3 comments
This issue is meant to address all the outstanding config related issues in a
complete and holistic way.
This closes the following issues:
issue/213 (2016-02-13) open @perlpunk Allow to configure github hostnameissue/91 (2016-02-13) open @dolmen Fallback to "git config github.user" for github.loginissue/92 (2016-02-13) open @ingydotnet Allow git-hub config values to be per repoissue/93 (2016-02-13) open @ingydotnet Support a git-hub.default-remote for configpr/204 (2016-02-01) open @perlpunk add missing bash completion for config|config-unsetpr/185 (2016-02-10) open @perlpunk add environment variable/config for force-cache
Design for this issue will follow in comments.
The primary change is where git hub config will read from and write to.
The read order should be:
$GIT_DIR/configif GIT_DIR exists$GIT_HUB_ROOT/configif GIT_HUB_ROOT exists~/.git-hub/config~/.gitconfig/etc/gitconfig
Where keys are read from a [git-hub] section.
The write order should be:
$GIT_HUB_ROOT/configif GIT_HUB_ROOT exists~/.git-hub/config
Any other behaviour can be accomplished with the git config command itself.
There will be a new doc section "Configuration" that explains all this. It
will be different from the git hub config command doc.
Config commands should hide auth tokens unless -T used.
Some keys can be taken from [github] sections if present.
Seems like docs and code don't agree right now. Readme says nevermind, I must have gotten mixed up in updating (update: ~/.git-hub/config and code only does ~/.githubconfig.git-hub and git hub are different things for me despite having sourced the .rc file, I got /usr/lib/git-core/git-hub.)
Also, the .rc file sets GIT_HUB_ROOT, so I don't know about that as the default place to write unless this is made obvious by docs and setup/config output.