git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Martin Ågren" <martin.agren@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Johannes Sixt" <j6t@kdbg.org>,
	"Stefan Beller" <sbeller@google.com>
Subject: [PATCH v4 00/28] Hash-independent tests
Date: Mon, 21 May 2018 02:01:19 +0000	[thread overview]
Message-ID: <20180521020147.648496-1-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <20180516015630.661349-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.

This version addresses the concerns raised about robustness in case git
hash-object fails in an unexpected way.  We now have better error
handling for that case by performing git rev-parse and git hash-object
in separate steps.

Changes from v3:
* Switch a use of egrep to grep.

Changes from v2:
* Split out git rev-parse --short and git hash-object into separate
  stages for better error handling.

Changes from v1:
* Amend commit message to indicate that we *will* be updating tests
  annotated with the SHA1 prerequisite to work with NewHash.
* Rename FULL_HEX to OID_REGEX.
* Regenerate patch for OID_REGEX.
* Update variable name from "link_oid" to "slink_id" for consistency
  while still preserving alignment.
* Restore blank line between tests.

tbdiff output below.

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 OID_REGEX
  t: switch $_x40 to $OID_REGEX
  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  | 11 ++++--
 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             | 13 ++++---
 t/t4020-diff-external.sh            | 20 ++++++----
 t/t4022-diff-rewrite.sh             |  6 ++-
 t/t4027-diff-submodule.sh           |  6 +--
 t/t4029-diff-trailing-space.sh      | 40 ++++++++++---------
 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, 338 insertions(+), 267 deletions(-)

tbdiff output:

 1: 1a2e23b4f8 =  1: 1a2e23b4f8 t/test-lib: add an SHA1 prerequisite
 2: 809ac7d7c3 =  2: 809ac7d7c3 t/test-lib: introduce ZERO_OID
 3: 1394616579 =  3: 1394616579 t: switch $_z40 to $ZERO_OID
 4: adbbf8af80 =  4: adbbf8af80 t/test-lib: introduce OID_REGEX
 5: 77877cd04e =  5: 77877cd04e t: switch $_x40 to $OID_REGEX
 6: 41c01b5fcf =  6: 41c01b5fcf t0000: annotate with SHA1 prerequisite
 7: c175f5d565 =  7: c175f5d565 t1007: annotate with SHA1 prerequisite
 8: 936a8d90fd =  8: 936a8d90fd t1512: skip test if not using SHA-1
 9: 18a2c50777 =  9: 18a2c50777 t4044: skip test if not using SHA-1
10: bdb27df589 = 10: bdb27df589 t: skip pack tests if not using SHA-1
11: d09b454988 = 11: d09b454988 t2203: abstract away SHA-1-specific constants
12: 61c93d4d8a = 12: 61c93d4d8a t3103: abstract away SHA-1-specific constants
13: 2fdf7883c2 ! 13: 6feff69ca3 t3702: abstract away SHA-1-specific constants
    @@ -42,7 +42,7 @@
      	test_cmp orig-patch expected-patch &&
     -	git diff --cached > out &&
     +	git diff --cached >actual &&
    -+	egrep -v "^index " actual >out &&
    ++	grep -v index actual >out &&
      	test_cmp out expected
      
      '
14: 9e99a40aa1 = 14: 5757803c65 t3905: abstract away SHA-1-specific constants
15: ad45ab6bed = 15: 8c15820942 t4007: abstract away SHA-1-specific constants
16: 56a69fbe23 = 16: 64379d7965 t4008: abstract away SHA-1-specific constants
17: c47c098f00 = 17: 0cff429a92 t4014: abstract away SHA-1-specific constants
18: 73a639c361 = 18: 641b02a9a8 t4020: abstract away SHA-1-specific constants
19: 4bd0bae327 = 19: 230a1bd927 t4022: abstract away SHA-1-specific constants
20: 2d7c33aff5 = 20: fab02197f7 t4029: fix test indentation
21: 009f98c0ba = 21: d0efb5f67c t4029: abstract away SHA-1-specific constants
22: 97bbd51a80 = 22: 447f45d17b t4030: abstract away SHA-1-specific constants
23: 743fc9151d = 23: 3afc4fb173 t/lib-diff-alternative: abstract away SHA-1-specific constants
24: 8fd963968b = 24: efe882137b t4205: sort log output in a hash-independent way
25: 9bf0d6ef62 = 25: cbd17e556b t4042: abstract away SHA-1-specific constants
26: 42d9cfaa1a = 26: 188b5f7c73 t4045: abstract away SHA-1-specific constants
27: e66a684559 = 27: 527f8653d7 t4208: abstract away SHA-1-specific constants
28: 1ca2b3478d = 28: fd522b90fe t5300: abstract away SHA-1-specific constants

  parent reply	other threads:[~2018-05-21  2:02 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  1:56 [PATCH v3 00/28] Hash-independent tests brian m. carlson
2018-05-16  1:56 ` [PATCH v3 01/28] t/test-lib: add an SHA1 prerequisite brian m. carlson
2018-05-16  1:56 ` [PATCH v3 02/28] t/test-lib: introduce ZERO_OID brian m. carlson
2018-05-16  1:56 ` [PATCH v3 03/28] t: switch $_z40 to $ZERO_OID brian m. carlson
2018-05-16  1:56 ` [PATCH v3 04/28] t/test-lib: introduce OID_REGEX brian m. carlson
2018-05-16  1:56 ` [PATCH v3 05/28] t: switch $_x40 to $OID_REGEX brian m. carlson
2018-05-16  1:56 ` [PATCH v3 06/28] t0000: annotate with SHA1 prerequisite brian m. carlson
2018-05-16  1:56 ` [PATCH v3 07/28] t1007: " brian m. carlson
2018-05-16 16:56   ` Stefan Beller
2018-05-16 23:10     ` brian m. carlson
2018-05-16  1:56 ` [PATCH v3 08/28] t1512: skip test if not using SHA-1 brian m. carlson
2018-05-16  1:56 ` [PATCH v3 09/28] t4044: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 10/28] t: skip pack tests " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 11/28] t2203: abstract away SHA-1-specific constants brian m. carlson
2018-05-16  1:56 ` [PATCH v3 12/28] t3103: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 13/28] t3702: " brian m. carlson
2018-05-16 17:18   ` Stefan Beller
2018-05-16 23:46     ` brian m. carlson
2018-05-16  1:56 ` [PATCH v3 14/28] t3905: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 15/28] t4007: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 16/28] t4008: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 17/28] t4014: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 18/28] t4020: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 19/28] t4022: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 20/28] t4029: fix test indentation brian m. carlson
2018-05-16  1:56 ` [PATCH v3 21/28] t4029: abstract away SHA-1-specific constants brian m. carlson
2018-05-16  1:56 ` [PATCH v3 22/28] t4030: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 23/28] t/lib-diff-alternative: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 24/28] t4205: sort log output in a hash-independent way brian m. carlson
2018-05-16  1:56 ` [PATCH v3 25/28] t4042: abstract away SHA-1-specific constants brian m. carlson
2018-05-16  1:56 ` [PATCH v3 26/28] t4045: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 27/28] t4208: " brian m. carlson
2018-05-16  1:56 ` [PATCH v3 28/28] t5300: " brian m. carlson
2018-05-21  2:01 ` brian m. carlson [this message]
2018-05-21  2:01   ` [PATCH v4 01/28] t/test-lib: add an SHA1 prerequisite brian m. carlson
2018-05-21  2:01   ` [PATCH v4 02/28] t/test-lib: introduce ZERO_OID brian m. carlson
2018-05-21  2:01   ` [PATCH v4 03/28] t: switch $_z40 to $ZERO_OID brian m. carlson
2018-05-21  2:01   ` [PATCH v4 04/28] t/test-lib: introduce OID_REGEX brian m. carlson
2018-05-21  2:01   ` [PATCH v4 05/28] t: switch $_x40 to $OID_REGEX brian m. carlson
2018-05-21  2:01   ` [PATCH v4 06/28] t0000: annotate with SHA1 prerequisite brian m. carlson
2018-05-21  2:01   ` [PATCH v4 07/28] t1007: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 08/28] t1512: skip test if not using SHA-1 brian m. carlson
2018-05-21  2:01   ` [PATCH v4 09/28] t4044: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 10/28] t: skip pack tests " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 11/28] t2203: abstract away SHA-1-specific constants brian m. carlson
2018-05-21  2:01   ` [PATCH v4 12/28] t3103: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 13/28] t3702: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 14/28] t3905: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 15/28] t4007: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 16/28] t4008: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 17/28] t4014: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 18/28] t4020: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 19/28] t4022: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 20/28] t4029: fix test indentation brian m. carlson
2018-05-21  2:01   ` [PATCH v4 21/28] t4029: abstract away SHA-1-specific constants brian m. carlson
2018-05-21  2:01   ` [PATCH v4 22/28] t4030: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 23/28] t/lib-diff-alternative: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 24/28] t4205: sort log output in a hash-independent way brian m. carlson
2018-05-21  2:01   ` [PATCH v4 25/28] t4042: abstract away SHA-1-specific constants brian m. carlson
2018-05-21  2:01   ` [PATCH v4 26/28] t4045: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 27/28] t4208: " brian m. carlson
2018-05-21  2:01   ` [PATCH v4 28/28] t5300: " brian m. carlson
2018-05-21 13:17   ` [PATCH v4 00/28] Hash-independent tests Ben Peart
2018-05-21 23:08     ` brian m. carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180521020147.648496-1-sandals@crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=martin.agren@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=sbeller@google.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).