{"thread":{"id":"45970","subject":"Is it possible to use new conditional includes outside of git dir?","startedAt":"2017-05-15T17:09:40Z","lastAt":"2017-05-18T11:50:32Z","messageCount":3,"participants":["Mihails Strasuns","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"319799","messageId":"b18ddd8e-5772-6351-6e49-78c1372077f1@gmail.com","threadId":"45970","inReplyTo":null,"subject":"Is it possible to use new conditional includes outside of git dir?","fromName":"Mihails Strasuns","fromEmail":"mihails.strasuns@gmail.com","sentAt":"2017-05-15T18:09:29Z","receivedAt":"2017-05-15T17:09:40Z","isPatch":false,"sender":{"key":"mihails.strasuns@gmail.com","avatar":null},"body":"Hello,\n\nI was very excited to try out new conditional include feature but have\nquickly found out that it doesn't work with some of my custom scripts\nbecause of the following behaviour:\n\n# .gitconfig\n[includeIf \"gitdir:~/work/\"]\npath = ~/.gitconfig.work\n[user]\nname1 = Someone\n\n# .gitconfig.work\n[user]\nname2 = SomeoneElse\n$ cd ~/work; git config user.name1 # \"Someone\"\n$ cd ~/work ; git config user.name2 # <nothing>\n\nI see that it matches current `git config` documentation - indeed, it\nmentions only matching on git directory and not arbitrary file path. I\nwonder though, if this limitation is intentional and what is the\nrationale behind it?\n\nThank you,\nMichael\n\n"},{"id":"319836","messageId":"CACBZZX5z_jn3KnpgOBE=qa1cUcUAABPwuzqG81Ry0ztvMm4nAw@mail.gmail.com","threadId":"45970","inReplyTo":"b18ddd8e-5772-6351-6e49-78c1372077f1@gmail.com","subject":"Re: Is it possible to use new conditional includes outside of git dir?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-05-15T21:00:43Z","receivedAt":"2017-05-15T21:01:20Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, May 15, 2017 at 8:09 PM, Mihails Strasuns\n<mihails.strasuns@gmail.com> wrote:\n> I was very excited to try out new conditional include feature but have\n> quickly found out that it doesn't work with some of my custom scripts\n> because of the following behaviour:\n>\n> # .gitconfig\n> [includeIf \"gitdir:~/work/\"]\n> path = ~/.gitconfig.work\n> [user]\n> name1 = Someone\n>\n> # .gitconfig.work\n> [user]\n> name2 = SomeoneElse\n> $ cd ~/work; git config user.name1 # \"Someone\"\n> $ cd ~/work ; git config user.name2 # <nothing>\n>\n> I see that it matches current `git config` documentation - indeed, it\n> mentions only matching on git directory and not arbitrary file path. I\n> wonder though, if this limitation is intentional and what is the\n> rationale behind it?\n\nIt's intentional, but in the \"that's how this works\" sense, not \"we'll\nnever add what you just asked for\".\n\nThis came up on list last week:\nhttps://public-inbox.org/git/F55DC360-9C1E-45B9-B8BA-39E1001BD620@gmail.com/T/#u\n\nSo I'd like to ask you the same question I asked Raphael in that thread.\n"},{"id":"320155","messageId":"4a8c79b3-91e4-6f6c-23c3-74df023ffdf0@gmail.com","threadId":"45970","inReplyTo":"CACBZZX5z_jn3KnpgOBE=qa1cUcUAABPwuzqG81Ry0ztvMm4nAw@mail.gmail.com","subject":"Re: Is it possible to use new conditional includes outside of git dir?","fromName":"Mihails Strasuns","fromEmail":"mihails.strasuns@gmail.com","sentAt":"2017-05-18T11:50:17Z","receivedAt":"2017-05-18T11:50:32Z","isPatch":false,"sender":{"key":"mihails.strasuns@gmail.com","avatar":null},"body":"On 05/15/2017 11:00 PM, Ævar Arnfjörð Bjarmason wrote:\n> It's intentional, but in the \"that's how this works\" sense, not \"we'll\n> never add what you just asked for\".\n> \n> This came up on list last week:\n> https://public-inbox.org/git/F55DC360-9C1E-45B9-B8BA-39E1001BD620@gmail.com/T/#u\n> \n> So I'd like to ask you the same question I asked Raphael in that thread.\n\nThis came from the GitHub CLI tool I use\n(https://github.com/sociomantic-tsunami/git-hub) which stores own\nconfiguration in git config (i.e. `git config hub.oauthtoken`). Some of\nits command run outside of the repository context, for example `git hub\nclone` ensures creation of a personal fork before doing regular clone\nand thus needs access to the token.\n\nThus I hoped that I will be able to use new git functionality to\ndistinguish between work and personal GitHub accounts same as it is done\nfor name/email.\n\n"}]}