ingydotnet/git-hub

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 hostname
  • issue/91 (2016-02-13) open @dolmen Fallback to "git config github.user" for github.login
  • issue/92 (2016-02-13) open @ingydotnet Allow git-hub config values to be per repo
  • issue/93 (2016-02-13) open @ingydotnet Support a git-hub.default-remote for config
  • pr/204 (2016-02-01) open @perlpunk add missing bash completion for config|config-unset
  • pr/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/config if GIT_DIR exists
  • $GIT_HUB_ROOT/config if 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/config if 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 ~/.git-hub/config and code only does ~/.githubconfig. nevermind, I must have gotten mixed up in updating (update: 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.

@ewilhelm where did you see code that still uses ~/.githubconfig ?