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

[BUG] `git reset --hard` fails with `update = none` submodules

From
RKRose Kunkel <rose@rosekunkel.me>
Date
Jun 16, 2021, 00:16 UTC
Message-ID
<CAKjYmsELpf9r3bAJj_JUHgVegw_7z2KzyuR_6FYYngpC1XmNeg@mail.gmail.com>
# What did you do before the bug happened? (Steps to reproduce your issue)
1. Clone a git repository that sets `update = none` in .gitmodules:
$ git clone --recurse-submodules https://github.com/ubolonton/tree-sitter-langs
2. Perform a hard reset:
$ cd tree-sitter-langs
$ git reset --hard

# What did you expect to happen? (Expected behavior) The reset should succeed and do nothing.

# What happened instead? (Actual behavior) The reset command fails with ``` fatal: not a git repository: ../../.git/modules/repos/agda fatal: could not reset submodule index ```

[System Info] git version: git version 2.32.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.12.10-hardened1-1-hardened #1 SMP PREEMPT Thu, 10 Jun 2021 21:12:42 +0000 x86_64 compiler info: gnuc: 11.1 libc info: glibc: 2.33 $SHELL (typically, interactive shell): /usr/bin/zsh

Next: brian m. carlson
Message 1 of 18 in “[BUG] `git reset --hard` fails with `update = none` submodules”
  1. Rose KunkelJun 16, 2021
  2. brian m. carlsonJun 16, 2021
  3. Rose KunkelJun 16, 2021
  4. Rose KunkelJun 16, 2021
  5. Rose KunkelJun 16, 2021
  6. brian m. carlsonJun 16, 2021
  7. Rose KunkelJun 16, 2021
  8. Rose KunkelJun 16, 2021
  9. Junio C HamanoJun 16, 2021
  10. Philippe BlainJun 16, 2021
  11. brian m. carlsonJun 17, 2021
  12. submodule: mark submodules with update=none as inactivebrian m. carlson, Jun 19, 2021
  13. Philippe BlainJun 22, 2021
  14. brian m. carlsonJun 25, 2021
  15. Philippe BlainJun 26, 2021
  16. submodule: mark submodules with update=none as inactivebrian m. carlson, Jul 1, 2021
  17. Philippe BlainJul 9, 2021
  18. brian m. carlsonJul 11, 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.