{"thread":{"id":"39387","subject":"Querying Git for the path to the system config file","startedAt":"2015-05-20T20:23:55Z","lastAt":"2015-05-20T21:22:39Z","messageCount":3,"participants":["Sebastian Schuberth","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"261710","messageId":"CAHGBnuPCZCBsBXqGo26E-pcuZXZBxL8GwAehW4UziDpB2V8Npw@mail.gmail.com","threadId":"39387","inReplyTo":null,"subject":"Querying Git for the path to the system config file","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2015-05-20T20:23:55Z","receivedAt":"2015-05-20T20:23:55Z","isPatch":false,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"Hi,\n\nI was in need to find out the path to the system-wide config file that\nGit is using. I need to do this in a platform-independent way (Linux,\nMac OS X, Windows). What I came up with is\n\n$ GIT_EDITOR=echo git config --system --edit\n\nto trick Git into printing the path instead of opening the file in an editor.\n\nJust wondering, is there a less hacky way to do that?\n\n-- \nSebastian Schuberth\n"},{"id":"261716","messageId":"20150520210143.GC8421@peff.net","threadId":"39387","inReplyTo":"CAHGBnuPCZCBsBXqGo26E-pcuZXZBxL8GwAehW4UziDpB2V8Npw@mail.gmail.com","subject":"Re: Querying Git for the path to the system config file","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-20T21:01:43Z","receivedAt":"2015-05-20T21:01:43Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, May 20, 2015 at 10:23:55PM +0200, Sebastian Schuberth wrote:\n\n> I was in need to find out the path to the system-wide config file that\n> Git is using. I need to do this in a platform-independent way (Linux,\n> Mac OS X, Windows). What I came up with is\n> \n> $ GIT_EDITOR=echo git config --system --edit\n> \n> to trick Git into printing the path instead of opening the file in an editor.\n> \n> Just wondering, is there a less hacky way to do that?\n\nNo, there isn't. It's baked in at compile-time, so something similar to\n\"git --exec-path\" might make sense (but if we are going to start\nexposing a lot of build flags, it might be nice to come up with some\norganized system rather than haphazardly adding options).\n\nOf course adding a new option probably won't help you, as it will take\nsome time before it can be used reliably. I think the hack you came up\nwith is pretty reasonable in the meantime.\n\n-Peff\n"},{"id":"261720","messageId":"CAHGBnuOP_pZzZz_jJSG5YzhPp+=TEmy2n83YiH_uA3s56GWt-g@mail.gmail.com","threadId":"39387","inReplyTo":"20150520210143.GC8421@peff.net","subject":"Re: Querying Git for the path to the system config file","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2015-05-20T21:22:39Z","receivedAt":"2015-05-20T21:22:39Z","isPatch":false,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Wed, May 20, 2015 at 11:01 PM, Jeff King <peff@peff.net> wrote:\n\n> Of course adding a new option probably won't help you, as it will take\n> some time before it can be used reliably. I think the hack you came up\n> with is pretty reasonable in the meantime.\n\nRight, so I'll keep using that hack, thanks!\n\n-- \nSebastian Schuberth\n"}]}