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

Re: Questions about the hash function transition

From
Derrick Stolee <stolee@gmail.com>
Date
Aug 28, 2018, 12:49 UTC
Message-ID
<c098b0c6-1062-6581-81a9-7ce15f3738de@gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1808281402510.73@tvgsbejvaqbjf.bet>
On 8/28/2018 8:04 AM, Johannes Schindelin wrote:
Show 21 quoted lines
> Hi,
>
> On Thu, 23 Aug 2018, Jonathan Nieder wrote:
>
>> Ævar Arnfjörð Bjarmason wrote:
>>
>> [...]
>>>> Since all operations that make new objects (e.g., "git commit") add
>>>> the new objects to the corresponding index, this mapping is possible
>>>> for all objects in the object store.
>>> Are we going to need a midx version of these mapping files? How does
>>> midx fit into this picture? Perhaps it's too obscure to worry about...
>> That's a great question!  I think the simplest answer is to have a
>> midx only for the primary object format and fall back to using
>> ordinary idx files for the others.
>>
>> The midx format already has a field for hash function (thanks,
>> Derrick!).
> Related: I wondered whether we could simply leverage the midx code for the
> bidirectional SHA-1 <-> SHA-256 mapping, as it strikes me as very similar
> in concept and challenges.
If we would like such a mapping, then I would propose the following:
1. The object store has everything in SHA-256, so the HASH_LEN parameter 
of the multi-pack-index is 32.
2. We create an optional chunk to add to the multi-pack-index that 
stores the SHA-1 for each object. This list would be in lex order.
3. We create two optional chunks that store the bijection between 
SHA-256 and SHA-1: the first is a list of integers i_0, i_1, ..., 
i_{N-1} such that i_k is the position in the SHA-1 list corresponding to 
the kth SHA-256. The second is a list of integers j_0, j_1, ..., j_{N-1} 
such that j_k is the position in the SHA-256 list of the kth SHA-1.

I'm not super-familiar with how the transition plan specifically needs this mapping, but it seems like a good place to put it.

Thanks,
-Stolee
Previous: Johannes SchindelinNext: Jonathan Nieder
Message 11 of 33 in “Questions about the hash function transition”
  1. Ævar Arnfjörð BjarmasonAug 23, 2018
  2. Junio C HamanoAug 23, 2018
  3. Ævar Arnfjörð BjarmasonAug 23, 2018
  4. Junio C HamanoAug 23, 2018
  5. brian m. carlsonAug 24, 2018
  6. Jonathan NiederAug 24, 2018
  7. brian m. carlsonAug 24, 2018
  8. Jonathan NiederAug 24, 2018
  9. Jonathan NiederAug 24, 2018
  10. Johannes SchindelinAug 28, 2018
  11. Derrick StoleeAug 28, 2018
  12. Jonathan NiederAug 28, 2018
  13. Jonathan NiederAug 28, 2018
  14. Johannes SchindelinAug 29, 2018
  15. Derrick StoleeAug 29, 2018
  16. Derrick StoleeAug 29, 2018
  17. How is the ^{sha256} peel syntax supposed to work?Ævar Arnfjörð Bjarmason, Aug 29, 2018
  18. Stefan BellerAug 29, 2018
  19. Jonathan NiederAug 29, 2018
  20. Stefan BellerAug 29, 2018
  21. Ævar Arnfjörð BjarmasonAug 29, 2018
  22. Jonathan NiederAug 29, 2018
  23. Ævar Arnfjörð BjarmasonAug 29, 2018
  24. Jonathan NiederAug 29, 2018
  25. Jeff KingAug 29, 2018
  26. Junio C HamanoAug 29, 2018
  27. Jonathan NiederAug 29, 2018
  28. Jonathan NiederAug 29, 2018
  29. Jonathan NiederAug 24, 2018
  30. Ævar Arnfjörð BjarmasonAug 28, 2018
  31. Edward ThomsonAug 28, 2018
  32. Ævar Arnfjörð BjarmasonAug 28, 2018
  33. Junio C HamanoAug 28, 2018

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.