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

git init BUG when gitconfig has includeIf

From
HRHeghedus Razvan <heghedus.razvan@protonmail.com>
Date
May 21, 2024, 07:54 UTC
Message-ID
<D1F5SJ52H4Z0.1NR7M8APRFTOB@protonmail.com>
Hello everybody

Yesterday I stumble upon a bug when doing git init. I didn't find any references to it, so I don't know if is a known problem or not.

Steps to reproduce:
# git init .
BUG: refs.c:2123: reference backend is unknown

I'm able to reproduce this on multiple systems where the git version is newer than v2.44.0. This happens only when I have an "includeIf" in the ~/.gitconfig . Bellow [1] I have a minimal configuration for reproducing the bug. With same gitconfig but versions lower than v2.43.4 the error is no longer happening.

So I went and did a git bisection and the error appeared with 173761e21b setup: start tracking ref storage format Previous commit ("0fcc285c5e") is working fine.

I cc'ed Patrick Steinhardt since the error appeared from his commit.

Best regards, Razvan

--
1:
content of ~/.gitconfig
```
[user]
        email = some_email@test.net
        name = test
[includeIf "onbranch:upstream*"]
        path=~/.gitconfig_upstream
```
content of ~/.gitconfig_upstream
```
[user]
        name = test test
```
Next: Junio C Hamano
Message 1 of 14 in “git init BUG when gitconfig has includeIf”
  1. Heghedus RazvanMay 21, 2024
  2. Junio C HamanoMay 21, 2024
  3. Heghedus RazvanMay 21, 2024
  4. Patrick SteinhardtMay 22, 2024
  5. Heghedus RazvanMay 22, 2024
  6. Patrick SteinhardtMay 22, 2024
  7. setup: fix bug with "includeIf.onbranch" when initializing dirPatrick Steinhardt, May 22, 2024
  8. Heghedus RazvanMay 22, 2024
  9. Junio C HamanoMay 22, 2024
  10. Junio C HamanoMay 23, 2024
  11. Patrick SteinhardtMay 23, 2024
  12. setup: fix bug with "includeIf.onbranch" when initializing dirJunio C Hamano, May 23, 2024
  13. [rPATCH v2] setup: fix bug with "includeIf.onbranch" when initializing dirJunio C Hamano, May 23, 2024
  14. Patrick SteinhardtMay 23, 2024

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.