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

Re: [PATCH 3/3] setup: fix reinit of repos with incompatible GIT_DEFAULT_HASH

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 31, 2025, 22:40 UTC
Message-ID
<xmqqr04i61zo.fsf@gitster.g>
In-Reply-To
<20250130-b4-pks-reinit-default-ref-format-v1-3-d2769ca01207@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 6 quoted lines
> The exact same issue as described in the preceding commit also exists
> for GIT_DEFAULT_HASH. Thus, reinitializing a repository that e.g. uses
> SHA1 with `GIT_DEFAULT_HASH=sha256 git init` will cause the object
> format of that repository to change to SHA256. This is of course bogus
> as any existing objects and refs will not be converted, thus causing
> repository corruption:

The exact same comment on silently ignoring applies, but unlike the previous one, converting the entire history is far more expensive, so it may be much less likely to be worth going the automatic conversion route than the previous one.

Thanks.
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 4 of 11 in “setup: fix reinit of repos with different formats”
  1. 0/3 setup: fix reinit of repos with different formatsPatrick Steinhardt, Jan 30, 2025
  2. 1/3 t0001: remove duplicate testPatrick Steinhardt, Jan 30, 2025
  3. 3/3 setup: fix reinit of repos with incompatible GIT_DEFAULT_HASHPatrick Steinhardt, Jan 30, 2025
  4. Junio C HamanoJan 31, 2025
  5. 2/3 setup: fix reinit of repos with incompatible GIT_DEFAULT_REF_FORMATPatrick Steinhardt, Jan 30, 2025
  6. Junio C HamanoJan 30, 2025
  7. Junio C HamanoJan 31, 2025
  8. Patrick SteinhardtFeb 3, 2025
  9. Junio C HamanoFeb 3, 2025
  10. Patrick SteinhardtFeb 3, 2025
  11. brian m. carlsonJan 30, 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.