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

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Sun, 17 Oct 2021 18:10:27 +0200

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.