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

Re: [PATCH 26/26] midx: switch to using the_hash_algo

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Aug 23, 2019, 02:17 UTC
Message-ID
<20190823021757.GL365197@genre.crustytoothpaste.net>
In-Reply-To
<4f6b781b-68b8-5bc4-92a2-67caff32024f@gmail.com>
On 2019-08-22 at 14:04:16, Derrick Stolee wrote:
Show 15 quoted lines
> On 8/18/2019 4:04 PM, brian m. carlson wrote:
> > diff --git a/midx.c b/midx.c
> > index d649644420..f29afc0d2d 100644
> > --- a/midx.c
> > +++ b/midx.c
> > @@ -19,8 +19,7 @@
> >  #define MIDX_BYTE_NUM_PACKS 8
> >  #define MIDX_HASH_VERSION 1
> 
> This hash version "1" is the same as we used in the commit-graph. It's
> a byte value from the file format, and we've already discussed how it
> would have been better to use the 4-byte identifier, but that ship has
> sailed. I'm just pointing this out to say that we are not done in this
> file yet, but we can get to that when we want to test the midx with
> multiple hash lengths.

My approach so far has been to assume everything in the .git directory is in the same hash except for the translation functionality. Therefore, it doesn't make sense to distinguish between hashes in the midx files, because we'll never have files that differ in hash. So essentially the MIDX_HASH_VERSION being 1 is "whatever hash is being used in the .git directory", not just SHA-1.

In addition, the current multi-pack index format isn't capable (from my reading of the documentation, at least) of handling multiple hash algorithms at once. So we'd need a midx v2 format for folks who are using SHA-256 with SHA-1 compatibility and we could then write separate sets of object chunks with an appropriate format identifier, much like the proposed pack index v3.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Derrick StoleeNext: Derrick Stolee
Message 31 of 33 in “object_id part 17”
  1. 00/26 object_id part 17brian m. carlson, Aug 18, 2019
  2. 01/26 builtin/replace: make hash size independentbrian m. carlson, Aug 18, 2019
  3. 04/26 builtin/receive-pack: switch to use the_hash_algobrian m. carlson, Aug 18, 2019
  4. 03/26 fetch-pack: use parse_oid_hexbrian m. carlson, Aug 18, 2019
  5. 02/26 patch-id: convert to use the_hash_algobrian m. carlson, Aug 18, 2019
  6. René ScharfeAug 20, 2019
  7. brian m. carlsonAug 20, 2019
  8. Junio C HamanoAug 22, 2019
  9. 07/26 blame: remove needless comparison with GIT_SHA1_HEXSZbrian m. carlson, Aug 18, 2019
  10. 11/26 combine-diff: replace GIT_SHA1_HEXSZ with the_hash_algobrian m. carlson, Aug 18, 2019
  11. 10/26 bundle: switch to use the_hash_algobrian m. carlson, Aug 18, 2019
  12. 09/26 connected: switch GIT_SHA1_HEXSZ to the_hash_algobrian m. carlson, Aug 18, 2019
  13. 05/26 builtin/blame: switch uses of GIT_SHA1_HEXSZ to the_hash_algobrian m. carlson, Aug 18, 2019
  14. 06/26 builtin/rev-parse: switch to use the_hash_algobrian m. carlson, Aug 18, 2019
  15. 16/26 pack-write: use hash_to_hex when writing checksumsbrian m. carlson, Aug 18, 2019
  16. 17/26 builtin/repack: write object IDs of the proper lengthbrian m. carlson, Aug 18, 2019
  17. 19/26 cache: remove null_sha1brian m. carlson, Aug 18, 2019
  18. 18/26 builtin/worktree: switch null_sha1 to null_oidbrian m. carlson, Aug 18, 2019
  19. 20/26 wt-status: convert struct wt_status to object_idbrian m. carlson, Aug 18, 2019
  20. 15/26 sequencer: convert to use the_hash_algobrian m. carlson, Aug 18, 2019
  21. 12/26 config: use the_hash_algo in abbrev comparisonbrian m. carlson, Aug 18, 2019
  22. 21/26 packfile: replace sha1_to_hexbrian m. carlson, Aug 18, 2019
  23. 14/26 bisect: switch to using the_hash_algobrian m. carlson, Aug 18, 2019
  24. 22/26 builtin/index-pack: replace sha1_to_hexbrian m. carlson, Aug 18, 2019
  25. 25/26 builtin/show-index: replace sha1_to_hexbrian m. carlson, Aug 18, 2019
  26. 24/26 rerere: replace sha1_to_hexbrian m. carlson, Aug 18, 2019
  27. 08/26 show-index: switch hard-coded constants to the_hash_algobrian m. carlson, Aug 18, 2019
  28. 23/26 builtin/receive-pack: replace sha1_to_hexbrian m. carlson, Aug 18, 2019
  29. 26/26 midx: switch to using the_hash_algobrian m. carlson, Aug 18, 2019
  30. Derrick StoleeAug 22, 2019
  31. brian m. carlsonAug 23, 2019
  32. Derrick StoleeAug 23, 2019
  33. 13/26 sha1-lookup: switch hard-coded constants to the_hash_algobrian m. carlson, Aug 18, 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.