Skip to content

RFC SHA256 and SHA1 interoperability

Eric W. Biederman git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest32 patches 21 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/32doc hash-file-transition: A map file for mapping between sha1 and sha256Documentation/technical/hash-function-transition.txt+40 -04 replies
2/32doc hash-function-transition: Replace compatObjectFormat with compatMapDocumentation/technical/hash-function-transition.txt+8 -88 replies
3/32object-file-convert: Stubs for converting from one object format to anotherMakefile object-file-convert.c object-file-convert.h +1 more+163 -00 replies
4/32object-name: Initial support for ^{sha1} and ^{sha256}hash-ll.h object-name.c+55 -70 replies
5/32repository: add a compatibility hash algorithmrepository.h+3 -00 replies
6/32repository: Implement core.compatMapDocumentation/config/core.txt repository.c repository.h +2 more+24 -00 replies
7/32loose: add a mapping between SHA-1 and SHA-256 for loose objectsMakefile loose.c loose.h +4 more+288 -10 replies
8/32loose: Compatibilty short name supportloose.c+25 -120 replies
9/32object-file: Update the loose object map when writing loose objectsobject-file.c+76 -180 replies
10/32bulk-checkin: Only accept blobsbulk-checkin.c bulk-checkin.h object-file.c+26 -270 replies
11/32pack: Communicate the compat_oid through struct pack_idx_entrypack.h+1 -00 replies
12/32bulk-checkin: hash object with compatibility algorithmbulk-checkin.c+20 -41 reply
13/32object-file: Add a compat_oid_in parameter to write_object_file_flagscache-tree.c object-file.c object-store-ll.h+7 -50 replies
14/32commit: write commits for both hashescommit.c+131 -451 reply
15/32cache: add a function to read an OID of a specific algorithmhash.h+7 -20 replies
16/32object: Factor out parse_mode out of fast-import and tree-walk into in object.hbuiltin/fast-import.c object.h tree-walk.c+23 -350 replies
17/32object-file-convert: add a function to convert trees between algorithmsobject-file-convert.c+50 -10 replies
18/32object-file-convert: convert commit objects when writingobject-file-convert.c+44 -00 replies
19/32object-file-convert: convert tag commits when writingcommit.c commit.h object-file-convert.c+54 -30 replies
20/32builtin/cat-file: Let the oid determine the output algorithmbuiltin/cat-file.c+6 -20 replies
21/32tree-walk: init_tree_desc take an oid to get the hash algorithmarchive.c builtin/am.c builtin/checkout.c +25 more+80 -590 replies
22/32object-file: Handle compat objects in check_object_signatureobject-file.c+3 -10 replies
23/32builtin/ls-tree: Let the oid determine the output algorithmbuiltin/ls-tree.c+4 -10 replies
24/32builtin/pack-objects: Communicate the compatibility hash through struct pack_idx_entrybuiltin/pack-objects.c+7 -00 replies
25/32pack-compat-map: Add support for .compat files of a packfileMakefile builtin.h builtin/show-compat-map.c +8 more+705 -02 replies
26/32object-file-convert: Implement convert_object_file_{begin,step,end}object-file-convert.c object-file-convert.h+186 -611 reply
27/32builtin/fast-import: compute compatibility hashs for imported objectsbuiltin/fast-import.c+77 -120 replies
28/32builtin/index-pack: Add a simple oid indexbuiltin/index-pack.c+67 -10 replies
29/32builtin/index-pack: Compute the compatibility hashbuiltin/index-pack.c+328 -70 replies
30/32builtin/index-pack: Make the stack in compute_compat_oid explicitbuiltin/index-pack.c+71 -350 replies
31/32unpack-objects: Update to compute and write the compatibility hashesbuiltin/unpack-objects.c+7 -70 replies
32/32object-file-convert: Implement repo_submodule_oid_to_algopbuiltin/fast-import.c builtin/index-pack.c object-file-convert.c +1 more+57 -20 replies

Reviews trailers per patch

None of the 32 patches has a Reviewed-by or Acked-by.

Patchbrian m. carlson
1/32
2/32
3/32
4/32
5/32Inspired-by
6/32
7/32
8/32
9/32
10/32
11/32
12/32
13/32
14/32
15/32
16/32
17/32
18/32
19/32
20/32
21/32
22/32
23/32
24/32
25/32
26/32Inspired-by
27/32
28/32
29/32
30/32
31/32
32/32

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC][PATCH 0/32] SHA256 and SHA1 interoperability

I would like to see the SHA256 transition happen so I started playing with the k2204-transition-interop branch of brian m. carlson's tree.

Before I go farther I need to some other folks to look at this and see if this is a general direction that the git project can stand.

This patchset is not complete it does not implement converting a received pack of the compatibility hash into the hash function of the repository, nor have I written any automated tests. Both need to happen before this is finalized.

That said I think I have working implementations of all of the interesting cases. In particular I have "git index-pack" computing the compatibility hash of every object in a pack file, and I can tell you the sha256 of every sha1 in the git://git.kernel.org/pub/scm/git/git.git

To get there I have tweaked the transition plan a little.

So far I have just aimed for code that works, so there is doubtless room for improvement. My hope is that I have implemented enough that people can play with this, and that people can see all of the weird little details that need to be taken care of to make this work.

What do everyone else think? Does this direction look plausible?

Eric W. Biederman (24):
doc hash-file-transition: A map file for mapping between sha1 and sha256 doc hash-function-transition: Replace compatObjectFormat with compatMap
object-file-convert: Stubs for converting from one object format to another
object-name: Initial support for ^{sha1} and ^{sha256}
repository: add a compatibility hash algorithm
loose: Compatibilty short name support
object-file: Update the loose object map when writing loose objects
bulk-checkin: Only accept blobs
pack: Communicate the compat_oid through struct pack_idx_entry
object-file: Add a compat_oid_in parameter to write_object_file_flags
object: Factor out parse_mode out of fast-import and tree-walk into in object.h builtin/cat-file: Let the oid determine the output algorithm
tree-walk: init_tree_desc take an oid to get the hash algorithm
object-file: Handle compat objects in check_object_signature builtin/ls-tree: Let the oid determine the output algorithm builtin/pack-objects: Communicate the compatibility hash through struct pack_idx_entry
pack-compat-map: Add support for .compat files of a packfile
object-file-convert: Implement convert_object_file_{begin,step,end} builtin/fast-import: compute compatibility hashs for imported objects builtin/index-pack: Add a simple oid index
builtin/index-pack: Compute the compatibility hash
builtin/index-pack: Make the stack in compute_compat_oid explicit
unpack-objects: Update to compute and write the compatibility hashes
object-file-convert: Implement repo_submodule_oid_to_algop

brian m. carlson (8):
repository: Implement core.compatMap
loose: add a mapping between SHA-1 and SHA-256 for loose objects
bulk-checkin: hash object with compatibility algorithm
commit: write commits for both hashes
cache: add a function to read an OID of a specific algorithm
object-file-convert: add a function to convert trees between algorithms
object-file-convert: convert commit objects when writing
object-file-convert: convert tag commits when writing

 Documentation/config/core.txt                      |   6 +
 .../technical/hash-function-transition.txt         |  56 ++-
 Makefile                                           |   4 +
 archive.c                                          |   3 +-
 builtin.h                                          |   1 +
 builtin/am.c                                       |   6 +-
 builtin/cat-file.c                                 |   8 +-
 builtin/checkout.c                                 |   8 +-
 builtin/clone.c                                    |   2 +-
 builtin/commit.c                                   |   2 +-
 builtin/fast-import.c                              | 110 +++--
 builtin/grep.c                                     |   8 +-
 builtin/index-pack.c                               | 441 ++++++++++++++++++++-
 builtin/ls-tree.c                                  |   5 +-
 builtin/merge.c                                    |   3 +-
 builtin/pack-objects.c                             |  13 +-
 builtin/read-tree.c                                |   2 +-
 builtin/show-compat-map.c                          | 139 +++++++
 builtin/stash.c                                    |   5 +-
 builtin/unpack-objects.c                           |  14 +-
 bulk-checkin.c                                     |  55 ++-
 bulk-checkin.h                                     |   6 +-
 cache-tree.c                                       |   4 +-
 commit.c                                           | 176 +++++---
 commit.h                                           |   1 +
 delta-islands.c                                    |   2 +-
 diff-lib.c                                         |   2 +-
 fsck.c                                             |   6 +-
 git.c                                              |   1 +
 hash-ll.h                                          |   3 +
 hash.h                                             |   9 +-
 http-push.c                                        |   2 +-
 list-objects.c                                     |   2 +-
 loose.c                                            | 256 ++++++++++++
 loose.h                                            |  20 +
 match-trees.c                                      |   4 +-
 merge-ort.c                                        |  11 +-
 merge-recursive.c                                  |   2 +-
 merge.c                                            |   3 +-
 object-file-convert.c                              | 366 +++++++++++++++++
 object-file-convert.h                              |  50 +++
 object-file.c                                      | 197 +++++++--
 object-name.c                                      |  77 +++-
 object-store-ll.h                                  |  13 +-
 object.c                                           |   2 +
 object.h                                           |  18 +
 pack-bitmap-write.c                                |   2 +-
 pack-compat-map.c                                  | 334 ++++++++++++++++
 pack-compat-map.h                                  |  27 ++
 pack-write.c                                       | 158 ++++++++
 pack.h                                             |   1 +
 packfile.c                                         |  15 +-
 reflog.c                                           |   2 +-
 repository.c                                       |  17 +
 repository.h                                       |   4 +
 revision.c                                         |   4 +-
 setup.c                                            |   5 +
 setup.h                                            |   1 +
 tree-walk.c                                        |  58 ++-
 tree-walk.h                                        |   7 +-
 tree.c                                             |   2 +-
 walker.c                                           |   2 +-
 62 files changed, 2525 insertions(+), 238 deletions(-)

Eric