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

Re: [PATCH 06/14] packfile: express constants in terms of the_hash_algo

From
Stefan Beller <sbeller@google.com>
Date
Oct 9, 2018, 22:34 UTC
Message-ID
<CAGZ79kbADWhuwk=7jzht5wZkESgT5ZqhhBOkGYGkC1HSSvExEA@mail.gmail.com>
In-Reply-To
<20181009222516.GR432229@genre.crustytoothpaste.net>

On Tue, Oct 9, 2018 at 3:25 PM brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 29 quoted lines
>
> On Mon, Oct 08, 2018 at 03:59:36PM -0700, Stefan Beller wrote:
> > On Mon, Oct 8, 2018 at 2:57 PM brian m. carlson
> > <sandals@crustytoothpaste.net> wrote:
> > >
> > > Replace uses of GIT_SHA1_RAWSZ with references to the_hash_algo to avoid
> > > dependence on a particular hash length.
> >
> > Unlike the previous patches, this is dealing directly with packfiles,
> > which (I would think) carry their own hash function selector?
> > (i.e. packfiles up to version 4 are sha1 hardcoded and version
> > 5 and onwards will have a hash type field. Usually that hash type would
> > match what is in the_repository, but you could obtain packfiles
> > out of band, or the translation table that we plan to have might
> > be part of the packfile/idx file?)
>
> Yeah, the transition plan doesn't specify a format for pack files, but
> we may end up needing one.  We definitely have a specified format for
> index files already, and that's where the translation table will be.
> Anything other than the pack index and the loose object index in the
> .git directory will have the same algorithm as the rest of the
> repository, so technically we could use any pack format as long as it
> lives in the .git directory.
>
> This code is mostly here on an interim basis to let us compile with a
> fully SHA-256 (no SHA-1) Git.  Once that piece is done, we can move on
> to a stage 4 Git, which can do either only SHA-256, or only SHA-1, where
> we'll learn about various pack file formats and detecting the algorithm
> from them.

This second paragraph really helps to put things into perspective, thanks! I assume this interim base of code only applies to this patch? (In that case maybe put it into the commit message?)

Previous: brian m. carlsonNext: brian m. carlson
Message 10 of 30 in “Hash function transition part 15”
  1. 00/14 Hash function transition part 15brian m. carlson, Oct 8, 2018
  2. 01/14 pack-bitmap-write: use GIT_MAX_RAWSZ for allocationbrian m. carlson, Oct 8, 2018
  3. 02/14 builtin/repack: replace hard-coded constantbrian m. carlson, Oct 8, 2018
  4. Stefan BellerOct 8, 2018
  5. Eric SunshineOct 8, 2018
  6. brian m. carlsonOct 9, 2018
  7. 06/14 packfile: express constants in terms of the_hash_algobrian m. carlson, Oct 8, 2018
  8. Stefan BellerOct 8, 2018
  9. brian m. carlsonOct 9, 2018
  10. Stefan BellerOct 9, 2018
  11. brian m. carlsonOct 9, 2018
  12. 03/14 builtin/mktree: remove hard-coded constantbrian m. carlson, Oct 8, 2018
  13. Stefan BellerOct 8, 2018
  14. 04/14 builtin/fetch-pack: remove constants with parse_oid_hexbrian m. carlson, Oct 8, 2018
  15. 05/14 pack-revindex: express constants in terms of the_hash_algobrian m. carlson, Oct 8, 2018
  16. Stefan BellerOct 8, 2018
  17. brian m. carlsonOct 9, 2018
  18. 07/14 refs/packed-backend: express constants using the_hash_algobrian m. carlson, Oct 8, 2018
  19. 08/14 upload-pack: express constants in terms of the_hash_algobrian m. carlson, Oct 8, 2018
  20. 10/14 tag: express constant in terms of the_hash_algobrian m. carlson, Oct 8, 2018
  21. 09/14 transport: use parse_oid_hex instead of a constantbrian m. carlson, Oct 8, 2018
  22. 11/14 apply: replace hard-coded constantsbrian m. carlson, Oct 8, 2018
  23. 12/14 apply: rename new_sha1_prefix and old_sha1_prefixbrian m. carlson, Oct 8, 2018
  24. 13/14 submodule: make zero-oid comparison hash function agnosticbrian m. carlson, Oct 8, 2018
  25. Stefan BellerOct 8, 2018
  26. 14/14 rerere: convert to use the_hash_algobrian m. carlson, Oct 8, 2018
  27. Stefan BellerOct 8, 2018
  28. object_id.cocci: match only expressions of type 'struct object_id'SZEDER Gábor, Oct 12, 2018
  29. Junio C HamanoOct 15, 2018
  30. Junio C HamanoOct 15, 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.