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

Possible bug with shallow git submodules

From
JPJack Pearson <jackrpearson@protonmail.com>
Date
Sep 21, 2020, 04:05 UTC
Message-ID
<TL-eiJO9bgDXcADhNSFRNxeW0f_E_j81jXXUbGjW-1Rib26LB8OViFEeH0ptC3i0px33kk3xKghYr4bYiiHuKSFXwMNAUIh7jisIZeVpQBQ=@protonmail.com>
When I create a shallow submodule, the submodule doesn't stay shallow after the submodule's remote changes if the submodule is re-fetched as a result of fresh clone, or a result of manually deleting the submodule's .git folder.

Detailed reproduction instructions here: https://gist.github.com/jpear1/0ffc28e8167d00504fba54d50ec4848d

Maybe related is another problem I've noticed with git submodules:
I'm unable to discard commits by moving the tracked commit backwards (with git reset) in a shallow submodule (the .git/modules/<mod-name>/shallow file doesn't update properly).
Basically it seems like the submodule is using the latest shallow "root" it can find in the branch's history of gitlinks and not allowing me to use anything but that. I'm not sure if this is really what's going on though.

I go into more detail in an SO post here: https://stackoverflow.com/questions/63976876

Message 1 of 1 in “Possible bug with shallow git submodules”
  1. Jack PearsonSep 21, 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.