git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: "Git List" <git@vger.kernel.org>, "Jeff King" <peff@peff.net>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Torsten Bögershausen" <tboegi@web.de>
Subject: Re: [PATCH v2 02/11] t0000: use hash translation table
Date: Sun, 19 Aug 2018 15:54:09 -0400	[thread overview]
Message-ID: <CAPig+cTmSN3CGGW0ws2K-CHrvVon4W+iFS_MdTxSY-TP6OUh1Q@mail.gmail.com> (raw)
In-Reply-To: <20180819175351.449973-3-sandals@crustytoothpaste.net>

On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson
<sandals@crustytoothpaste.net> wrote:
> If the hash we're using is 32 bytes in size, attempting to insert a
> 20-byte object name won't work.  Since these are synthesized objects
> that are almost all zeros, look them up in a translation table.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
> diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
> @@ -1007,12 +1007,13 @@ test_expect_success SHA1 'validate object ID for a known tree' '
>  test_expect_success 'put invalid objects into the index' '
>         rm -f .git/index &&
> -       [...]
> +       suffix=$(echo $ZERO_OID | sed -e "s/^.//") &&

What's this "suffix" thing for? I don't see it used anywhere.

> +       cat >badobjects <<-EOF &&
> +       100644 blob $(test_oid 001)     dir/file1
> +       100644 blob $(test_oid 002)     dir/file2
> +       100644 blob $(test_oid 003)     dir/file3
> +       100644 blob $(test_oid 004)     dir/file4
> +       100644 blob $(test_oid 005)     dir/file5

So, test_oid() knows about these keys because the patch 1/11 loaded
them via test_oid_cache(). Are the keys in oid-info/hash-info and
oid-info/oid going to be needed by multiple scripts? If so, I'm
wondering if it would make more sense to have test-lib-functions.sh
load them instead of expecting each script to do so. Another
possibility is to have a test_oid_init() function in
test-lib-functions.sh which both loads that low-level information and
initializes the hash algorithm.

>         EOF
>         git update-index --index-info <badobjects
>  '

  reply	other threads:[~2018-08-19 19:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-19 17:53 [PATCH v2 00/11] Hash-independent tests (part 3) brian m. carlson
2018-08-19 17:53 ` [PATCH v2 01/11] t: add tool to translate hash-related values brian m. carlson
2018-08-19 19:40   ` Eric Sunshine
2018-08-19 21:50     ` brian m. carlson
2018-08-19 23:06       ` Eric Sunshine
2018-08-19 23:56         ` brian m. carlson
2018-08-19 17:53 ` [PATCH v2 02/11] t0000: use hash translation table brian m. carlson
2018-08-19 19:54   ` Eric Sunshine [this message]
2018-08-19 17:53 ` [PATCH v2 03/11] t0000: update tests for SHA-256 brian m. carlson
2018-08-19 20:01   ` Eric Sunshine
2018-08-19 21:53     ` brian m. carlson
2018-08-19 17:53 ` [PATCH v2 04/11] t0002: abstract away SHA-1 specific constants brian m. carlson
2018-08-19 20:05   ` Eric Sunshine
2018-08-19 17:53 ` [PATCH v2 05/11] t0027: make hash size independent brian m. carlson
2018-08-19 20:10   ` Eric Sunshine
2018-08-19 21:57     ` [PATCH v2 05/11] t0027: make hash size independent' brian m. carlson
2018-08-19 22:10       ` Eric Sunshine
2018-08-20 14:29         ` Torsten Bögershausen
2018-08-19 17:53 ` [PATCH v2 06/11] t0064: make hash size independent brian m. carlson
2018-08-19 17:53 ` [PATCH v2 07/11] t1006: " brian m. carlson
2018-08-19 17:53 ` [PATCH v2 08/11] t1400: switch hard-coded object ID to variable brian m. carlson
2018-08-19 17:53 ` [PATCH v2 09/11] t1405: make hash size independent brian m. carlson
2018-08-19 17:53 ` [PATCH v2 10/11] t1406: make hash-size independent brian m. carlson
2018-08-19 17:53 ` [PATCH v2 11/11] t1407: make hash size independent 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

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

  git send-email \
    --in-reply-to=CAPig+cTmSN3CGGW0ws2K-CHrvVon4W+iFS_MdTxSY-TP6OUh1Q@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    --cc=tboegi@web.de \
    /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.
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 NNTP newsgroup(s).