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

Re: force deterministic trees on git push - exact sort-order of filenames

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Oct 17, 2021, 16:10 UTC
Message-ID
<87ilxvd3uw.fsf@evledraar.gmail.com>
In-Reply-To
<CAGiEHCtdjA+cVXjN43NPbSZfrDtr-kDtPMN4x_VTGSJuPZ8bcg@mail.gmail.com>
On Fri, Oct 15 2021, milan hauth wrote:
> backward compatibility:
> rewriting git history is usually not desired.
> so this new rule would apply only to new commits
> after a certain 'deadline', set by the git server

Others have commented on the status quo, but just on this: "git fsck" will report these, and if it doesn't that's a bug. Grep for "TREE_NOT_SORTED" in git.git for the code.

But in general this sort of plan for disallowing "bad" data doesn't really work all that well. People want to e.g. switch hosting providers, and will need to re-push old bad data with a new push.

I suppose there could be more strictures in the fsck code to allow for that use-case, but still make some things that are mere warnings now hard errors (or "fatal").

E.g. allowing it based on a more thorough inspection of the history, or treat commits differently if their envelope timestamp is past some cut-off (which right now we don't care about).

For a self-hosted installation with some specific old bad data I was also able to turn on tighter strictures and whitelist specific OIDs with fsck.skipList, I don't know if any of the big providers use that.

Previous: milan hauthNext: Junio C Hamano
Message 5 of 6 in “force deterministic trees on git push - exact sort-order of filenames”
  1. milan hauthOct 15, 2021
  2. René ScharfeOct 15, 2021
  3. Junio C HamanoOct 15, 2021
  4. milan hauthOct 15, 2021
  5. Ævar Arnfjörð BjarmasonOct 17, 2021
  6. Junio C HamanoOct 18, 2021

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.