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

Bug: All git operations fail when .git contains a non-existent gitdir

From
TCTom Cook <tom.k.cook@gmail.com>
Date
Jul 21, 2021, 09:17 UTC
Message-ID
<CAFSh4UzCWMCpOGZUYnrxwK79F6jN3irdNs=J7O6RMCeJbBxFBw@mail.gmail.com>
What did you do before the bug happened? (Steps to reproduce your issue)

Add a git submodule to a git repository. Overlay-mount that submodule to another place in the filesystem. Attempt any git operation in the overlay-mounted path.

What did you expect to happen? (Expected behaviour)
git operations that don't depend on a repository should succeed.
What happened instead? (Actual behaviour)

All git operations fail. Even `git bugreport` fails. More importantly, `git ls-remote` on an unrelated repository fails.

``` $ git bugreport fatal: not a git repository: /home/tkcook/git/Veea/demo.git/VHP-3375-veeadb-on-vhe09/build/iesv10/programs/veeadb/../../../../../../.git/worktree> ```

What's different between what you expected and what actually happened?
Commands that should succeed actually fail with the above message.
Anything else you want to add:

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.30.2 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.13.0 #1 SMP Mon Jun 28 11:38:29 UTC 2021 x86_64 compiler info: gnuc: 10.2 libc info: glibc: 2.33 $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks] not run from a git repository - no hooks to show

Next: brian m. carlson
Message 1 of 17 in “Bug: All git operations fail when .git contains a non-existent gitdir”
  1. Tom CookJul 21, 2021
  2. brian m. carlsonJul 21, 2021
  3. Tom CookJul 22, 2021
  4. setup: only die on invalid .git under RUN_SETUPÆvar Arnfjörð Bjarmason, Jul 22, 2021
  5. Junio C HamanoJul 22, 2021
  6. Ævar Arnfjörð BjarmasonJul 22, 2021
  7. Junio C HamanoJul 23, 2021
  8. Tom CookJul 23, 2021
  9. Andrei RybakJul 22, 2021
  10. Ævar Arnfjörð BjarmasonJul 23, 2021
  11. Junio C HamanoJul 23, 2021
  12. Atharva RaykarJul 23, 2021
  13. Tom CookJul 23, 2021
  14. Ævar Arnfjörð BjarmasonJul 23, 2021
  15. Atharva RaykarJul 23, 2021
  16. David AguilarAug 30, 2021
  17. Tom CookAug 31, 2021

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.