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

includeIf ignores subdirectories (possible bug)

From
HTHelmut K. C. Tessarek <tessarek@evermeet.cx>
Date
Jun 14, 2020, 15:43 UTC
Message-ID
<7aabac4a-ef75-74bd-01d9-5c6de27f9338@evermeet.cx>
I've noticed a strange behavior, which might be a bug.

When I'm in a subdirectory of a repo, the IncludeIf is ignored, which makes certain tasks only possible in the root directory of the repo. e.g. commit

Here's a minimal config:
.gitconfig:
[includeIf "gitdir:~/projects/personal/"]
    path = .gitconfig-personal
[includeIf "gitdir:~/projects/work/"]
    path = .gitconfig-work
[commit]
    gpgsign = true
.gitconfig-personal:
[user]
    name = Helmut K. C. Tessarek
    email = personal@email.com
    signingkey = xxxxxxx1
.gitconfig-work:
[user]
    name = K. C. Tessarek
    email = work@email.com
    signingkey = xxxxxxx2
Ok, now create a repo in ~/projects/personal/test/
then add a directory to that repo and commit

cd ~/projects/personal/test/ mkdir new-dir git add . git commit -m "new dir"

# committed with the correct user name and email, and signed with the correct key

cd new-dir touch file git add . git commit -m "new file"

# error: name and email are empty, key is empty to
Run:
git config -l --show-origin
No entries for name, email, signingkey
Cheers,
  K. C.
-- 
regards Helmut K. C. Tessarek              KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/
Message 1 of 1 in “includeIf ignores subdirectories (possible bug)”
  1. Helmut K. C. TessarekJun 14, 2020

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.