Git development
 help / color / mirror / Atom feed
* discussion: sha1/sha256 repositories and convert_commit_object
@ 2026-10-21 17:37 Adam Majer
  2026-10-21 22:21 ` brian m. carlson
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Majer @ 2026-10-21 17:37 UTC (permalink / raw)
  To: git; +Cc: brian m. carlson, Eric W. Biederman

Hi,

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.

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.


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.

Best regards,
- Adam

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-24 11:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 17:37 discussion: sha1/sha256 repositories and convert_commit_object Adam Majer
2026-10-21 22:21 ` brian m. carlson
2026-10-24 11:31   ` Adam Majer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox