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

Re: Git fetch bug in git 2.21+ "Could not access submodule '%s'"

From
PPPaolo Pettinato (ppettina) <ppettina@cisco.com>
Date
Aug 14, 2019, 17:03 UTC
Message-ID
<5a58b0eb-0690-c445-dbfd-bd4c5b614629@cisco.com>
In-Reply-To
<xmqqpnl766pj.fsf@gitster-ct.c.googlers.com>
Thanks for the reply!
On 14/08/2019 17:40, Junio C Hamano wrote:
Show 5 quoted lines
>   Why is the user mucking with
> that directory in the first place, and isn't the flagging of the
> situation as an error, done with 26f80ccf ("submodule: migrate
> get_next_submodule to use repository structs", 2018-11-28), a
> bugfix?  If not, why not?
Not sure if you're implying here that this is not a bug; I'd say that:
- Mucking about with a folder that's supposed to contain a submodule is 
not something that a lot of people do (and we worked around the issue), 
and people shouldn't do that, but...
- ... regardless, I believe that "git fetch" shouldn't particularly care 
about the state of the current working directory. I didn't ask it to do 
anything with the submodules, nor have I initialised them. In my 
(limited) knowledge of git, I'd expect git fetch to do its magic 
entirely between the remote and the .git folder.

Our use case was for a submodule containing encrypted secrets; and the mucking about was stubbing out those secrets in a test build without fetching/decrypting them.

It's arguable whether this should be fixed or not; less arguable that we could use a better error message and consistency (1st execution fails, 2nd does not).

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 8 in “Git fetch bug in git 2.21+ "Could not access submodule '%s'"”
  1. Paolo Pettinato (ppettina)Aug 14, 2019
  2. Jeff KingAug 14, 2019
  3. Junio C HamanoAug 14, 2019
  4. Paolo Pettinato (ppettina)Aug 14, 2019
  5. Junio C HamanoAug 14, 2019
  6. Jeff KingAug 14, 2019
  7. get_next_submodule(): format error string as an errorJeff King, Aug 14, 2019
  8. Junio C HamanoAug 14, 2019

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.