The git 1.7.10 include directive  allows you to include external files from your .gitconfig. But these directives are not read by git config --global github.user, only by git config github.user.
git config --global github.user
git config github.user
In light of this, I think it makes sense for gh.el to use the latter rather than the former. Are there any cases where this will break that I'm not thinking of?
use 'git config' instead of 'git config --global' so that it works wi…
…th the git 1.7.10 include directive
Hmm that's an interesting one.
The reason I was using git config --global to get the values is that I didn't want some unfortunate local settings to interfere. That would be the case if, for some reason, the default-directory was in a git repository overloading such settings.
I can't imagine why one would set github.* in a local dir... but anyway that would make it pretty hard to debug.
Now, although I was able to reproduce the issue in 1.7.10, I don't understand it. According to the very commit you link here, git config --global should honor the includes directive. It's even one of the examples given where no explicit file is used, and I think it would make sense in any case. So, do you know more about that story? is that a git bug?
So, if it's really really the intended behavior, I suspect calling "git config --global --includes" would be cleaner (except that it sucks of course, because it we'd need to detect the git version to adapt the flags)
What do you think ?
So, I got confirmation that this is the intended behavior.
While I still think that behavior is dodgy, on a second though I think your patch is right anyway. Some applications that are operating on a repository could use the local settings on purpose.
And for those where it doesn't make sense (like gist.el), we should enforce default-directory to be $HOME, or something.
don't use 'git config --global' to get config
instead just use 'git config' because this works with the git 1.7.10
include directive. this same change was made for gh.el in sigma/gh.el#5.