git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Taylor Blau <me@ttaylorr.com>, git@vger.kernel.org
Subject: Re: When should we release Git 3.0?
Date: Wed, 1 Oct 2025 22:42:12 +0000	[thread overview]
Message-ID: <aN2uRCbajBhZT08V@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <xmqqecrm1hs1.fsf@gitster.g>

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

On 2025-10-01 at 20:36:14, Junio C Hamano wrote:
> What is the recommended workflow if you have unpublished work,
> written back in your private SHA-1 clone of a project, meant to be
> submit someday to your project, that used to use SHA-1 but has
> migrated to SHA-256?  Convert locally your repository to SHA-256
> primary with SHA-1 compat and then push to them?

We don't have support to add an algorithm to an existing repository
(although that is a desired feature).  If that existed, you could add
SHA-256 as a compatibility algorithm to your SHA-1 repository and push,
or in any interoperability scenario, you could create a SHA-1 main
remote with SHA-256 compatibility, push your changes there, and then
push from there to the server.

The interoperability work requires that the client support the server's
main algorithm for pushes.  This is because with protocol v2, the client
gets a capability advertisement with supported algorithms and can choose
one for the operation.  With protocol v0, the server sends capabilities
as a read-only (GET) operation along with the refs and doesn't allow the
algorithm to be chosen, so it's impossible to get a ref advertisement in
anything but the main algorithm.  Since protocol v2 doesn't support
pushes, we can only push things in the server's main algorithm.

For the avoidance of doubt, I have no intention of adding support for
protocol v2 for pushes.  That would be a nice feature and it would allow
lifting that restriction, but I also have a responsibility to myself to
not explode the scope of this project more than it already has.

> Presumably the server side _has_ already done most of the conversion
> work so, provided if (and this is a huge if) we assume that the
> conversion done on the server side is trustable, we should be able
> to _clone_ from the server in SHA-256 primary SHA-1 compat mode, and
> push your unpublished changes from your SHA-1 private repository
> into this clone using SHA-1 protocol (i.e. no conversion to the
> original repository)?  And upon accepting such a push, the receiving
> repository (which is still a local clone of the project, but the one
> you recently made and is aware of SHA-256 world) would now have your
> unpublished work in SHA-256 (with SHA-1 compat) objects and everybody
> is happy?

We always use only one algorithm in the protocol except when we need to
map shallows, objects missing in a partial clone, or submodules, in
which case we offer a mapping of those objects only.  The mapping is
always otherwise done on the client side if the client supports both
algorithms.

You can create a SHA-256/SHA-1 clone from the server (right now via
initializing a SHA-256 repo, adding SHA-1 manually, and then fetching)
and _pull_ your changes from your SHA-1 repo, though.  (Pushing from
SHA-1 into a SHA-256/SHA-1 clone doesn't work as I mentioned above.) You
could then push to the SHA-256 server.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

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

  reply	other threads:[~2025-10-01 22:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-30 23:07 When should we release Git 3.0? brian m. carlson
2025-10-01  7:13 ` Luca Milanesio
2025-10-01 16:04   ` Taylor Blau
2025-10-01 19:31     ` rsbecker
2025-10-08 21:44       ` Taylor Blau
2025-10-08 21:55         ` rsbecker
2025-10-02 13:31     ` Patrick Steinhardt
2025-10-02 15:32       ` Junio C Hamano
2025-10-02 16:10         ` Michal Suchánek
2025-10-07 10:27           ` Patrick Steinhardt
2025-10-07 10:36             ` Michal Suchánek
2025-10-07 13:21               ` Patrick Steinhardt
2025-10-07 13:40                 ` Michal Suchánek
2025-10-07 17:11                 ` Junio C Hamano
2025-10-07 17:28                   ` Michal Suchánek
2025-10-08 20:44             ` SZEDER Gábor
2025-10-09  5:56               ` Patrick Steinhardt
2025-10-02 16:54       ` Ben Knoble
2025-10-07 10:27         ` Patrick Steinhardt
2025-10-07 17:36           ` rsbecker
2025-10-08 22:05           ` Taylor Blau
2025-10-09  5:59             ` Patrick Steinhardt
2025-10-16 21:32             ` brian m. carlson
2025-10-08 21:59       ` Taylor Blau
2025-10-16 21:42         ` brian m. carlson
2025-10-02 22:33   ` brian m. carlson
2025-10-01 16:01 ` Taylor Blau
2025-10-01 16:20   ` Michal Suchánek
2025-10-01 22:16     ` brian m. carlson
2025-10-02 12:13       ` Michal Suchánek
2025-10-02 13:09         ` Michal Suchánek
2025-10-01 20:36   ` Junio C Hamano
2025-10-01 22:42     ` brian m. carlson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-10-08 19:06 James Frost
2025-10-09  5:30 ` Patrick Steinhardt

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=aN2uRCbajBhZT08V@fruit.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.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;
as well as URLs for NNTP newsgroup(s).