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

Possible bug in Git submodule update --inti

From
Bbech <bech>
Date
Nov 18, 2024, 08:14 UTC
Message-ID
<DB9PR10MB709879A45AABEC017F3E89DF8A272@DB9PR10MB7098.EURPRD10.PROD.OUTLOOK.COM>
Hi

I am trying to replace a submodule of a repository with a rewritten version. Somebody added a huge json file without enabling lfs, so I cannot move the submodule to GitHub without the rewrite.

The path of the submodule is: ./Submodules/Lodam.Standard, which I have no intensions of changing.

The url of the original submodule is: https://lodamrd.visualstudio.com/Features.Net/_git/Lodam.Standard The url of the rewritten submodule is: https://lodamrd.visualstudio.com/Features.Net/_git/Uniware.Standard

I planned to do a: git submodule deinit -f <path-to-submodule> git submodule set-url -- <path-to-submodule> <new-url> git submodule update --init <path-to-submodule>

But actually the sources for the submodule is fetched from the original (same commit SHAs  as before), whereas if I do:

git submodule deinit -f <path-to-submodule> git submodule set-url -- <path-to-submodule> <new-url> git clone <new-url> <path-to-submodule>

I get the submodule from the new url with the rewritten commit SHA’s.
I have attached the PowerShell output with trace information. I am unfamiliar with git trace, but from line 203 I can see the old url mentioned, where I would expect the new url.
Best regards

Søren Bech Christensen Software Engineer BITZER Electronics A/S PC Software Team Kærvej 75 6400 Sønderborg // Denmark Direct: +45 73 42 37 70 Phone: +45 73 42 37 37 Mobile: +45 25 44 49 65 Email: Soeren.Bech@bitzerdk.com

Next: Philippe Blain
Message 1 of 3 in “Possible bug in Git submodule update --inti”
  1. bechNov 18, 2024
  2. Philippe BlainNov 18, 2024
  3. Junio C HamanoNov 19, 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.