Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support gitconfig in XDG directory #95

Closed
guyhughes opened this issue Jan 17, 2017 · 4 comments
Closed

Support gitconfig in XDG directory #95

guyhughes opened this issue Jan 17, 2017 · 4 comments
Assignees

Comments

@guyhughes
Copy link
Contributor

guyhughes commented Jan 17, 2017

Git began fully implementing support for config files in $XDG_CONFIG_HOME fairly recently in v2.4.3. Here's the commit:
git/git@ea19289

Using the XDG directory, the git-config supported path is $XDG_CONFIG_HOME/git/config, and if the environment variable is undefined it ought to default to $HOME/.config.

@m040601 requested this feature.
#63 (comment)

I'd be interested in implementing.

@guyzmo
Copy link
Owner

guyzmo commented Jan 18, 2017

ok, two tasks are needed:

what I believe is that it's not git-repo's role to decide where the configuration is.

@guyzmo
Copy link
Owner

guyzmo commented Jan 18, 2017

I can see there's a facility in gitpython to provide .gitconfig path.

I believe providing the proper path shouldn't be hard.

@guyzmo
Copy link
Owner

guyzmo commented Jan 18, 2017

looking further, the impact seems to located mostly in two use cases of the application:

  • when working outside of a repository, then the .gitconfig path is resolved using a hardcoded $HOME/.gitconfig, otherwise it uses gitpython to resolve the full configuration of the current repository ;
  • when running git-repo config which defaults to '$HOME/.gitconfig', but can be overridden with the --config option.

guyzmo added a commit that referenced this issue Feb 2, 2017
@guyzmo guyzmo self-assigned this Feb 2, 2017
@guyzmo guyzmo added ready and removed in progress labels Feb 2, 2017
@guyzmo guyzmo closed this as completed in 0e68b1e Feb 2, 2017
@guyzmo guyzmo removed the ready label Feb 2, 2017
@guyzmo
Copy link
Owner

guyzmo commented Feb 2, 2017

sorry for not having left you the change to do it, but I went over that part of the code and just did it.
Though it's not a thorough implementation and it'll ignore the system part. It's just a hardcoded precedence. It might be improvable, but rather 👌 as is 😉

Please test the devel branch, I'm going to release it early next week (I'm waiting on new release of pybitbucket and that FOSDEM is over… whichever comes first 😉)

guyzmo added a commit that referenced this issue Feb 6, 2017
🚧 Features

* Gogs (fixes #18) (kudos @pyhedgehog)
* certificate pinning (fixes #88)
* non-standard http ports (fixes #81)
* possibility to use custom SSH address (fixes #107)
* .gitconfig in XDG home directory (fixes #95)
* .gitconfig's proxy definition support (fixes #105)
* automatically grab PR title/body from last commit (fixes #73)

🚒 Bugfixes

* refactoring of listings, improved list command (fixes #114)

💄 Cosmetics

* Switch to a git tag scheme for versioning (using setuptools-scm)
* Updated README with new informations
* Added @pyhedgehog to contributors
* Updated TODO list

Signed-off-by: Guyzmo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants