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

[PATCH v2 00/11] Hash-independent tests (part 3)

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Aug 19, 2018, 17:53 UTC
Message-ID
<20180819175351.449973-1-sandals@crustytoothpaste.net>

This is next in the series of improvements to make tests hash-independent.

This round modifies the helpers to more closely follow the lighter-weight design that Eric Sunshine suggested in v1, at the cost of requiring lookup keys to be shell identifiers. If that's judged to be undesirable, I can always hash the key before use.

Since we've decided on SHA-256, I put in an extra commit to update t0000 and remove the use of the SHA1 prerequisite. As described in the commit message, I wrote a Ruby script to synthesize the SHA-1 and SHA-256 blobs and then used a second one to generate the trees, using the same methodology for both algorithms. I did this specifically to ensure that the object IDs are exactly the ones we think they are.

Changes from v1:
* Adopt pure shell approach for helper.
* Add tests for the helpers.
* Explicitly refer to SHA-256 now that we know it will be NewHash.
* Updated t0000 to remove SHA1 prerequisite.
* Change name of helper from test_translate to test_oid.
* Add helper to cache information in the shell.
* Simplified lookup of HEAD in t0002.
* Switched to using existing helper function in t0027.
* Simplified handling of IDs in t0064.
brian m. carlson (11):
  t: add tool to translate hash-related values
  t0000: use hash translation table
  t0000: update tests for SHA-256
  t0002: abstract away SHA-1 specific constants
  t0027: make hash size independent
  t0064: make hash size independent
  t1006: make hash size independent
  t1400: switch hard-coded object ID to variable
  t1405: make hash size independent
  t1406: make hash-size independent
  t1407: make hash size independent
 t/oid-info/hash-info           |   8 ++
 t/oid-info/oid                 |  29 ++++++
 t/oid-info/t0000               |  38 ++++++++
 t/t0000-basic.sh               | 168 ++++++++++++++++++++-------------
 t/t0002-gitfile.sh             |  26 ++---
 t/t0027-auto-crlf.sh           |   3 +-
 t/t0064-sha1-array.sh          |  49 +++++-----
 t/t1006-cat-file.sh            |   6 +-
 t/t1400-update-ref.sh          |   2 +-
 t/t1405-main-ref-store.sh      |   4 +-
 t/t1406-submodule-ref-store.sh |   6 +-
 t/t1407-worktree-ref-store.sh  |   4 +-
 t/test-lib-functions.sh        |  36 +++++++
 13 files changed, 267 insertions(+), 112 deletions(-)
 create mode 100644 t/oid-info/hash-info
 create mode 100644 t/oid-info/oid
 create mode 100644 t/oid-info/t0000
Next: brian m. carlson
Message 1 of 24 in “Hash-independent tests (part 3)”
  1. 00/11 Hash-independent tests (part 3)brian m. carlson, Aug 19, 2018
  2. 01/11 t: add tool to translate hash-related valuesbrian m. carlson, Aug 19, 2018
  3. Eric SunshineAug 19, 2018
  4. brian m. carlsonAug 19, 2018
  5. Eric SunshineAug 19, 2018
  6. brian m. carlsonAug 19, 2018
  7. 02/11 t0000: use hash translation tablebrian m. carlson, Aug 19, 2018
  8. Eric SunshineAug 19, 2018
  9. 03/11 t0000: update tests for SHA-256brian m. carlson, Aug 19, 2018
  10. Eric SunshineAug 19, 2018
  11. brian m. carlsonAug 19, 2018
  12. 04/11 t0002: abstract away SHA-1 specific constantsbrian m. carlson, Aug 19, 2018
  13. Eric SunshineAug 19, 2018
  14. 05/11 t0027: make hash size independentbrian m. carlson, Aug 19, 2018
  15. Eric SunshineAug 19, 2018
  16. brian m. carlsonAug 19, 2018
  17. Eric SunshineAug 19, 2018
  18. Torsten BögershausenAug 20, 2018
  19. 06/11 t0064: make hash size independentbrian m. carlson, Aug 19, 2018
  20. 07/11 t1006: make hash size independentbrian m. carlson, Aug 19, 2018
  21. 08/11 t1400: switch hard-coded object ID to variablebrian m. carlson, Aug 19, 2018
  22. 09/11 t1405: make hash size independentbrian m. carlson, Aug 19, 2018
  23. 10/11 t1406: make hash-size independentbrian m. carlson, Aug 19, 2018
  24. 11/11 t1407: make hash size independentbrian m. carlson, Aug 19, 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.