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

Re: [RFC PATCH 0/2] alternate hash test

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jan 28, 2018, 19:16 UTC
Message-ID
<20180128191605.GI431130@genre.crustytoothpaste.net>
In-Reply-To
<CACBZZX4TRuPV8j9XV=8gAMirQNTpEJBO8bmE9KBnnmoJ7b_m1g@mail.gmail.com>
On Sun, Jan 28, 2018 at 07:58:10PM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
> On Sun, Jan 28, 2018 at 6:06 PM, brian m. carlson
> <sandals@crustytoothpaste.net> wrote:
> If the goal is to smoke out hardcoded SHA1s in tests, isn't it easier
> to instrument SHA-1 (e.g. our blk_sha1 copy, or our wrappers) to
> pretend that whenever we ask for the hash for STRING to pretend we
> asked for SOME_PREFIX + STRING?
> 
> Such an approach would have the advantage of being more portable
> (easier to run these mock test), and also that if we ever move to
> NewHash we could still test for this, we'd just always set the prefix
> to compilation time(), and could thus guarantee that the hashes would
> change every time git was built.

That's certainly a possibility. We could simply call the update function from the init function and prepend a NUL byte or something like that, which would definitely produce different results.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: https://keybase.io/bk2204
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 6 of 9 in “alternate hash test”
  1. 0/2 alternate hash testbrian m. carlson, Jan 28, 2018
  2. 2/2 Switch default hash algorithm to short BLAKE2b for testingbrian m. carlson, Jan 28, 2018
  3. 1/2 Base test implementation for short BLAKE2b supportbrian m. carlson, Jan 28, 2018
  4. SZEDER GáborJan 28, 2018
  5. Ævar Arnfjörð BjarmasonJan 28, 2018
  6. brian m. carlsonJan 28, 2018
  7. Junio C HamanoJan 30, 2018
  8. Stefan BellerJan 31, 2018
  9. brian m. carlsonFeb 1, 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.