{"thread":{"id":"58938","subject":"includeIf appears to not be working","startedAt":"2022-12-12T20:19:49Z","lastAt":"2022-12-12T21:05:47Z","messageCount":5,"participants":["Joshua J. Kugler","Eric Sunshine","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"468921","messageId":"8316344.DvuYhMxLoT@hosanna","threadId":"58938","inReplyTo":null,"subject":"includeIf appears to not be working","fromName":"Joshua J. Kugler","fromEmail":"joshua@azariah.com","sentAt":"2022-12-12T20:19:41Z","receivedAt":"2022-12-12T20:19:49Z","isPatch":false,"sender":{"key":"joshua@azariah.com","avatar":null},"body":"So, I've set up includeIf before, and have had it working, but it seems to not \nbe working in my latest attempt.\n\nThis is git 2.38.2 on Ubuntu Linux 20.04.\n\nContents of ~/.gitconfig (truncated):\n\n[user]\n        name = Joshua Kugler\n        email = joshua@personal.com\n[includIf \"gitdir:~/repos/work/\"]\n        path = ~/repos/work/gitconfig\n\nContents of ~/repos/work/gitconfig:\n\n[user]\n        name = Joshua Kugler\n        email = joshua@work.io\n\nNow, if I do this:\n\ncd /home/jkugler/repos/work/some_repo\n\nand run:\n\n$ git config --show-origin --get user.email\nfile:/home/jkugler/.gitconfig   joshua@personal.com\n\nLike I said, I've set this up before, and had it working. I don't know what \nI'm doing differently/wrong...but would be happy to be told so.\n\nIs there a debug command which can show if the gitdir is/isn't matching like I \nthought it should?  What other command output could help debug this?\n\nThanks!\n\nj\n\n-- \nJoshua J. Kugler - Fairbanks, Alaska - joshua@azariah.com\nAzariah Enterprises - Programming and Website Design\nPGP Key: http://pgp.mit.edu/  ID 0x68108cbb73b13b6a\n\n\n"},{"id":"468924","messageId":"CAPig+cRv02F2yw3Ej1_7PKUV5stKcff82GtdUe5X3wnPfDhfmw@mail.gmail.com","threadId":"58938","inReplyTo":"8316344.DvuYhMxLoT@hosanna","subject":"Re: includeIf appears to not be working","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2022-12-12T20:54:48Z","receivedAt":"2022-12-12T20:55:02Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Dec 12, 2022 at 3:36 PM Joshua J. Kugler <joshua@azariah.com> wrote:\n> So, I've set up includeIf before, and have had it working, but it seems to not\n> be working in my latest attempt.\n>\n> Contents of ~/.gitconfig (truncated):\n>\n> [user]\n>         name = Joshua Kugler\n>         email = joshua@personal.com\n> [includIf \"gitdir:~/repos/work/\"]\n\nMissing \"e\" in \"includeIf\".\n"},{"id":"468925","messageId":"Y5eVTrK2CO0h5BPl@coredump.intra.peff.net","threadId":"58938","inReplyTo":"8316344.DvuYhMxLoT@hosanna","subject":"Re: includeIf appears to not be working","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2022-12-12T20:55:42Z","receivedAt":"2022-12-12T20:57:03Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 12, 2022 at 11:19:41AM -0900, Joshua J. Kugler wrote:\n\n> Contents of ~/.gitconfig (truncated):\n> \n> [user]\n>         name = Joshua Kugler\n>         email = joshua@personal.com\n> [includIf \"gitdir:~/repos/work/\"]\n>         path = ~/repos/work/gitconfig\n\nMaybe a dumb question, but is this cut-and-paste verbatim? If so, then\nperhaps s/includ/include/ would help?\n\nWith that change, your example works for me.\n\n> Like I said, I've set this up before, and had it working. I don't know what \n> I'm doing differently/wrong...but would be happy to be told so.\n\nIf it's not the typo, then possibly there are symlinks involved? We'll\nrun realpath() on the repository directory before matching, so your\npattern needs to take that into account.\n\n> Is there a debug command which can show if the gitdir is/isn't\n> matching like I thought it should?  What other command output could\n> help debug this?\n\nNo, there's no debug/tracing code for this feature. You'd have to run it\nunder gdb (break on the include_by_gitdir function).\n\n-Peff\n"},{"id":"468926","messageId":"Y5eVsb8rIH9TFgIj@coredump.intra.peff.net","threadId":"58938","inReplyTo":"Y5eVTrK2CO0h5BPl@coredump.intra.peff.net","subject":"Re: includeIf appears to not be working","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2022-12-12T20:57:21Z","receivedAt":"2022-12-12T20:58:42Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 12, 2022 at 03:55:42PM -0500, Jeff King wrote:\n\n> > Is there a debug command which can show if the gitdir is/isn't\n> > matching like I thought it should?  What other command output could\n> > help debug this?\n> \n> No, there's no debug/tracing code for this feature. You'd have to run it\n> under gdb (break on the include_by_gitdir function).\n\nOh, one other command you could try:\n\n  git rev-parse --absolute-git-dir\n\nwhile in the repository in question. I think that would do the same\nnormalization of the path (including resolving symlinks). So that would\ntell you what Git should be matching against.\n\n-Peff\n"},{"id":"468929","messageId":"5349174.mvXUDI8C0e@hosanna","threadId":"58938","inReplyTo":"CAPig+cRv02F2yw3Ej1_7PKUV5stKcff82GtdUe5X3wnPfDhfmw@mail.gmail.com","subject":"Re: includeIf appears to not be working","fromName":"Joshua J. Kugler","fromEmail":"joshua@azariah.com","sentAt":"2022-12-12T21:05:04Z","receivedAt":"2022-12-12T21:05:47Z","isPatch":false,"sender":{"key":"joshua@azariah.com","avatar":null},"body":"All -\n\nYep, that was copy/paste verbatim, and yep, that was the issue.\n\nThank you to all who spotted the missing \"e\".  Siiiiigh. I looked at that so \nmany times, and didn't even see it.\n\nSorry to waste your time, and I much appreciate the quick response!\n\nj\n\nOn Monday, December 12, 2022 11:54:48 AM AKST Eric Sunshine wrote:\n> On Mon, Dec 12, 2022 at 3:36 PM Joshua J. Kugler <joshua@azariah.com> wrote:\n> > So, I've set up includeIf before, and have had it working, but it seems to\n> > not be working in my latest attempt.\n> > \n> > Contents of ~/.gitconfig (truncated):\n> > \n> > [user]\n> > \n> >         name = Joshua Kugler\n> >         email = joshua@personal.com\n> > \n> > [includIf \"gitdir:~/repos/work/\"]\n> \n> Missing \"e\" in \"includeIf\".\n\n\n-- \nJoshua J. Kugler - Fairbanks, Alaska - joshua@azariah.com\nAzariah Enterprises - Programming and Website Design\nPGP Key: http://pgp.mit.edu/  ID 0x68108cbb73b13b6a\n\n\n"}]}