From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Adam Majer <adamm@zombino.com>
Cc: git@vger.kernel.org, "Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: discussion: sha1/sha256 repositories and convert_commit_object
Date: Wed, 21 Oct 2026 22:21:20 +0000 [thread overview]
Message-ID: <atk63xoG773PzGq7@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <ce3756bc-704c-41ff-bf8a-c060a2848aeb@zombino.com>
[-- Attachment #1: Type: text/plain, Size: 2925 bytes --]
On 2026-10-21 at 17:37:13, Adam Majer wrote:
> Hi,
Hey,
> I'm been experimenting with having both OID types in a repository. First, I
> tried nodejs, which failed due to missing submodules, so I could not import
> it.. Then I tried linux. This proved somewhat more problematic.
>
> I've been using convert_commit_object to convert a commit from one OID type
> to another. The current implementation of convert_commit_object function has
> some comments about requiring to convert all types of OID references. These
> includes mergetag and it just bails on other, unknown headers.
>
> In the linux tree, some dozen or so mergetags contain references that do not
> seem to be fetchable from anywhere.
I had noticed that the mergetags were not in Linus's repository, but I
hadn't tried other repositories on kernel.org.
> Also, a number of commits in linux history contains these unknown headers:
>
> ab5af2903baa472930c94a421efdd22a49036213:
> predecessor bc6a71940d5182103469a479d12f4266ac155a39
> predecessor-op rebase
>
> 3a413ece2504c70aa34a20be4dafec04e8c741f9:
> predecessor 86d97728d053d6584be5592480ff3687d3d616ab
> predecessor-op amend
>
> And the objects references here are unavailable.
We won't try to convert arbitrary headers like this. However, I'm fine
with us skipping those headers so that their commits can be converted.
> How can we deal with these if we ever want to have the sha1-sha256 interop?
> If we require stubborn adherence to 1-1 mappings of all OIDs, these
> repositories cannot ever be imported into sha256 repositories with their
> histories. Even recent commits cause issues here as git is not holding on to
> referenced objects.
>
> Would it be possible to have a little different approach? For example,
> mergetag headers and other unknown headers, maybe we can consider these as
> just text and copy verbatim in convert_commit_object? I understand this
> would result in different commit ids, depending if coming originally from
> sha256 or sha1 repo, but since git is not really preserving references to
> these objects anyway, this may call for a little flexibility.
I don't think I converted mergetag entries in my original series. The
problem is that if we don't convert them, then we also can't validate
them because we don't know what data they point to. We don't make
assumptions based on the size of the hash because in the future we might
also have SHA3-256 or BLAKE2b-256.
That means that the original point of the mergetags, to preserve the
signature and contents of the original tag, would be useless. That
doesn't mean we couldn't skip converting them, but it does mean that if
we do so, we should probably just stop writing those headers because
they're no longer fit for purpose and we should consider them a failed
implementation.
--
brian m. carlson (they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]
next prev parent reply other threads:[~2026-10-21 22:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 17:37 discussion: sha1/sha256 repositories and convert_commit_object Adam Majer
2026-10-21 22:21 ` brian m. carlson [this message]
2026-10-24 11:31 ` Adam Majer
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=atk63xoG773PzGq7@fruit.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=adamm@zombino.com \
--cc=ebiederm@xmission.com \
--cc=git@vger.kernel.org \
/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