git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 00/31] Hash function transition part 16

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 12, 2019, 01:22 UTC
Message-ID
<20190212012256.1005924-1-sandals@crustytoothpaste.net>

This is the sixteenth series of hash function transition patches. This series contains various fixes, mostly focused around the pack bitmap code, the HTTP code, the archive code, the index, and parts of our Perl code.

This is the second to last series required for a "stage 0" Git; that is, one that can operate only with SHA-256, but not SHA-1. Observers will notice a focus on getting rid of sha1_to_hex and null_sha1 as well as the normal types of transforms; the next series will remove both of these.

This series modifies the index code such that it can work with a hash algorithm of any length. In order to do so, the structs involved were changed to use flex array members and not store the hash in a fixed array member. This design was chosen over a multiple struct approach because it ensures that we have one consistent, well-tested code path that works for both algorithms, as well as any algorithms in the future. Comments on the approach or arguments for other designs are welcome.

This is a rather long series, but most of it is concentrated in a few small areas, so hopefully it's a little easier to review because of that.

To preview the series that come after this, there is an additional series for stage 0 Git (object-id-part17 plus part of sha256-fixes), plus potentially several series of test fixes (test-fixes-part4 and part of sha256-fixes). Following that, I plan to introduce, under the DEVELOPER Makefile flag, the actual code which supports extensions.objectFormat and makes it so that it works (transition-stage-4).

brian m. carlson (31):
  t/lib-submodule-update: use appropriate length constant
  pack-bitmap: make bitmap header handling hash agnostic
  pack-bitmap: convert struct stored_bitmap to object_id
  pack-bitmap: replace sha1_to_hex
  pack-bitmap: switch hard-coded constants to the_hash_algo
  submodule: avoid hard-coded constants
  notes-merge: switch to use the_hash_algo
  notes: make hash size independent
  notes: replace sha1_to_hex
  object-store: rename and expand packed_git's sha1 member
  builtin/name-rev: make hash-size independent
  fast-import: make hash-size independent
  fast-import: replace sha1_to_hex
  builtin/am: make hash size independent
  builtin/pull: make hash-size independent
  http-push: convert to use the_hash_algo
  http-backend: allow 64-character hex names
  http-push: remove remaining uses of sha1_to_hex
  http-walker: replace sha1_to_hex
  http: replace hard-coded constant with the_hash_algo
  http: compute hash of downloaded objects using the_hash_algo
  http: replace sha1_to_hex
  remote-curl: make hash size independent
  archive-tar: make hash size independent
  archive: convert struct archiver_args to object_id
  refspec: make hash size independent
  builtin/difftool: use parse_oid_hex
  dir: make untracked cache extension hash size independent
  read-cache: read data in a hash-independent way
  Git.pm: make hash size independent
  gitweb: make hash size independent
 archive-tar.c               |  7 ++--
 archive-zip.c               | 10 ++---
 archive.c                   |  8 ++--
 archive.h                   |  2 +-
 builtin/am.c                |  9 +++--
 builtin/difftool.c          |  6 +--
 builtin/get-tar-commit-id.c | 11 +++++-
 builtin/name-rev.c          | 14 ++++---
 builtin/pack-redundant.c    |  2 +-
 builtin/pull.c              |  5 ++-
 dir.c                       | 28 +++++++-------
 fast-import.c               | 48 +++++++++++++-----------
 gitweb/gitweb.perl          | 63 ++++++++++++++++---------------
 http-backend.c              |  3 ++
 http-push.c                 | 29 ++++++++-------
 http-walker.c               | 18 ++++-----
 http.c                      | 33 +++++++++--------
 http.h                      |  2 +-
 merge-recursive.c           |  2 +-
 notes-merge.c               |  6 +--
 notes.c                     | 44 +++++++++++-----------
 object-store.h              |  2 +-
 pack-bitmap-write.c         |  8 ++--
 pack-bitmap.c               | 20 +++++-----
 pack-bitmap.h               |  2 +-
 packfile.c                  |  6 +--
 perl/Git.pm                 |  2 +-
 read-cache.c                | 74 +++++++++++++++----------------------
 refspec.c                   |  2 +-
 remote-curl.c               | 11 +++---
 submodule.c                 |  2 +-
 t/lib-submodule-update.sh   |  3 +-
 32 files changed, 246 insertions(+), 236 deletions(-)
Next: brian m. carlson
Message 1 of 56 in “Hash function transition part 16”
  1. 00/31 Hash function transition part 16brian m. carlson, Feb 12, 2019
  2. 01/31 t/lib-submodule-update: use appropriate length constantbrian m. carlson, Feb 12, 2019
  3. 03/31 pack-bitmap: convert struct stored_bitmap to object_idbrian m. carlson, Feb 12, 2019
  4. 02/31 pack-bitmap: make bitmap header handling hash agnosticbrian m. carlson, Feb 12, 2019
  5. 05/31 pack-bitmap: switch hard-coded constants to the_hash_algobrian m. carlson, Feb 12, 2019
  6. Ævar Arnfjörð BjarmasonFeb 12, 2019
  7. 04/31 pack-bitmap: replace sha1_to_hexbrian m. carlson, Feb 12, 2019
  8. Jeff KingFeb 12, 2019
  9. brian m. carlsonFeb 13, 2019
  10. Jeff KingFeb 14, 2019
  11. 08/31 notes: make hash size independentbrian m. carlson, Feb 12, 2019
  12. Eric SunshineFeb 12, 2019
  13. brian m. carlsonFeb 12, 2019
  14. 09/31 notes: replace sha1_to_hexbrian m. carlson, Feb 12, 2019
  15. 11/31 builtin/name-rev: make hash-size independentbrian m. carlson, Feb 12, 2019
  16. 06/31 submodule: avoid hard-coded constantsbrian m. carlson, Feb 12, 2019
  17. 10/31 object-store: rename and expand packed_git's sha1 memberbrian m. carlson, Feb 12, 2019
  18. Eric SunshineFeb 12, 2019
  19. brian m. carlsonFeb 14, 2019
  20. 14/31 builtin/am: make hash size independentbrian m. carlson, Feb 12, 2019
  21. 15/31 builtin/pull: make hash-size independentbrian m. carlson, Feb 12, 2019
  22. Eric SunshineFeb 12, 2019
  23. 13/31 fast-import: replace sha1_to_hexbrian m. carlson, Feb 12, 2019
  24. 17/31 http-backend: allow 64-character hex namesbrian m. carlson, Feb 12, 2019
  25. 16/31 http-push: convert to use the_hash_algobrian m. carlson, Feb 12, 2019
  26. 12/31 fast-import: make hash-size independentbrian m. carlson, Feb 12, 2019
  27. Eric SunshineFeb 12, 2019
  28. brian m. carlsonFeb 12, 2019
  29. 18/31 http-push: remove remaining uses of sha1_to_hexbrian m. carlson, Feb 12, 2019
  30. 20/31 http: replace hard-coded constant with the_hash_algobrian m. carlson, Feb 12, 2019
  31. 22/31 http: replace sha1_to_hexbrian m. carlson, Feb 12, 2019
  32. 21/31 http: compute hash of downloaded objects using the_hash_algobrian m. carlson, Feb 12, 2019
  33. 23/31 remote-curl: make hash size independentbrian m. carlson, Feb 12, 2019
  34. Ævar Arnfjörð BjarmasonFeb 12, 2019
  35. 19/31 http-walker: replace sha1_to_hexbrian m. carlson, Feb 12, 2019
  36. Eric SunshineFeb 12, 2019
  37. 29/31 read-cache: read data in a hash-independent waybrian m. carlson, Feb 12, 2019
  38. 28/31 dir: make untracked cache extension hash size independentbrian m. carlson, Feb 12, 2019
  39. Ævar Arnfjörð BjarmasonFeb 12, 2019
  40. brian m. carlsonFeb 13, 2019
  41. 25/31 archive: convert struct archiver_args to object_idbrian m. carlson, Feb 12, 2019
  42. 26/31 refspec: make hash size independentbrian m. carlson, Feb 12, 2019
  43. 31/31 gitweb: make hash size independentbrian m. carlson, Feb 12, 2019
  44. Ævar Arnfjörð BjarmasonFeb 12, 2019
  45. 30/31 Git.pm: make hash size independentbrian m. carlson, Feb 12, 2019
  46. Ævar Arnfjörð BjarmasonFeb 12, 2019
  47. brian m. carlsonFeb 18, 2019
  48. Ævar Arnfjörð BjarmasonFeb 18, 2019
  49. 24/31 archive-tar: make hash size independentbrian m. carlson, Feb 12, 2019
  50. René ScharfeFeb 12, 2019
  51. René ScharfeFeb 12, 2019
  52. brian m. carlsonFeb 13, 2019
  53. 27/31 builtin/difftool: use parse_oid_hexbrian m. carlson, Feb 12, 2019
  54. Eric SunshineFeb 12, 2019
  55. 07/31 notes-merge: switch to use the_hash_algobrian m. carlson, Feb 12, 2019
  56. Ævar Arnfjörð BjarmasonFeb 12, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.