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

[PATCH 00/28] Hash-independent tests (part 2)

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
May 6, 2018, 23:17 UTC
Message-ID
<20180506231752.975110-1-sandals@crustytoothpaste.net>
This is part 2 in the series to make tests hash independent.

This series introduces an SHA1 prerequisite which checks if the hash in use is SHA-1, and can be used to skip the test if it is not. Additionally, because NewHash will be 256-bit, I introduced aliases for the test constants $_x40 and $_z40 which will be less confusing when the hash isn't 40 hex characters long. I opted to leave the old names in place for the moment to prevent any potential conflicts with other series and will clean up any stragglers later.

Several tests are skipped because of SHA-1-specific dependencies: some of these are core tests which test basic expected hash values, some depend on colliding short names, and some depend on specially named object (the pack tests).

Elsewhere, tests are modified to compute values using git hash-object and git rev-parse. There is one cleanup patch that fixes indentation so we can use an indented heredoc in the following patch.

The order in this series is by patch type, then roughly by test number.

All of these tests pass with an alternate 160-bit hash as well as SHA-1. An additional series cleaning up the remainder of the tests is required to make the entire testsuite pass with an alternate 160-bit hash.

brian m. carlson (28):
  t/test-lib: add an SHA1 prerequisite
  t/test-lib: introduce ZERO_OID
  t: switch $_z40 to $ZERO_OID
  t/test-lib: introduce FULL_HEX
  t: switch $_x40 to $FULL_HEX
  t0000: annotate with SHA1 prerequisite
  t1007: annotate with SHA1 prerequisite
  t1512: skip test if not using SHA-1
  t4044: skip test if not using SHA-1
  t: skip pack tests if not using SHA-1
  t2203: abstract away SHA-1-specific constants
  t3103: abstract away SHA-1-specific constants
  t3702: abstract away SHA-1-specific constants
  t3905: abstract away SHA-1-specific constants
  t4007: abstract away SHA-1-specific constants
  t4008: abstract away SHA-1-specific constants
  t4014: abstract away SHA-1-specific constants
  t4020: abstract away SHA-1-specific constants
  t4022: abstract away SHA-1-specific constants
  t4029: fix test indentation
  t4029: abstract away SHA-1-specific constants
  t4030: abstract away SHA-1-specific constants
  t/lib-diff-alternative: abstract away SHA-1-specific constants
  t4205: sort log output in a hash-independent way
  t4042: abstract away SHA-1-specific constants
  t4045: abstract away SHA-1-specific constants
  t4208: abstract away SHA-1-specific constants
  t5300: abstract away SHA-1-specific constants
 t/diff-lib.sh                       |  4 +-
 t/lib-diff-alternative.sh           | 12 ++++--
 t/t0000-basic.sh                    | 24 ++++++------
 t/t0090-cache-tree.sh               |  2 +-
 t/t1000-read-tree-m-3way.sh         |  2 +-
 t/t1001-read-tree-m-2way.sh         |  2 +-
 t/t1002-read-tree-m-u-2way.sh       |  2 +-
 t/t1006-cat-file.sh                 |  8 ++--
 t/t1007-hash-object.sh              | 16 ++++----
 t/t1012-read-tree-df.sh             |  2 +-
 t/t1400-update-ref.sh               |  2 +-
 t/t1407-worktree-ref-store.sh       |  8 ++--
 t/t1450-fsck.sh                     |  4 +-
 t/t1501-work-tree.sh                |  6 +--
 t/t1512-rev-parse-disambiguation.sh |  6 +++
 t/t1601-index-bogus.sh              |  2 +-
 t/t1700-split-index.sh              |  2 +-
 t/t2011-checkout-invalid-head.sh    |  2 +-
 t/t2025-worktree-add.sh             |  8 ++--
 t/t2027-worktree-list.sh            |  2 +-
 t/t2107-update-index-basic.sh       |  4 +-
 t/t2201-add-update-typechange.sh    | 16 ++++----
 t/t2203-add-intent.sh               | 14 +++----
 t/t3100-ls-tree-restrict.sh         |  2 +-
 t/t3101-ls-tree-dirname.sh          |  2 +-
 t/t3103-ls-tree-misc.sh             |  3 +-
 t/t3200-branch.sh                   |  4 +-
 t/t3510-cherry-pick-sequence.sh     |  8 ++--
 t/t3702-add-edit.sh                 |  7 ++--
 t/t3905-stash-include-untracked.sh  | 12 +++---
 t/t4002-diff-basic.sh               |  2 +-
 t/t4006-diff-mode.sh                |  2 +-
 t/t4007-rename-3.sh                 | 17 +++++----
 t/t4008-diff-break-rewrite.sh       | 59 ++++++++++++++++-------------
 t/t4014-format-patch.sh             | 11 +++---
 t/t4020-diff-external.sh            | 18 +++++----
 t/t4022-diff-rewrite.sh             |  5 ++-
 t/t4027-diff-submodule.sh           |  6 +--
 t/t4029-diff-trailing-space.sh      | 38 ++++++++++---------
 t/t4030-diff-textconv.sh            |  5 ++-
 t/t4042-diff-textconv-caching.sh    | 16 +++++---
 t/t4044-diff-index-unique-abbrev.sh |  6 +++
 t/t4045-diff-relative.sh            |  6 ++-
 t/t4046-diff-unmerged.sh            | 14 +++----
 t/t4054-diff-bogus-tree.sh          | 12 +++---
 t/t4058-diff-duplicates.sh          | 12 +++---
 t/t4150-am.sh                       |  4 +-
 t/t4200-rerere.sh                   |  2 +-
 t/t4201-shortlog.sh                 |  2 +-
 t/t4205-log-pretty-formats.sh       |  8 ++--
 t/t4208-log-magic-pathspec.sh       |  3 +-
 t/t5150-request-pull.sh             |  2 +-
 t/t5300-pack-object.sh              |  8 ++--
 t/t5308-pack-detect-duplicates.sh   |  6 +++
 t/t5309-pack-delta-cycles.sh        |  6 +++
 t/t5516-fetch-push.sh               | 22 +++++------
 t/t5527-fetch-odd-refs.sh           |  2 +-
 t/t5571-pre-push-hook.sh            |  8 ++--
 t/t6006-rev-list-format.sh          |  4 +-
 t/t6012-rev-list-simplify.sh        |  2 +-
 t/t6111-rev-list-treesame.sh        |  2 +-
 t/t6120-describe.sh                 |  2 +-
 t/t6300-for-each-ref.sh             |  2 +-
 t/t6301-for-each-ref-errors.sh      |  2 +-
 t/t7009-filter-branch-null-sha1.sh  |  2 +-
 t/t7011-skip-worktree-reading.sh    |  2 +-
 t/t7064-wtstatus-pv2.sh             | 58 ++++++++++++++--------------
 t/t7506-status-submodule.sh         |  2 +-
 t/t9010-svn-fe.sh                   | 14 +++----
 t/t9300-fast-import.sh              |  6 +--
 t/test-lib.sh                       | 11 +++++-
 71 files changed, 331 insertions(+), 268 deletions(-)
Next: brian m. carlson
Message 1 of 46 in “Hash-independent tests (part 2)”
  1. 00/28 Hash-independent tests (part 2)brian m. carlson, May 6, 2018
  2. 01/28 t/test-lib: add an SHA1 prerequisitebrian m. carlson, May 6, 2018
  3. Martin ÅgrenMay 7, 2018
  4. brian m. carlsonMay 7, 2018
  5. Martin ÅgrenMay 8, 2018
  6. brian m. carlsonMay 8, 2018
  7. 02/28 t/test-lib: introduce ZERO_OIDbrian m. carlson, May 6, 2018
  8. 03/28 t: switch $_z40 to $ZERO_OIDbrian m. carlson, May 6, 2018
  9. 04/28 t/test-lib: introduce FULL_HEXbrian m. carlson, May 6, 2018
  10. Eric SunshineMay 6, 2018
  11. brian m. carlsonMay 7, 2018
  12. 05/28 t: switch $_x40 to $FULL_HEXbrian m. carlson, May 6, 2018
  13. 06/28 t0000: annotate with SHA1 prerequisitebrian m. carlson, May 6, 2018
  14. Martin ÅgrenMay 7, 2018
  15. brian m. carlsonMay 7, 2018
  16. Martin ÅgrenMay 8, 2018
  17. brian m. carlsonMay 9, 2018
  18. 07/28 t1007: annotate with SHA1 prerequisitebrian m. carlson, May 6, 2018
  19. 09/28 t4044: skip test if not using SHA-1brian m. carlson, May 6, 2018
  20. 10/28 t: skip pack tests if not using SHA-1brian m. carlson, May 6, 2018
  21. Martin ÅgrenMay 7, 2018
  22. 12/28 t3103: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  23. 11/28 t2203: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  24. 14/28 t3905: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  25. Eric SunshineMay 7, 2018
  26. brian m. carlsonMay 7, 2018
  27. 16/28 t4008: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  28. Eric SunshineMay 7, 2018
  29. brian m. carlsonMay 7, 2018
  30. 17/28 t4014: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  31. 20/28 t4029: fix test indentationbrian m. carlson, May 6, 2018
  32. 21/28 t4029: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  33. 22/28 t4030: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  34. 24/28 t4205: sort log output in a hash-independent waybrian m. carlson, May 6, 2018
  35. 25/28 t4042: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  36. 23/28 t/lib-diff-alternative: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  37. 27/28 t4208: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  38. 28/28 t5300: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  39. 26/28 t4045: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  40. 18/28 t4020: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  41. 19/28 t4022: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  42. 08/28 t1512: skip test if not using SHA-1brian m. carlson, May 6, 2018
  43. 15/28 t4007: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  44. 13/28 t3702: abstract away SHA-1-specific constantsbrian m. carlson, May 6, 2018
  45. Eric SunshineMay 7, 2018
  46. brian m. carlsonMay 7, 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.