git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: includeIf appears to not be working

From
Jeff King <peff@peff.net>
Date
Dec 12, 2022, 20:55 UTC
Message-ID
<Y5eVTrK2CO0h5BPl@coredump.intra.peff.net>
In-Reply-To
<8316344.DvuYhMxLoT@hosanna>
On Mon, Dec 12, 2022 at 11:19:41AM -0900, Joshua J. Kugler wrote:
Show 7 quoted lines
> Contents of ~/.gitconfig (truncated):
> 
> [user]
>         name = Joshua Kugler
>         email = joshua@personal.com
> [includIf "gitdir:~/repos/work/"]
>         path = ~/repos/work/gitconfig

Maybe a dumb question, but is this cut-and-paste verbatim? If so, then perhaps s/includ/include/ would help?

With that change, your example works for me.
> Like I said, I've set this up before, and had it working. I don't know what 
> I'm doing differently/wrong...but would be happy to be told so.

If it's not the typo, then possibly there are symlinks involved? We'll run realpath() on the repository directory before matching, so your pattern needs to take that into account.

> Is there a debug command which can show if the gitdir is/isn't
> matching like I thought it should?  What other command output could
> help debug this?

No, there's no debug/tracing code for this feature. You'd have to run it under gdb (break on the include_by_gitdir function).

-Peff
Previous: Joshua J. KuglerNext: Jeff King
Message 4 of 5 in “includeIf appears to not be working”
  1. Joshua J. KuglerDec 12, 2022
  2. Eric SunshineDec 12, 2022
  3. Joshua J. KuglerDec 12, 2022
  4. Jeff KingDec 12, 2022
  5. Jeff KingDec 12, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.