Skip to content

git 1.7.10 include directive and Local GitHub Config #5

merged 1 commit into from Apr 17, 2012

2 participants

ninjudd commented Apr 13, 2012

The git 1.7.10 include directive [1] 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.

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?

  1. gitster/git@9b25a0b
sigma commented Apr 15, 2012

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 ?

sigma commented Apr 17, 2012

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.

@sigma sigma merged commit 4a50edb into sigma:master Apr 17, 2012
@ninjudd ninjudd added a commit to ninjudd/gist that referenced this pull request Jul 26, 2012
@ninjudd ninjudd 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.