Git development
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Scott Chacon <schacon@gmail.com>
Subject: Re: a "limbo" object-format state for empty repositories?
Date: Sat, 3 Oct 2026 01:07:48 +0000	[thread overview]
Message-ID: <asBVY1WniGUo6bQS@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <20261002224400.GA834158@coredump.intra.peff.net>

[-- Attachment #1: Type: text/plain, Size: 2379 bytes --]

On 2026-10-02 at 22:44:00, Jeff King wrote:
> It would be nice if the empty repository could adapt to the object
> format used by its first push. Then everything would just work from the
> user's perspective, no matter what they push.

I agree that would be nice.

> So what I'm suggesting instead is that the server be allowed to
> advertise a limbo state: it has no object format yet. And then client
> can recognize object-format=limbo, and send back "I'm a <sha1|sha256>
> repo, so that's what I'm sending you" in its capabilities response.  And
> then the server receives that and shifts its local object-format to
> match.
> 
> There are some tricky bits on the server side (e.g., you'd want to flip
> the value atomically so that if you get two simultaneous mismatched
> pushes, one of them gets rejected). But I can't think of any reason that
> it couldn't conceptually work, and I feel like it would save a lot of
> headaches.
> 
> But I also did just think of this idea, and haven't implemented anything
> (nor do I have immediate plans to). So it might be half-baked. But I
> thought I'd toss it out there and see if any body has thoughts, or feels
> strongly enough to try implementing it.

That is definitely something that could be added, but it's also
incompatible with every existing implementation.  Specifically using the
`object-format=limbo` approach means that no existing client from 2.29
on will work with the repository since `limbo` is not a valid hash
algorithm.

There is some support for multiple `object-format` directives, but I
don't know how well it works and I seem to remember that we had some
sort of crasher bug in the past.  That would be the best possible way to
advertise that, though, if older versions support it.

There are also going to be some policy decisions, for instance.  Some
organizations will not want to allow one algorithm or the other, so
Git will need some way to allow that behaviour to be expressed.  Or more
likely, Git needs some way to allow the fact that it's in versatile
mode to be expressed and that it's safe to rewrite the config on initial
write into the repository (which, to be clear, need not be a push; it
could also be a commit or add).

All that being said, it's not impossible, but it's also not easy.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]

  reply	other threads:[~2026-10-03  1:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 22:44 a "limbo" object-format state for empty repositories? Jeff King
2026-10-03  1:07 ` brian m. carlson [this message]
2026-10-03  1:25   ` Jeff King
2026-10-03 14:22     ` brian m. carlson
2026-10-05  3:30       ` Jeff King
2026-10-03  1:31   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=asBVY1WniGUo6bQS@fruit.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=schacon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox