src-d / go-git

Project has been moved to: https://github.com/go-git/go-git
https://github.com/go-git/go-git
Apache License 2.0
4.91k stars 541 forks source link

Add global and system config support #1243

Open djgilcrease opened 4 years ago

djgilcrease commented 4 years ago

Loads the config the same way git does, System, then Global, then Local so overrides are maintained properly.

Closes #760

cap10morgan commented 4 years ago

Thanks for submitting this PR, @djgilcrease. I would love to have this functionality for a project I'm working on using go-git. It seems that they've moved all development to this repo: https://github.com/go-git/go-git. Can you resubmit this PR over there?

cap10morgan commented 4 years ago

Ran into an issue with this, which I may try to fix and submit an updated PR to the new go-git/go-git repo. Namely, when you load up your config with this code and then later run a SetConfig, it copies your merged system, global, local config into your local .git/config file. That's probably not what we want for general behavior there.

djgilcrease commented 4 years ago

sounds good to me, I am on vacation for the next few weeks so will not be able to do anything with it for a long while.