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

Re: git fails to checkout SHA1 submodule in SHA256 repo with --depth=1

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 15, 2025, 20:14 UTC
Message-ID
<aRjfGT_4QT4ANlVx@fruit.crustytoothpaste.net>
In-Reply-To
<b434bcb1-bf6e-4fe7-af2d-8c33348378fa@xiplink.com>
On 2025-11-14 at 22:55:07, Marc Branchaud wrote:
Show 7 quoted lines
> Set up SHA256 mirrors of the SHA1 repos you want to track in submodules?
> 
> I'm assuming that it would be easy to keep such mirrors up to date.  I'm not
> familiar enough with Brian's work to know if a SHA256 repo can have
> a SHA1 remote (which would mean that updates would just be a simple "git
> fetch origin"), but even if that's not possible I'm guessing that scripting
> some kind of regularly-run translation of new commits wouldn't be too hard.

You can set up a repository which supports both algorithms (for instance, a SHA-256 main algorithm and SHA-1 compatibility) and then interoperate with both algorithms, so yes, this is possible and it really is as easy as `git fetch origin` once set up.

The current constraint is that the cloned repository must be a full clone (not shallow or partial) and it must not have any submodules itself.

Of course, that's what the interoperability work does and it's not finished or even mostly upstreamed. As I said, it's mostly functional, but it's not production ready. It also fails many tests because we have many tests in our testsuite that require partial or shallow clones, whose support is in progress.

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Previous: Marc BranchaudNext: brian m. carlson
Message 8 of 21 in “git fails to checkout SHA1 submodule in SHA256 repo with --depth=1”
  1. Martin WilckNov 12, 2025
  2. Junio C HamanoNov 12, 2025
  3. brian m. carlsonNov 12, 2025
  4. Martin WilckNov 13, 2025
  5. brian m. carlsonNov 13, 2025
  6. Martin WilckNov 13, 2025
  7. Marc BranchaudNov 14, 2025
  8. brian m. carlsonNov 15, 2025
  9. object-file: disallow adding submodules of different hash algobrian m. carlson, Nov 12, 2025
  10. Jeff KingNov 13, 2025
  11. Jeff KingNov 13, 2025
  12. Junio C HamanoNov 13, 2025
  13. brian m. carlsonNov 14, 2025
  14. Jeff KingNov 15, 2025
  15. brian m. carlsonNov 13, 2025
  16. 1/2 object-file: disallow adding submodules of different hash algobrian m. carlson, Nov 15, 2025
  17. 2/2 read-cache: drop submodule check from add_to_cache()brian m. carlson, Nov 15, 2025
  18. Junio C HamanoNov 15, 2025
  19. brian m. carlsonNov 15, 2025
  20. Junio C HamanoNov 15, 2025
  21. Martin WilckNov 17, 2025

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.