From patchwork Mon Jan 13 12:38:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330013 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66E4113A0 for ; Mon, 13 Jan 2020 12:40:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4545821739 for ; Mon, 13 Jan 2020 12:40:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="TMtjCclN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727286AbgAMMke (ORCPT ); Mon, 13 Jan 2020 07:40:34 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37614 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726943AbgAMMkd (ORCPT ); Mon, 13 Jan 2020 07:40:33 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id B35E9607F8; Mon, 13 Jan 2020 12:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919233; bh=NwYHtyx0uOjbzh6Yi98k3PN7tzgVmJ6Q23SkInWH7Xs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=TMtjCclN5kBA6Da1lvVv9846GiOsu13RfwdiKZMlWgveYWTazfxpOcEBbe8GW7LAi 3N5M4gfCKxG8xhoNG5b5/zVX8usK/bzAaoqF8TU08sVMhtcLR3wXdIHp8XJOwpTxe2 nGXIAguKCC7+Zeg2LY3dd3YvPxhdFi5mqTZbAYnuHgs90nK+mq01WwYvzZNKxo52Vj a2mASboiGb1y0BsotDBZeX/ZmbIfU2TRV/PNiqUgmo+XH6gtKwtsu+Qfioj1XLdCz/ tTpvd8guT+8HrWCySNM3qdy2U9CA70V3SQQ2hKgj5E/AztugStsWv6PS5OW67IFgIB YsObzD1/R2q6KAZuXGmbioDxUHrwEFLC8BjzMwvg5QeC6innlExVoyMEYSi+plptS0 A36tS3yq6t19El/Jl3KqCLpj8fKgCA0AdoMBBl6ehaWR7EjED12dAvPmK8lEZOihx5 86tzAJQYAsLzIAXsNyZ+ouEmivT7+DzWefTJeZi9DWmNSiRsjri From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 02/24] t3206: make hash size independent Date: Mon, 13 Jan 2020 12:38:35 +0000 Message-Id: <20200113123857.3684632-3-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Fix the one assertion in this test that still uses SHA-1 to use test_oid to be independent of the hash. Signed-off-by: brian m. carlson --- t/t3206-range-diff.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh index 0575dd72b1..bd808f87ed 100755 --- a/t/t3206-range-diff.sh +++ b/t/t3206-range-diff.sh @@ -102,6 +102,14 @@ test_expect_success 'setup' ' n3 sha256:3b0a644 n4 sha256:e461653 + # mode change + o1 sha1:4d39cb3 + o2 sha1:26c107f + o3 sha1:4c1e0f5 + o1 sha256:d0dd598 + o2 sha256:c4a279e + o3 sha256:78459d7 + # added and removed s1 sha1:096b1ba s2 sha1:d92e698 @@ -336,7 +344,7 @@ test_expect_success 'renamed file' ' test_expect_success 'file with mode only change' ' git range-diff --no-color --submodule=log topic...mode-only-change >actual && sed s/Z/\ /g >expect <<-EOF && - 1: fccce22 ! 1: 4d39cb3 s/4/A/ + 1: $(test_oid t2) ! 1: $(test_oid o1) s/4/A/ @@ Metadata ZAuthor: Thomas Rast Z @@ -352,7 +360,7 @@ test_expect_success 'file with mode only change' ' Z 7 + + ## other-file (new) ## - 2: 147e64e ! 2: 26c107f s/11/B/ + 2: $(test_oid t3) ! 2: $(test_oid o2) s/11/B/ @@ Metadata ZAuthor: Thomas Rast Z @@ -368,7 +376,7 @@ test_expect_success 'file with mode only change' ' Z 14 + + ## other-file (mode change 100644 => 100755) ## - 3: a63e992 = 3: 4c1e0f5 s/12/B/ + 3: $(test_oid t4) = 3: $(test_oid o3) s/12/B/ EOF test_cmp expect actual ' From patchwork Mon Jan 13 12:38:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330027 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A688F14E3 for ; Mon, 13 Jan 2020 12:40:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C0D32073D for ; Mon, 13 Jan 2020 12:40:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="xk8Ex8qK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728516AbgAMMkg (ORCPT ); Mon, 13 Jan 2020 07:40:36 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37620 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbgAMMke (ORCPT ); Mon, 13 Jan 2020 07:40:34 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 3BB17607F9; Mon, 13 Jan 2020 12:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919233; bh=wDdgFDb9VWvdgagIdzPUn+hIzxkzZ6XOKodpxFeqlqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=xk8Ex8qKLlSV51icDMCqxkM8rvT3KaJphaB2cQGH4I0I1Y3Ye+J2nkI38mSeDXoID e8hPrqaawLP8g+UkXvMfvNeG+Vzg/nHKP3mZJrOfTbcYFwQBzl+oVyzyWjHyQ4eaLr DD+o5ML4xOQiVyPPjscg/kQI81W+QI/mwAD1tiHxHMZ1YgdjZNA6pdFqrJeX5HCmQe HJecIBDrQmmGN0KPDcEljtTbykg+6M2zhUinTOC0XgEK0OFRBnvbmWiEl1JbfBOuuh rseaNkUXfvkYM6imOxTcsAUPzTKMZe+HjIBRi8/jgi6IwZvz3Oj+XxRHsD8qjHwvlq H0dO1/+uEd4rHOUGIJ99dnlQpXXlUId5ChgYBtRmIzMnS2ljhjbq2IPc2R7DEpvkZS 4iZxED0d+PkKy5LuNxkiUT3WEYGMC0kibM2omg7+IKG5jJsLHXdVHOO+SBcPRQGs9t GJBXAjUgOj0gaEmxEm3MfXeSIigufPDbzZf25sHxC+z2rFhBUW2 From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 03/24] t3305: annotate with SHA1 prerequisite Date: Mon, 13 Jan 2020 12:38:36 +0000 Message-Id: <20200113123857.3684632-4-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test relies on a roughly equal distribution of hashes for notes in order to ensure that fanouts are compressed. If there are subtrees with only one item left after removing notes, they'll end up still with one level of fanout, causing the test to fail. The test happens to pass with SHA-1, but doesn't necessarily with other hash algorithms, so annotate it with the SHA1 prerequisite. Signed-off-by: brian m. carlson --- t/t3305-notes-fanout.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t3305-notes-fanout.sh b/t/t3305-notes-fanout.sh index 831f83d211..3520402bb8 100755 --- a/t/t3305-notes-fanout.sh +++ b/t/t3305-notes-fanout.sh @@ -67,7 +67,7 @@ test_expect_success 'most notes deleted correctly with git-notes' ' test_cmp expect output ' -test_expect_success 'deleting most notes triggers fanout consolidation' ' +test_expect_success SHA1 'deleting most notes triggers fanout consolidation' ' # Expect entire notes tree to have a fanout == 0 git ls-tree -r --name-only refs/notes/commits | while read path From patchwork Mon Jan 13 12:38:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330053 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8497092A for ; Mon, 13 Jan 2020 12:41:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 627C020678 for ; Mon, 13 Jan 2020 12:41:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="BXAADUFm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728796AbgAMMk7 (ORCPT ); Mon, 13 Jan 2020 07:40:59 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37622 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbgAMMke (ORCPT ); Mon, 13 Jan 2020 07:40:34 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id B977A607FA; Mon, 13 Jan 2020 12:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919234; bh=Z9U1zvLnfQogIDvg83Wg6XxuFe3EDwtyaQtub457np8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=BXAADUFmTocSjabwA5FVEzG2TFSmvoqnhrDg+N3vrxdrlwr/y5ypVMI2AZrnaY2V2 8B+wWNfQIHFMSz60T9zepkv9p3R7C0tB9o2zw8EPRG1wnV14qLr00+spNiaBwpZyTB 33gd1L6J8r3CffbqTHzmqXNxLVlXMfw9WQrKXa6l8QS7YvISrxcA0zPK8r+KLVQwiG FMx8qCiWEfSGJjsCGSwtivlBrFsunQxcy6zQw1bl1rAdC715r1NCuoIAMBrHqSk1nh Joy2TkR1/pEEngnJpXarHYQRCf/cRCbBc4VpGEPX0rA9sBesbpPc0ZjIL1YOFwQtXe kyOp92bBt+uDhWWkUzYfDrdQVlAu1/S3PwHyexbnwDjO1d6CGksUMMmx4B/H4k4Vbg AbN4yfqIUwfu9iu1Nucv7t5SH2dOZ6JXqj6QkFr1qlCnNj3R3X2rJlqKa9qcHsZFDA uRK3oXNXQxuzT9pD+50C6zpmjFlbPdiHJezKZuALz2HGFoX+Dl4 From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 04/24] t3308: make test work with SHA-256 Date: Mon, 13 Jan 2020 12:38:37 +0000 Message-Id: <20200113123857.3684632-5-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Replace the hard-coded SHA-1 constants with the use of test_oid to look up an appropriate constant for each hash algorithm. Signed-off-by: brian m. carlson --- t/t3308-notes-merge.sh | 83 ++++++++++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 28 deletions(-) diff --git a/t/t3308-notes-merge.sh b/t/t3308-notes-merge.sh index d60588ec8f..790e292966 100755 --- a/t/t3308-notes-merge.sh +++ b/t/t3308-notes-merge.sh @@ -20,7 +20,34 @@ test_expect_success setup ' git notes add -m "Notes on 3rd commit" 3rd && git notes add -m "Notes on 4th commit" 4th && # Copy notes to remote-notes - git fetch . refs/notes/*:refs/remote-notes/origin/* + git fetch . refs/notes/*:refs/remote-notes/origin/* && + + test_oid_init && + test_oid_cache <<-EOF + hash4a sha1:5e93d24084d32e1cb61f7070505b9d2530cca987 + hash3a sha1:8366731eeee53787d2bdf8fc1eff7d94757e8da0 + hash2a sha1:eede89064cd42441590d6afec6c37b321ada3389 + hash1a sha1:daa55ffad6cb99bf64226532147ffcaf5ce8bdd1 + hash5b sha1:0f2efbd00262f2fd41dfae33df8765618eeacd99 + hash4b sha1:dec2502dac3ea161543f71930044deff93fa945c + hash3b sha1:4069cdb399fd45463ec6eef8e051a16a03592d91 + hash2c sha1:d000d30e6ddcfce3a8122c403226a2ce2fd04d9d + hash1c sha1:43add6bd0c8c0bc871ac7991e0f5573cfba27804 + hash4d sha1:1f257a3a90328557c452f0817d6cc50c89d315d4 + hash3d sha1:05a4927951bcef347f51486575b878b2b60137f2 + + hash4a sha256:eef876be1d32ac2e2e42240e0429325cec116e55e88cb2969899fac695aa762f + hash3a sha256:cf7cd1bc091d7ba4166a86df864110e42087cd893a5ae96bc50d637e0290939d + hash2a sha256:21ddde7ebce2c285213898cb04deca0fd3209610cf7aaf8222e4e2f45262fae2 + hash1a sha256:f9fe0eda16c6027732ed9d4295689a03abd16f893be69b3dcbf4037ddb191921 + hash5b sha256:20046f2244577797a9e3d3f790ea9eca4d8a6bafb2a5570bcb0e03aa02ce100b + hash4b sha256:f90563d134c61a95bb88afbd45d48ccc9e919c62aa6fbfcd483302b3e4d8dbcb + hash3b sha256:988f2aca9f2d87e93e6a73197c2bb99560cc44a2f92d18653968f956f01221e0 + hash2c sha256:84153b777b4d42827a756c6578dcdb59d8ae5d1360b874fb37c430150c825c26 + hash1c sha256:9beb2bc4eef72e4c4087be168a20573e34d993d9ab1883055f23e322afa06567 + hash4d sha256:32de39dc06e679a7abb2d4a55ede7709b3124340a4a90aa305971b1c72ac319d + hash3d sha256:fa73b20e41cbb7541c4c81d1535016131dbfbeb05bf6a71f6115e9cad31c7af5 + EOF ' commit_sha1=$(git rev-parse 1st^{commit}) @@ -40,10 +67,10 @@ verify_notes () { } cat <expect_notes_x -5e93d24084d32e1cb61f7070505b9d2530cca987 $commit_sha4 -8366731eeee53787d2bdf8fc1eff7d94757e8da0 $commit_sha3 -eede89064cd42441590d6afec6c37b321ada3389 $commit_sha2 -daa55ffad6cb99bf64226532147ffcaf5ce8bdd1 $commit_sha1 +$(test_oid hash4a) $commit_sha4 +$(test_oid hash3a) $commit_sha3 +$(test_oid hash2a) $commit_sha2 +$(test_oid hash1a) $commit_sha1 EOF cat >expect_log_x < y) => No-op' ' ' cat <expect_notes_y -0f2efbd00262f2fd41dfae33df8765618eeacd99 $commit_sha5 -dec2502dac3ea161543f71930044deff93fa945c $commit_sha4 -4069cdb399fd45463ec6eef8e051a16a03592d91 $commit_sha3 -daa55ffad6cb99bf64226532147ffcaf5ce8bdd1 $commit_sha1 +$(test_oid hash5b) $commit_sha5 +$(test_oid hash4b) $commit_sha4 +$(test_oid hash3b) $commit_sha3 +$(test_oid hash1a) $commit_sha1 EOF cat >expect_log_y < y)' ' ' cat <expect_notes_y -0f2efbd00262f2fd41dfae33df8765618eeacd99 $commit_sha5 -dec2502dac3ea161543f71930044deff93fa945c $commit_sha4 -4069cdb399fd45463ec6eef8e051a16a03592d91 $commit_sha3 -d000d30e6ddcfce3a8122c403226a2ce2fd04d9d $commit_sha2 -43add6bd0c8c0bc871ac7991e0f5573cfba27804 $commit_sha1 +$(test_oid hash5b) $commit_sha5 +$(test_oid hash4b) $commit_sha4 +$(test_oid hash3b) $commit_sha3 +$(test_oid hash2c) $commit_sha2 +$(test_oid hash1c) $commit_sha1 EOF cat >expect_log_y <expect_notes_x -0f2efbd00262f2fd41dfae33df8765618eeacd99 $commit_sha5 -1f257a3a90328557c452f0817d6cc50c89d315d4 $commit_sha4 -daa55ffad6cb99bf64226532147ffcaf5ce8bdd1 $commit_sha1 +$(test_oid hash5b) $commit_sha5 +$(test_oid hash4d) $commit_sha4 +$(test_oid hash1a) $commit_sha1 EOF cat >expect_log_x <expect_notes_x -0f2efbd00262f2fd41dfae33df8765618eeacd99 $commit_sha5 -1f257a3a90328557c452f0817d6cc50c89d315d4 $commit_sha4 -d000d30e6ddcfce3a8122c403226a2ce2fd04d9d $commit_sha2 -43add6bd0c8c0bc871ac7991e0f5573cfba27804 $commit_sha1 +$(test_oid hash5b) $commit_sha5 +$(test_oid hash4d) $commit_sha4 +$(test_oid hash2c) $commit_sha2 +$(test_oid hash1c) $commit_sha1 EOF cat >expect_log_x < Non-conflicting 3-way merge' ' ' cat <expect_notes_w -05a4927951bcef347f51486575b878b2b60137f2 $commit_sha3 -d000d30e6ddcfce3a8122c403226a2ce2fd04d9d $commit_sha2 +$(test_oid hash3d) $commit_sha3 +$(test_oid hash2c) $commit_sha2 EOF cat >expect_log_w <expect_notes_x -0f2efbd00262f2fd41dfae33df8765618eeacd99 $commit_sha5 -1f257a3a90328557c452f0817d6cc50c89d315d4 $commit_sha4 -05a4927951bcef347f51486575b878b2b60137f2 $commit_sha3 -d000d30e6ddcfce3a8122c403226a2ce2fd04d9d $commit_sha2 -43add6bd0c8c0bc871ac7991e0f5573cfba27804 $commit_sha1 +$(test_oid hash5b) $commit_sha5 +$(test_oid hash4d) $commit_sha4 +$(test_oid hash3d) $commit_sha3 +$(test_oid hash2c) $commit_sha2 +$(test_oid hash1c) $commit_sha1 EOF cat >expect_log_x < X-Patchwork-Id: 11330021 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3A411820 for ; Mon, 13 Jan 2020 12:40:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8FCC21739 for ; Mon, 13 Jan 2020 12:40:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="CGWrRgLV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728643AbgAMMkh (ORCPT ); Mon, 13 Jan 2020 07:40:37 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37620 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727331AbgAMMkf (ORCPT ); Mon, 13 Jan 2020 07:40:35 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 4100A607FB; Mon, 13 Jan 2020 12:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919234; bh=79/n1YAIotuv5jj6iSCqMtjPRSQQePp3bN9xE4fha1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=CGWrRgLVDKd8aNmGiHPWOGhjfNXr9TsnKyg+WTGBilrCGFdSPJl9Di9bhheZ+ebE/ 1EALsy0ghEnqqQad5MoV57nNr1oxVPUEv3/uLR4E09gBS60ONep1bC66iKXbclPy54 ui5/9AFryPV1VdMKQbqh0OLINpsVzdVvfMAR6NuCKwi7l/McaCuk/QpHZ4E0JL/1hV MVUhcI/dTvaXH5Hk4E/cvQ8BA730s1BhJHDXaY0Fr4BdU5cH2vlnxuDamwq6LdpUqt yg8eYqwjgVQkgEXjPHm5E0SwwGSMlqhxpoMQvWhnoz+PvYYlAkmi5teebOVeFRqwks Q3nIVX373A36XvkaEML/erm2/tJiukGQeMdg3+32fhtk+/bFl8++VE0WPwIWpa8zoz 9GOkheHfQDH+ABXkLivGtMRsIeBK67EuyDn6IcPNz0VPC7OP4a2yXiiKh0BsW4IOFS k5MJcGFZfesu0CUrg7Jy9fHuYww8xbl7lAaNdhn5vIwDa8Lm/uK From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 05/24] t3309: make test work with SHA-256 Date: Mon, 13 Jan 2020 12:38:38 +0000 Message-Id: <20200113123857.3684632-6-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Replace the hard-coded SHA-1 constants with the use of test_oid to look up an appropriate constant for each hash algorithm. Signed-off-by: brian m. carlson --- t/t3309-notes-merge-auto-resolve.sh | 228 ++++++++++++++++++---------- 1 file changed, 144 insertions(+), 84 deletions(-) diff --git a/t/t3309-notes-merge-auto-resolve.sh b/t/t3309-notes-merge-auto-resolve.sh index 14c2adf970..141d3e4ca4 100755 --- a/t/t3309-notes-merge-auto-resolve.sh +++ b/t/t3309-notes-merge-auto-resolve.sh @@ -23,7 +23,67 @@ test_expect_success 'setup commits' ' test_commit 12th && test_commit 13th && test_commit 14th && - test_commit 15th + test_commit 15th && + + test_oid_cache <<-EOF + hash15a sha1:457a85d6c814ea208550f15fcc48f804ac8dc023 + hash14a sha1:b0c95b954301d69da2bc3723f4cb1680d355937c + hash13a sha1:5d30216a129eeffa97d9694ffe8c74317a560315 + hash12a sha1:dd161bc149470fd890dd4ab52a4cbd79bbd18c36 + hash11a sha1:7abbc45126d680336fb24294f013a7cdfa3ed545 + hash10a sha1:b8d03e173f67f6505a76f6e00cf93440200dd9be + hash09a sha1:20c613c835011c48a5abe29170a2402ca6354910 + hash08a sha1:a3daf8a1e4e5dc3409a303ad8481d57bfea7f5d6 + hash07a sha1:897003322b53bc6ca098e9324ee508362347e734 + hash06a sha1:11d97fdebfa5ceee540a3da07bce6fa0222bc082 + hash15b sha1:68b8630d25516028bed862719855b3d6768d7833 + hash14b sha1:5de7ea7ad4f47e7ff91989fb82234634730f75df + hash13b sha1:3a631fdb6f41b05b55d8f4baf20728ba8f6fccbc + hash12b sha1:a66055fa82f7a03fe0c02a6aba3287a85abf7c62 + hash05b sha1:154508c7a0bcad82b6fe4b472bc4c26b3bf0825b + hash04b sha1:e2bfd06a37dd2031684a59a6e2b033e212239c78 + hash03b sha1:5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 + hash15c sha1:9b4b2c61f0615412da3c10f98ff85b57c04ec765 + hash11c sha1:7e3c53503a3db8dd996cb62e37c66e070b44b54d + hash08c sha1:851e1638784a884c7dd26c5d41f3340f6387413a + hash05c sha1:99fc34adfc400b95c67b013115e37e31aa9a6d23 + hash02c sha1:283b48219aee9a4105f6cab337e789065c82c2b9 + hash15d sha1:7c4e546efd0fe939f876beb262ece02797880b54 + hash05d sha1:6c841cc36ea496027290967ca96bd2bef54dbb47 + hash15e sha1:d682107b8bf7a7aea1e537a8d5cb6a12b60135f1 + hash05e sha1:357b6ca14c7afd59b7f8b8aaaa6b8b723771135b + hash15f sha1:6be90240b5f54594203e25d9f2f64b7567175aee + hash05f sha1:660311d7f78dc53db12ac373a43fca7465381a7e + + hash15a sha256:45b1558e5c1b75f570010fa48aaa67bb2289fcd431b34ad81cb4c8b95f4f872a + hash14a sha256:6e7af179ea4dd28afdc83ae6912ba0098cdeff764b26a8b750b157dd81749092 + hash13a sha256:7353089961baf555388e1bac68c67c8ea94b08ccbd97532201cf7f6790703052 + hash12a sha256:5863e4521689ee1879ceab3b38d39e93ab5b51ec70aaf6a96ad388fbdedfa25e + hash11a sha256:82a0ec0338b4ecf8b44304badf4ad38d7469dc41827f38d7ba6c42e3bae3ee98 + hash10a sha256:e84f2564e92de9792c93b8d197262c735d7ccb1de6025cef8759af8f6c3308eb + hash09a sha256:4dd07764bcec696f195c0ea71ae89e174876403af1637e4642b8f4453fd23028 + hash08a sha256:02132c4546cd88a1d0aa5854dd55da120927f7904ba16afe36fe03e91a622067 + hash07a sha256:369baf7d00c6720efdc10273493555f943051f84a4706fb24caeb353fa4789db + hash06a sha256:52d32c10353583b2d96a5849b1f1f43c8018e76f3e8ef1b0d46eb5cff7cdefaf + hash15b sha256:345e6660b345fa174738a31a7a59423c394bdf414804e200bc510c65d971ae96 + hash14b sha256:7653a6596021c52e405cba979eea15a729993e7102b9a61ba4667e34f0ead4a1 + hash13b sha256:0f202a0b6b9690de2349c173dfd766a37e82744f61c14f1c389306f1d69f470b + hash12b sha256:eb00f219c026136ea6535b16ff8ec3efa510e6bf50098ca041e1a2a1d4b79840 + hash05b sha256:993b2290cd0c24c27c849d99f1904f3b590f77af0f539932734ad05679ac5a2f + hash04b sha256:c7fba0d6104917fbf35258f40b9fa4fc697cfa992deecd1570a3b08d0a5587a9 + hash03b sha256:7287a2d78a3766c181b08df38951d784b08b72a44f571ed6d855bd0be22c70f6 + hash15c sha256:62316660a22bf97857dc4a16709ec4d93a224e8c9f37d661ef91751e1f4c4166 + hash11c sha256:51c3763de9b08309370adc5036d58debb331980e73097902957c444602551daa + hash08c sha256:22cf1fa29599898a7218c51135d66ed85d22aad584f77db3305dedce4c3d4798 + hash05c sha256:2508fd86db980f0508893a1c1571bdf3b2ee113dc25ddb1a3a2fb94bd6cd0d58 + hash02c sha256:63bb527e0b4e1c8e1dd0d54dd778ca7c3718689fd6e37c473044cfbcf1cacfdb + hash15d sha256:667acb4e2d5f8df15e5aea4506dfd16d25bc7feca70fdb0d965a7222f983bb88 + hash05d sha256:09e6b5a6fe666c4a027674b6611a254b7d2528cd211c6b5288d1b4db6c741dfa + hash15e sha256:e8cbf52f6fcadc6de3c7761e64a89e9fe38d19a03d3e28ef6ca8596d93fc4f3a + hash05e sha256:cdb1e19f7ba1539f95af51a57edeb88a7ecc97d3c2f52da8c4c86af308595607 + hash15f sha256:29c14cb92da448a923963b8a43994268b19c2e57913de73f3667421fd2c0eeec + hash05f sha256:14a6e641b2c0a9f398ebac6b4d34afa5efea4c52d2631382f45f8f662266903b + EOF ' commit_sha1=$(git rev-parse 1st^{commit}) @@ -68,16 +128,16 @@ test_expect_success 'setup merge base (x)' ' ' cat <expect_notes_x -457a85d6c814ea208550f15fcc48f804ac8dc023 $commit_sha15 -b0c95b954301d69da2bc3723f4cb1680d355937c $commit_sha14 -5d30216a129eeffa97d9694ffe8c74317a560315 $commit_sha13 -dd161bc149470fd890dd4ab52a4cbd79bbd18c36 $commit_sha12 -7abbc45126d680336fb24294f013a7cdfa3ed545 $commit_sha11 -b8d03e173f67f6505a76f6e00cf93440200dd9be $commit_sha10 -20c613c835011c48a5abe29170a2402ca6354910 $commit_sha9 -a3daf8a1e4e5dc3409a303ad8481d57bfea7f5d6 $commit_sha8 -897003322b53bc6ca098e9324ee508362347e734 $commit_sha7 -11d97fdebfa5ceee540a3da07bce6fa0222bc082 $commit_sha6 +$(test_oid hash15a) $commit_sha15 +$(test_oid hash14a) $commit_sha14 +$(test_oid hash13a) $commit_sha13 +$(test_oid hash12a) $commit_sha12 +$(test_oid hash11a) $commit_sha11 +$(test_oid hash10a) $commit_sha10 +$(test_oid hash09a) $commit_sha9 +$(test_oid hash08a) $commit_sha8 +$(test_oid hash07a) $commit_sha7 +$(test_oid hash06a) $commit_sha6 EOF cat >expect_log_x <expect_notes_y -68b8630d25516028bed862719855b3d6768d7833 $commit_sha15 -5de7ea7ad4f47e7ff91989fb82234634730f75df $commit_sha14 -3a631fdb6f41b05b55d8f4baf20728ba8f6fccbc $commit_sha13 -a66055fa82f7a03fe0c02a6aba3287a85abf7c62 $commit_sha12 -7abbc45126d680336fb24294f013a7cdfa3ed545 $commit_sha11 -b8d03e173f67f6505a76f6e00cf93440200dd9be $commit_sha10 -20c613c835011c48a5abe29170a2402ca6354910 $commit_sha9 -154508c7a0bcad82b6fe4b472bc4c26b3bf0825b $commit_sha5 -e2bfd06a37dd2031684a59a6e2b033e212239c78 $commit_sha4 -5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 $commit_sha3 +$(test_oid hash15b) $commit_sha15 +$(test_oid hash14b) $commit_sha14 +$(test_oid hash13b) $commit_sha13 +$(test_oid hash12b) $commit_sha12 +$(test_oid hash11a) $commit_sha11 +$(test_oid hash10a) $commit_sha10 +$(test_oid hash09a) $commit_sha9 +$(test_oid hash05b) $commit_sha5 +$(test_oid hash04b) $commit_sha4 +$(test_oid hash03b) $commit_sha3 EOF cat >expect_log_y <expect_notes_z -9b4b2c61f0615412da3c10f98ff85b57c04ec765 $commit_sha15 -5de7ea7ad4f47e7ff91989fb82234634730f75df $commit_sha14 -5d30216a129eeffa97d9694ffe8c74317a560315 $commit_sha13 -7e3c53503a3db8dd996cb62e37c66e070b44b54d $commit_sha11 -b8d03e173f67f6505a76f6e00cf93440200dd9be $commit_sha10 -851e1638784a884c7dd26c5d41f3340f6387413a $commit_sha8 -897003322b53bc6ca098e9324ee508362347e734 $commit_sha7 -99fc34adfc400b95c67b013115e37e31aa9a6d23 $commit_sha5 -e2bfd06a37dd2031684a59a6e2b033e212239c78 $commit_sha4 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 +$(test_oid hash15c) $commit_sha15 +$(test_oid hash14b) $commit_sha14 +$(test_oid hash13a) $commit_sha13 +$(test_oid hash11c) $commit_sha11 +$(test_oid hash10a) $commit_sha10 +$(test_oid hash08c) $commit_sha8 +$(test_oid hash07a) $commit_sha7 +$(test_oid hash05c) $commit_sha5 +$(test_oid hash04b) $commit_sha4 +$(test_oid hash02c) $commit_sha2 EOF cat >expect_log_z < Fail/No ' cat <expect_notes_ours -68b8630d25516028bed862719855b3d6768d7833 $commit_sha15 -5de7ea7ad4f47e7ff91989fb82234634730f75df $commit_sha14 -3a631fdb6f41b05b55d8f4baf20728ba8f6fccbc $commit_sha13 -a66055fa82f7a03fe0c02a6aba3287a85abf7c62 $commit_sha12 -7e3c53503a3db8dd996cb62e37c66e070b44b54d $commit_sha11 -b8d03e173f67f6505a76f6e00cf93440200dd9be $commit_sha10 -154508c7a0bcad82b6fe4b472bc4c26b3bf0825b $commit_sha5 -e2bfd06a37dd2031684a59a6e2b033e212239c78 $commit_sha4 -5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 $commit_sha3 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 +$(test_oid hash15b) $commit_sha15 +$(test_oid hash14b) $commit_sha14 +$(test_oid hash13b) $commit_sha13 +$(test_oid hash12b) $commit_sha12 +$(test_oid hash11c) $commit_sha11 +$(test_oid hash10a) $commit_sha10 +$(test_oid hash05b) $commit_sha5 +$(test_oid hash04b) $commit_sha4 +$(test_oid hash03b) $commit_sha3 +$(test_oid hash02c) $commit_sha2 EOF cat >expect_log_ours <expect_notes_theirs -9b4b2c61f0615412da3c10f98ff85b57c04ec765 $commit_sha15 -5de7ea7ad4f47e7ff91989fb82234634730f75df $commit_sha14 -3a631fdb6f41b05b55d8f4baf20728ba8f6fccbc $commit_sha13 -7e3c53503a3db8dd996cb62e37c66e070b44b54d $commit_sha11 -b8d03e173f67f6505a76f6e00cf93440200dd9be $commit_sha10 -851e1638784a884c7dd26c5d41f3340f6387413a $commit_sha8 -99fc34adfc400b95c67b013115e37e31aa9a6d23 $commit_sha5 -e2bfd06a37dd2031684a59a6e2b033e212239c78 $commit_sha4 -5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 $commit_sha3 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 +$(test_oid hash15c) $commit_sha15 +$(test_oid hash14b) $commit_sha14 +$(test_oid hash13b) $commit_sha13 +$(test_oid hash11c) $commit_sha11 +$(test_oid hash10a) $commit_sha10 +$(test_oid hash08c) $commit_sha8 +$(test_oid hash05c) $commit_sha5 +$(test_oid hash04b) $commit_sha4 +$(test_oid hash03b) $commit_sha3 +$(test_oid hash02c) $commit_sha2 EOF cat >expect_log_theirs <expect_notes_union -7c4e546efd0fe939f876beb262ece02797880b54 $commit_sha15 -5de7ea7ad4f47e7ff91989fb82234634730f75df $commit_sha14 -3a631fdb6f41b05b55d8f4baf20728ba8f6fccbc $commit_sha13 -a66055fa82f7a03fe0c02a6aba3287a85abf7c62 $commit_sha12 -7e3c53503a3db8dd996cb62e37c66e070b44b54d $commit_sha11 -b8d03e173f67f6505a76f6e00cf93440200dd9be $commit_sha10 -851e1638784a884c7dd26c5d41f3340f6387413a $commit_sha8 -6c841cc36ea496027290967ca96bd2bef54dbb47 $commit_sha5 -e2bfd06a37dd2031684a59a6e2b033e212239c78 $commit_sha4 -5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 $commit_sha3 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 +$(test_oid hash15d) $commit_sha15 +$(test_oid hash14b) $commit_sha14 +$(test_oid hash13b) $commit_sha13 +$(test_oid hash12b) $commit_sha12 +$(test_oid hash11c) $commit_sha11 +$(test_oid hash10a) $commit_sha10 +$(test_oid hash08c) $commit_sha8 +$(test_oid hash05d) $commit_sha5 +$(test_oid hash04b) $commit_sha4 +$(test_oid hash03b) $commit_sha3 +$(test_oid hash02c) $commit_sha2 EOF cat >expect_log_union <expect_notes_union2 -d682107b8bf7a7aea1e537a8d5cb6a12b60135f1 $commit_sha15 -5de7ea7ad4f47e7ff91989fb82234634730f75df $commit_sha14 -3a631fdb6f41b05b55d8f4baf20728ba8f6fccbc $commit_sha13 -a66055fa82f7a03fe0c02a6aba3287a85abf7c62 $commit_sha12 -7e3c53503a3db8dd996cb62e37c66e070b44b54d $commit_sha11 -b8d03e173f67f6505a76f6e00cf93440200dd9be $commit_sha10 -851e1638784a884c7dd26c5d41f3340f6387413a $commit_sha8 -357b6ca14c7afd59b7f8b8aaaa6b8b723771135b $commit_sha5 -e2bfd06a37dd2031684a59a6e2b033e212239c78 $commit_sha4 -5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 $commit_sha3 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 +$(test_oid hash15e) $commit_sha15 +$(test_oid hash14b) $commit_sha14 +$(test_oid hash13b) $commit_sha13 +$(test_oid hash12b) $commit_sha12 +$(test_oid hash11c) $commit_sha11 +$(test_oid hash10a) $commit_sha10 +$(test_oid hash08c) $commit_sha8 +$(test_oid hash05e) $commit_sha5 +$(test_oid hash04b) $commit_sha4 +$(test_oid hash03b) $commit_sha3 +$(test_oid hash02c) $commit_sha2 EOF cat >expect_log_union2 <expect_notes_cat_sort_uniq -6be90240b5f54594203e25d9f2f64b7567175aee $commit_sha15 -5de7ea7ad4f47e7ff91989fb82234634730f75df $commit_sha14 -3a631fdb6f41b05b55d8f4baf20728ba8f6fccbc $commit_sha13 -a66055fa82f7a03fe0c02a6aba3287a85abf7c62 $commit_sha12 -7e3c53503a3db8dd996cb62e37c66e070b44b54d $commit_sha11 -b8d03e173f67f6505a76f6e00cf93440200dd9be $commit_sha10 -851e1638784a884c7dd26c5d41f3340f6387413a $commit_sha8 -660311d7f78dc53db12ac373a43fca7465381a7e $commit_sha5 -e2bfd06a37dd2031684a59a6e2b033e212239c78 $commit_sha4 -5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 $commit_sha3 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 +$(test_oid hash15f) $commit_sha15 +$(test_oid hash14b) $commit_sha14 +$(test_oid hash13b) $commit_sha13 +$(test_oid hash12b) $commit_sha12 +$(test_oid hash11c) $commit_sha11 +$(test_oid hash10a) $commit_sha10 +$(test_oid hash08c) $commit_sha8 +$(test_oid hash05f) $commit_sha5 +$(test_oid hash04b) $commit_sha4 +$(test_oid hash03b) $commit_sha3 +$(test_oid hash02c) $commit_sha2 EOF cat >expect_log_cat_sort_uniq < X-Patchwork-Id: 11330031 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15A1792A for ; Mon, 13 Jan 2020 12:40:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE857206D7 for ; Mon, 13 Jan 2020 12:40:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="BGqzgkfQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728753AbgAMMkq (ORCPT ); Mon, 13 Jan 2020 07:40:46 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37632 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727465AbgAMMkf (ORCPT ); Mon, 13 Jan 2020 07:40:35 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id BD996607F8; Mon, 13 Jan 2020 12:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919235; bh=snn3ipitnVKnfdSmFkxVT2rdkSiMLOg8kWgB9I9O0cY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=BGqzgkfQYp3Suxn4JHkcnOzRTppj/W+Yub7mo28xvG0TZZaipsj3BMan1bhGAl6iJ 2W++1XQWRpAZsYZopEDp5NMjmEV+WT71kWAsZZZtf7fhL53BK3BxYDDbG7djS1T/SI Qrk7TjQtytBUvFXUziWE4EWdYXsREgsFee4zspXx+7AR7tUXHvsMeLlp4ku24ftBze ledbDzuXe7uVIFtsuuufI/CQvJLpwWZFNk8n46aftuwlWwR5eJleiU009VqSGgWb7h mD2vtaxnuBLsD0DA+PQlRd7P3BI2DSXES1rrH8io1fKVQD2uiqC4TU8dX6EM2A8PPo ++ySuOXRQo9pmDDJWCMcr3KYvDrKxteyAxqOxxI8wUnVLHTzpEagwuKkJ8LW/MpMD8 NZOzwBwjn0UZtcj7wmxKVw10fxrBt81Fq9LM53VoqvOYem61mrODfd+ubpFD2El4ps pcqkEobEgIdPAT2l2mOTf4F21BoYxTO3Ak1zmZWUhqvQyokog+k From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 06/24] t3310: make test work with SHA-256 Date: Mon, 13 Jan 2020 12:38:39 +0000 Message-Id: <20200113123857.3684632-7-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Replace the hard-coded SHA-1 constants with the use of test_oid to look up an appropriate constant for each hash algorithm. Signed-off-by: brian m. carlson --- t/t3310-notes-merge-manual-resolve.sh | 84 ++++++++++++++++++--------- 1 file changed, 58 insertions(+), 26 deletions(-) diff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh index 2dea846e25..806d812a17 100755 --- a/t/t3310-notes-merge-manual-resolve.sh +++ b/t/t3310-notes-merge-manual-resolve.sh @@ -13,7 +13,39 @@ test_expect_success 'setup commits' ' test_commit 2nd && test_commit 3rd && test_commit 4th && - test_commit 5th + test_commit 5th && + + test_oid_cache <<-EOF + hash04a sha1:6e8e3febca3c2bb896704335cc4d0c34cb2f8715 + hash03a sha1:e5388c10860456ee60673025345fe2e153eb8cf8 + hash02a sha1:ceefa674873670e7ecd131814d909723cce2b669 + hash04b sha1:e2bfd06a37dd2031684a59a6e2b033e212239c78 + hash03b sha1:5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 + hash01b sha1:b0a6021ec006d07e80e9b20ec9b444cbd9d560d3 + hash04c sha1:cff59c793c20bb49a4e01bc06fb06bad642e0d54 + hash02c sha1:283b48219aee9a4105f6cab337e789065c82c2b9 + hash01c sha1:0a81da8956346e19bcb27a906f04af327e03e31b + hash04d sha1:00494adecf2d9635a02fa431308d67993f853968 + hash01e sha1:f75d1df88cbfe4258d49852f26cfc83f2ad4494b + hash04f sha1:021faa20e931fb48986ffc6282b4bb05553ac946 + hash01f sha1:0a59e787e6d688aa6309e56e8c1b89431a0fc1c1 + hash05g sha1:304dfb4325cf243025b9957486eb605a9b51c199 + + hash04a sha256:f18a935e65866345098b3b754071dbf9f3aa3520eb27a7b036b278c5e2f1ed7e + hash03a sha256:713035dc94067a64e5fa6e4e1821b7c3bde49a77c7cb3f80eaadefa1ca41b3d2 + hash02a sha256:f160a67e048b6fa75bec3952184154045076692cf5dccd3da21e3fd34b7a3f0f + hash04b sha256:c7fba0d6104917fbf35258f40b9fa4fc697cfa992deecd1570a3b08d0a5587a9 + hash03b sha256:7287a2d78a3766c181b08df38951d784b08b72a44f571ed6d855bd0be22c70f6 + hash01b sha256:da96cf778c15d0a2bb76f98b2a62f6c9c01730fa7030e8f08ef0191048e7d620 + hash04c sha256:cb615d2def4b834d5f55b2351df97dc92bee4f5009d285201427f349081c8aca + hash02c sha256:63bb527e0b4e1c8e1dd0d54dd778ca7c3718689fd6e37c473044cfbcf1cacfdb + hash01c sha256:5b87237ac1fbae0246256fed9f9a1f077c4140fb7e6444925f8dbfa5ae406cd8 + hash04d sha256:eeddc9f9f6cb3d6b39b861659853f10891dc373e0b6eecb09e03e39b6ce64714 + hash01e sha256:108f521b1a74c2e6d0b52a4eda87e09162bf847f7d190cfce496ee1af0b29a5a + hash04f sha256:901acda0454502b3bbd281f130c419e6c8de78afcf72a8def8d45ad31462bce4 + hash01f sha256:a2d99d1b8bf23c8af7d9d91368454adc110dfd5cc068a4cebb486ee8f5a1e16c + hash05g sha256:4fef015b01da8efe929a68e3bb9b8fbad81f53995f097befe8ebc93f12ab98ec + EOF ' commit_sha1=$(git rev-parse 1st^{commit}) @@ -33,9 +65,9 @@ verify_notes () { } cat <expect_notes_x -6e8e3febca3c2bb896704335cc4d0c34cb2f8715 $commit_sha4 -e5388c10860456ee60673025345fe2e153eb8cf8 $commit_sha3 -ceefa674873670e7ecd131814d909723cce2b669 $commit_sha2 +$(test_oid hash04a) $commit_sha4 +$(test_oid hash03a) $commit_sha3 +$(test_oid hash02a) $commit_sha2 EOF cat >expect_log_x <expect_notes_y -e2bfd06a37dd2031684a59a6e2b033e212239c78 $commit_sha4 -5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 $commit_sha3 -b0a6021ec006d07e80e9b20ec9b444cbd9d560d3 $commit_sha1 +$(test_oid hash04b) $commit_sha4 +$(test_oid hash03b) $commit_sha3 +$(test_oid hash01b) $commit_sha1 EOF cat >expect_log_y <expect_notes_z -cff59c793c20bb49a4e01bc06fb06bad642e0d54 $commit_sha4 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 -0a81da8956346e19bcb27a906f04af327e03e31b $commit_sha1 +$(test_oid hash04c) $commit_sha4 +$(test_oid hash02c) $commit_sha2 +$(test_oid hash01c) $commit_sha1 EOF cat >expect_log_z < C ' cat <expect_notes_z -00494adecf2d9635a02fa431308d67993f853968 $commit_sha4 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 -0a81da8956346e19bcb27a906f04af327e03e31b $commit_sha1 +$(test_oid hash04d) $commit_sha4 +$(test_oid hash02c) $commit_sha2 +$(test_oid hash01c) $commit_sha1 EOF cat >expect_log_z <expect_notes_w -ceefa674873670e7ecd131814d909723cce2b669 $commit_sha2 -f75d1df88cbfe4258d49852f26cfc83f2ad4494b $commit_sha1 +$(test_oid hash02a) $commit_sha2 +$(test_oid hash01e) $commit_sha1 EOF cat >expect_log_w <expect_notes_w -6e8e3febca3c2bb896704335cc4d0c34cb2f8715 $commit_sha4 -e5388c10860456ee60673025345fe2e153eb8cf8 $commit_sha3 -ceefa674873670e7ecd131814d909723cce2b669 $commit_sha2 -f75d1df88cbfe4258d49852f26cfc83f2ad4494b $commit_sha1 +$(test_oid hash04a) $commit_sha4 +$(test_oid hash03a) $commit_sha3 +$(test_oid hash02a) $commit_sha2 +$(test_oid hash01e) $commit_sha1 EOF cat >expect_log_w <expect_notes_m -021faa20e931fb48986ffc6282b4bb05553ac946 $commit_sha4 -5772f42408c0dd6f097a7ca2d24de0e78d1c46b1 $commit_sha3 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 -0a59e787e6d688aa6309e56e8c1b89431a0fc1c1 $commit_sha1 +$(test_oid hash04f) $commit_sha4 +$(test_oid hash03b) $commit_sha3 +$(test_oid hash02c) $commit_sha2 +$(test_oid hash01f) $commit_sha1 EOF cat >expect_log_m <expect_notes_m -304dfb4325cf243025b9957486eb605a9b51c199 $commit_sha5 -283b48219aee9a4105f6cab337e789065c82c2b9 $commit_sha2 -0a59e787e6d688aa6309e56e8c1b89431a0fc1c1 $commit_sha1 +$(test_oid hash05g) $commit_sha5 +$(test_oid hash02c) $commit_sha2 +$(test_oid hash01f) $commit_sha1 EOF cat >expect_log_m < X-Patchwork-Id: 11330017 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8DC0D13A0 for ; Mon, 13 Jan 2020 12:40:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BEA421739 for ; Mon, 13 Jan 2020 12:40:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="zWPUEsGH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728674AbgAMMkj (ORCPT ); Mon, 13 Jan 2020 07:40:39 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37642 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727494AbgAMMkh (ORCPT ); Mon, 13 Jan 2020 07:40:37 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 45F6C607F9; Mon, 13 Jan 2020 12:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919235; bh=WLjgqN2esEpcT1vh2z6VDQ+nQ6v3NyDvQpsQeaNWli0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=zWPUEsGH1Td0y8YOXCUeyDWQtRxm4JsIpYWp6QYimDbUtZABnzONjw7ga6ZGeVrqf bZYwzMXG9mU7SpRGfFXeLcRvtJfXbfh1SnUMXMjqHESVJlDw4BIpAxqd/LArD1IOM2 kNVbhxsNQcJgT1YFvAeiucIoBnwkjD2K7Q6d98DWUEe4PLhPxBLNsxNtE7MgsRkxED cmWqcS3YpwatNvK4p00rhKswUC380utWUns9FQj5rUdSRVP+Paw1Gm+sJ6FHfNKd+B PJts3rotpyFKoanlb7+kIZBtMv6tBSOl/Xz+ggIrBCywHkr/ogAMkh91vMhhBctcSr rdqjE5WtMauW6qt6QSk6UcbWlA5cae8Cap4GIZqBz6TewApRHxu8imeuXXQDmWUvRn WLOhKyq9vmTnNQP53zxFVcVWmtACfy+acXTNdNHDtmZf1whM2eyINGLunbEQkLF9Nw TUiu/TuQq3f6nuQ/kB631Y51W5o7nORIsUA8L1ymDtaSBhPEYf/ From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 07/24] t3311: make test work with SHA-256 Date: Mon, 13 Jan 2020 12:38:40 +0000 Message-Id: <20200113123857.3684632-8-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Replace the hard-coded SHA-1 constants with the use of test_oid to look up an appropriate constant for each hash algorithm. In addition, adjust the fanout checks to look for either zero or one slashes in the filename without needing to check for an explicit length. Signed-off-by: brian m. carlson --- t/t3311-notes-merge-fanout.sh | 60 ++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/t/t3311-notes-merge-fanout.sh b/t/t3311-notes-merge-fanout.sh index 37151a3adc..5b675417e9 100755 --- a/t/t3311-notes-merge-fanout.sh +++ b/t/t3311-notes-merge-fanout.sh @@ -29,15 +29,10 @@ verify_fanout () { git ls-tree -r --name-only "refs/notes/$notes_ref" | while read path do - case "$path" in - ??/??????????????????????????????????????) - : true - ;; - *) + echo "$path" | grep "^../[0-9a-f]*$" || { echo "Invalid path \"$path\"" && - return 1 - ;; - esac + return 1; + } done } @@ -48,15 +43,10 @@ verify_no_fanout () { git ls-tree -r --name-only "refs/notes/$notes_ref" | while read path do - case "$path" in - ????????????????????????????????????????) - : true - ;; - *) + echo "$path" | grep -v "^../.*" || { echo "Invalid path \"$path\"" && - return 1 - ;; - esac + return 1; + } done } @@ -67,7 +57,27 @@ test_expect_success 'setup a few initial commits with notes (notes ref: x)' ' do test_commit "commit$i" >/dev/null && git notes add -m "notes for commit$i" || return 1 - done + done && + + git log --format=oneline && + + test_oid_cache <<-EOF + hash05a sha1:aed91155c7a72c2188e781fdf40e0f3761b299db + hash04a sha1:99fab268f9d7ee7b011e091a436c78def8eeee69 + hash03a sha1:953c20ae26c7aa0b428c20693fe38bc687f9d1a9 + hash02a sha1:6358796131b8916eaa2dde6902642942a1cb37e1 + hash01a sha1:b02d459c32f0e68f2fe0981033bb34f38776ba47 + hash03b sha1:9f506ee70e20379d7f78204c77b334f43d77410d + hash02b sha1:23a47d6ea7d589895faf800752054818e1e7627b + + hash05a sha256:3aae5d26619d96dba93795f66325716e4cbc486884f95a6adee8fb0615a76d12 + hash04a sha256:07e43dd3d89fe634d3252e253b426aacc7285a995dcdbcf94ac284060a1122cf + hash03a sha256:26fb52eaa7f4866bf735254587be7b31209ec10e525912ffd8e8ba549ba892ff + hash02a sha256:b57ebdf23634e750dcbc4b9a37991d70f90830d568a0e4529ce9de0a3f8d605c + hash01a sha256:377903b1572bd5117087a5518fcb1011b5053cccbc59e3c7c823a8615204173b + hash03b sha256:04e7b392fda7c185bfa17c9179b56db732edc2dc2b3bf887308dcaabb717270d + hash02b sha256:66099aaaec49a485ed990acadd9a9b81232ea592079964113d8f581ff69ef50b + EOF ' commit_sha1=$(git rev-parse commit1^{commit}) @@ -77,11 +87,11 @@ commit_sha4=$(git rev-parse commit4^{commit}) commit_sha5=$(git rev-parse commit5^{commit}) cat <expect_notes_x -aed91155c7a72c2188e781fdf40e0f3761b299db $commit_sha5 -99fab268f9d7ee7b011e091a436c78def8eeee69 $commit_sha4 -953c20ae26c7aa0b428c20693fe38bc687f9d1a9 $commit_sha3 -6358796131b8916eaa2dde6902642942a1cb37e1 $commit_sha2 -b02d459c32f0e68f2fe0981033bb34f38776ba47 $commit_sha1 +$(test_oid hash05a) $commit_sha5 +$(test_oid hash04a) $commit_sha4 +$(test_oid hash03a) $commit_sha3 +$(test_oid hash02a) $commit_sha2 +$(test_oid hash01a) $commit_sha1 EOF cat >expect_log_x < x)' ' ' cat <expect_notes_z -9f506ee70e20379d7f78204c77b334f43d77410d $commit_sha3 -23a47d6ea7d589895faf800752054818e1e7627b $commit_sha2 -b02d459c32f0e68f2fe0981033bb34f38776ba47 $commit_sha1 +$(test_oid hash03b) $commit_sha3 +$(test_oid hash02b) $commit_sha2 +$(test_oid hash01a) $commit_sha1 EOF cat >expect_log_z < X-Patchwork-Id: 11330015 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA0B213A0 for ; Mon, 13 Jan 2020 12:40:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F34921739 for ; Mon, 13 Jan 2020 12:40:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="kcXx0I1s" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728665AbgAMMki (ORCPT ); Mon, 13 Jan 2020 07:40:38 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37648 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728558AbgAMMkh (ORCPT ); Mon, 13 Jan 2020 07:40:37 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id C0D9F607FC; Mon, 13 Jan 2020 12:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919236; bh=mIwoqfHulxI3nfouEXs/ZFmD4ZJN/5zDeL9TJnaR+wU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=kcXx0I1s/E1MvZTsfUZMmjofPeDkwLnLSXi4Gr7oOzV8a3Lj0dJJ9BQyXOvYKG+bq gjK/mGv3QHSVhPHYsHMe/O8ow+KRodALRMncBOvbys6NW5JVZBrrdVz6HXajuRCjsE EIuZL9orNw/VLWTcn0kal+wPbI3ypHLC3y82Fc63/0LMco57s05VQQXmEOTTd0s63/ jpYgwpGuEXs4Ct9Y37PB+ORWmoELDJwR/TYDlhPtJ3mFNiD6R4pHcfC5phA44mf7ML lfzrCpV+2460RZNbCFULV3W83lbRiUO+1fZtfkk3EDgigYiSXpOP7LFPvQa2Y3Q0At 123CpkU1AkaAVFPO7bmnpD1o5sFPzY6jfOTDVTFOaEEG4YOTV4Q1o6aMUg5+QQJJU2 cxzQkpWZWe32YyBWaP5hvz72jNJSRRvzlj/9SP/JLPTI1cEWtjStef7ydkrPRFL9Mk vkNrqP72Rg5A6NMl+sUhSFAswiBrz5HPMKdFHjxwXU1zmDgvibH From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 08/24] t3404: remove SHA1 prerequisite Date: Mon, 13 Jan 2020 12:38:41 +0000 Message-Id: <20200113123857.3684632-9-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Despite the description in the test, the test does not actually test for an SHA-1 collision; none of the object IDs used in the test collide. As such, it does not need to be adjusted in any way for SHA-256, so remove the SHA1 prerequisite. Signed-off-by: brian m. carlson --- t/t3404-rebase-interactive.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index ae6e55ce79..682c7252b8 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -1249,7 +1249,7 @@ test_expect_success 'rebase -i error on commits with \ in message' ' test_expect_code 1 grep " emp" error ' -test_expect_success SHA1 'short SHA-1 setup' ' +test_expect_success 'short SHA-1 setup' ' test_when_finished "git checkout master" && git checkout --orphan collide && git rm -rf . && @@ -1261,7 +1261,7 @@ test_expect_success SHA1 'short SHA-1 setup' ' ) ' -test_expect_success SHA1 'short SHA-1 collide' ' +test_expect_success 'short SHA-1 collide' ' test_when_finished "reset_rebase && git checkout master" && git checkout collide && ( From patchwork Mon Jan 13 12:38:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330025 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 557C614E3 for ; Mon, 13 Jan 2020 12:40:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34263206D7 for ; Mon, 13 Jan 2020 12:40:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="yGI08Cod" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728733AbgAMMkn (ORCPT ); Mon, 13 Jan 2020 07:40:43 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37654 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbgAMMki (ORCPT ); Mon, 13 Jan 2020 07:40:38 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 48815607FD; Mon, 13 Jan 2020 12:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919236; bh=sEkMDkqpK1OBWfbnfF1hxcDEn7IDQWSLwlTLd+96VQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=yGI08CodL8jNztbzTfa4PeSeG5U4jDaMDMnabLIJPvfhhdYu1rUC6SoGcCV5HdpXi dMDKm+kgIm+lRvvjgXoPN2WjhPsSzU7R/QKocxkznDYu/QTU0w3E/HQHf3fvxbM8kb kS3yx+17skv4lRbZM6d+YWhkDchH8MMy2MffdM5oY0o4IMbgps5XEgBJTvUCp5+aAu NDsghlRXMO6HMtiG9dRAqRA7J+fEbrkkhDZrNgTXWMJeL3J1HtqgeGuS68KlESXCFh 5o+GlcXMds/TVzbm//tOIvw0vjTAwUc495f9gy6X4+rZ2z818D9zHrdF6MO5RAG9vL G2aggVlM/JBmNnX9t+uYW5OGAUfUMiD+etnyxA9d/+t6W1sudyXwRDm2iIyMUTnL33 C0lVjLuJeXR9OIPHxma6bcA6yTxTJ+daOdLHkcoaBqoWDe4ap3HCs0BXm1DHn7Q/J+ DOhErYjtCfPRsTlxQFFKDMXSexlZJwlvC3VvYwRZvKjv/zZfaX1 From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 09/24] t4013: make test hash independent Date: Mon, 13 Jan 2020 12:38:42 +0000 Message-Id: <20200113123857.3684632-10-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test produces a large number of diff formats and compares the output with test files that have content specific to SHA-1. Since we are more interested in the format of the diffs, and not their specific values, which are tested elsewhere, add a function which uses sed to transform these specific object IDs into generic ones of the right size, which we can then compare. Signed-off-by: brian m. carlson --- t/t4013-diff-various.sh | 44 +++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index 5ac94b390d..6f5f05c3a8 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -120,6 +120,30 @@ test_expect_success setup ' +*++ [initial] Initial EOF +process_diffs () { + x04="[0-9a-f][0-9a-f][0-9a-f][0-9a-f]" && + x07="$_x05[0-9a-f][0-9a-f]" && + sed -e "s/$OID_REGEX/$ZERO_OID/g" \ + -e "s/From $_x40 /From $ZERO_OID /" \ + -e "s/from $_x40)/from $ZERO_OID)/" \ + -e "s/commit $_x40\$/commit $ZERO_OID/" \ + -e "s/commit $_x40 (/commit $ZERO_OID (/" \ + -e "s/$_x40 $_x40 $_x40/$ZERO_OID $ZERO_OID $ZERO_OID/" \ + -e "s/$_x40 $_x40 /$ZERO_OID $ZERO_OID /" \ + -e "s/^$_x40 $_x40$/$ZERO_OID $ZERO_OID/" \ + -e "s/^$_x40 /$ZERO_OID /" \ + -e "s/^$_x40$/$ZERO_OID/" \ + -e "s/$x07\.\.$x07/fffffff..fffffff/g" \ + -e "s/$x07,$x07\.\.$x07/fffffff,fffffff..fffffff/g" \ + -e "s/$x07 $x07 $x07/fffffff fffffff fffffff/g" \ + -e "s/$x07 $x07 /fffffff fffffff /g" \ + -e "s/Merge: $x07 $x07/Merge: fffffff fffffff/g" \ + -e "s/$x07\.\.\./fffffff.../g" \ + -e "s/ $x04\.\.\./ ffff.../g" \ + -e "s/ $x04/ ffff/g" \ + "$1" +} + V=$(git version | sed -e 's/^git version //' -e 's/\./\\./g') while read magic cmd do @@ -158,13 +182,15 @@ do } >"$actual" && if test -f "$expect" then + process_diffs "$actual" >actual && + process_diffs "$expect" >expect && case $cmd in *format-patch* | *-stat*) - test_i18ncmp "$expect" "$actual";; + test_i18ncmp expect actual;; *) - test_cmp "$expect" "$actual";; + test_cmp expect actual;; esac && - rm -f "$actual" + rm -f "$actual" actual expect else # this is to help developing new tests. cp "$actual" "$expect" @@ -383,16 +409,22 @@ test_expect_success 'log -S requires an argument' ' test_expect_success 'diff --cached on unborn branch' ' echo ref: refs/heads/unborn >.git/HEAD && git diff --cached >result && - test_cmp "$TEST_DIRECTORY/t4013/diff.diff_--cached" result + process_diffs result >actual && + process_diffs "$TEST_DIRECTORY/t4013/diff.diff_--cached" >expected && + test_cmp expected actual ' test_expect_success 'diff --cached -- file on unborn branch' ' git diff --cached -- file0 >result && - test_cmp "$TEST_DIRECTORY/t4013/diff.diff_--cached_--_file0" result + process_diffs result >actual && + process_diffs "$TEST_DIRECTORY/t4013/diff.diff_--cached_--_file0" >expected && + test_cmp expected actual ' test_expect_success 'diff --line-prefix with spaces' ' git diff --line-prefix="| | | " --cached -- file0 >result && - test_cmp "$TEST_DIRECTORY/t4013/diff.diff_--line-prefix_--cached_--_file0" result + process_diffs result >actual && + process_diffs "$TEST_DIRECTORY/t4013/diff.diff_--line-prefix_--cached_--_file0" >expected && + test_cmp expected actual ' test_expect_success 'diff-tree --stdin with log formatting' ' From patchwork Mon Jan 13 12:38:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330029 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D74E113A0 for ; Mon, 13 Jan 2020 12:40:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1A2A206D7 for ; Mon, 13 Jan 2020 12:40:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="o2Tbbzzv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728748AbgAMMkp (ORCPT ); Mon, 13 Jan 2020 07:40:45 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37620 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728621AbgAMMkh (ORCPT ); Mon, 13 Jan 2020 07:40:37 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id C6925607FE; Mon, 13 Jan 2020 12:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919237; bh=P7Eb1uTkSRBA1VkCADh0qnpHNCwZGD8+akROJz/FO6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=o2TbbzzvbFhbRut6sTww5KyjAM6Z+JopUc+F/Jpu/45/Hg22BzojiWfaoE886Bv6g RLRYltv9kumhYrbWXRfBCnZA9KVtIYWT0FoDuT42Duz+YMZ2ODAhhVvtnzQHoGS0dj RHL/x7yZ5tx50R2uT5ZVwkJHPIvoKOimbSax5FdId7SZmGIoXPp8L5Jh25AkDENqoJ 84ezKms2ugqL5a38XwooIrkQryzTGt8JTMRaJEIxdX70gYROZ2xWL6s3Rz+vIC2+5l wej6hW3fGHif5vXBvMvfkx9LzIaNFu8kcSzRiBrpCzwahtqZzYiyvSSkyVNGvTU5Qm /nDqQvokJDWfxHM9iD1sQKTq4ymbJYh3d7o2ehJ/rW4Jw2PAFdNG0ICYR7GZPHcRNJ mpon5rjx9jaOCBBAZh+zSmu5VA+J4z2BkONvI7SqEs4IPDqcoF6rq3GiIJi1U+h1YH /rMT1F4Nn8GKSnsqVUhifk2f1vXe51z9YRNvqHn8asBd0c/OGSv From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 10/24] t4060: make test work with SHA-256 Date: Mon, 13 Jan 2020 12:38:43 +0000 Message-Id: <20200113123857.3684632-11-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In this test, there are two main types of object IDs we see in the diffs: the ones for the submodules, which we care about, and the ones for the individual files, which are unrelated to what we're testing. Much of the test already computes the former, so extend the rest of the test to do so as well. Add a diff comparison function that normalizes the differences in the latter, since they're not explicitly what we're testing. Signed-off-by: brian m. carlson --- t/t4060-diff-submodule-option-diff-format.sh | 126 ++++++++++--------- 1 file changed, 70 insertions(+), 56 deletions(-) diff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh index 9dcb69df5c..fc8229c726 100755 --- a/t/t4060-diff-submodule-option-diff-format.sh +++ b/t/t4060-diff-submodule-option-diff-format.sh @@ -42,6 +42,17 @@ commit_file () { git commit "$@" -m "Commit $*" >/dev/null } +diff_cmp () { + for i in "$1" "$2" + do + sed -e 's/^index 0000000\.\.[0-9a-f]*/index 0000000..1234567/' \ + -e 's/^index [0-9a-f]*\.\.[0-9a-f]*/index 1234567..89abcde/' \ + "$i" >"$i.compare" || return 1 + done && + test_cmp "$1.compare" "$2.compare" && + rm -f "$1.compare" "$2.compare" +} + test_expect_success 'setup repository' ' test_create_repo sm1 && add_file . foo && @@ -69,7 +80,7 @@ test_expect_success 'added submodule' ' @@ -0,0 +1 @@ +foo2 EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'added submodule, set diff.submodule' ' @@ -93,7 +104,7 @@ test_expect_success 'added submodule, set diff.submodule' ' @@ -0,0 +1 @@ +foo2 EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success '--submodule=short overrides diff.submodule' ' @@ -109,7 +120,7 @@ test_expect_success '--submodule=short overrides diff.submodule' ' @@ -0,0 +1 @@ +Subproject commit $fullhead1 EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'diff.submodule does not affect plumbing' ' @@ -124,7 +135,7 @@ test_expect_success 'diff.submodule does not affect plumbing' ' @@ -0,0 +1 @@ +Subproject commit $fullhead1 EOF - test_cmp expected actual + diff_cmp expected actual ' commit_file sm1 && @@ -142,7 +153,7 @@ test_expect_success 'modified submodule(forward)' ' @@ -0,0 +1 @@ +foo3 EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'modified submodule(forward)' ' @@ -157,7 +168,7 @@ test_expect_success 'modified submodule(forward)' ' @@ -0,0 +1 @@ +foo3 EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'modified submodule(forward) --submodule' ' @@ -166,7 +177,7 @@ test_expect_success 'modified submodule(forward) --submodule' ' Submodule sm1 $head1..$head2: > Add foo3 ($added foo3) EOF - test_cmp expected actual + diff_cmp expected actual ' fullhead2=$(cd sm1; git rev-parse --verify HEAD) @@ -181,7 +192,7 @@ test_expect_success 'modified submodule(forward) --submodule=short' ' -Subproject commit $fullhead1 +Subproject commit $fullhead2 EOF - test_cmp expected actual + diff_cmp expected actual ' commit_file sm1 && @@ -210,7 +221,7 @@ test_expect_success 'modified submodule(backward)' ' @@ -1 +0,0 @@ -foo3 EOF - test_cmp expected actual + diff_cmp expected actual ' head4=$(add_file sm1 foo4 foo5) @@ -247,7 +258,7 @@ test_expect_success 'modified submodule(backward and forward)' ' @@ -0,0 +1 @@ +foo5 EOF - test_cmp expected actual + diff_cmp expected actual ' commit_file sm1 && @@ -291,7 +302,7 @@ test_expect_success 'typechanged submodule(submodule->blob), --cached' ' @@ -0,0 +1 @@ +sm1 EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'typechanged submodule(submodule->blob)' ' @@ -327,7 +338,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' ' @@ -0,0 +1 @@ +foo5 EOF - test_cmp expected actual + diff_cmp expected actual ' rm -rf sm1 && @@ -344,7 +355,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' ' @@ -0,0 +1 @@ +sm1 EOF - test_cmp expected actual + diff_cmp expected actual ' rm -f sm1 && @@ -356,7 +367,7 @@ test_expect_success 'nonexistent commit' ' cat >expected <<-EOF && Submodule sm1 $head4...$head6 (commits not present) EOF - test_cmp expected actual + diff_cmp expected actual ' commit_file @@ -386,11 +397,12 @@ test_expect_success 'typechanged submodule(blob->submodule)' ' @@ -0,0 +1 @@ +foo7 EOF - test_cmp expected actual + diff_cmp expected actual ' commit_file sm1 && test_expect_success 'submodule is up to date' ' + head7=$(git -C sm1 rev-parse --short --verify HEAD) && git diff-index -p --submodule=diff HEAD >actual && test_must_be_empty actual ' @@ -401,7 +413,7 @@ test_expect_success 'submodule contains untracked content' ' cat >expected <<-EOF && Submodule sm1 contains untracked content EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'submodule contains untracked content (untracked ignored)' ' @@ -433,7 +445,7 @@ test_expect_success 'submodule contains untracked and modified content' ' -foo6 +new EOF - test_cmp expected actual + diff_cmp expected actual ' # NOT OK @@ -450,7 +462,7 @@ test_expect_success 'submodule contains untracked and modified content (untracke -foo6 +new EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'submodule contains untracked and modified content (dirty ignored)' ' @@ -478,7 +490,7 @@ test_expect_success 'submodule contains modified content' ' -foo6 +new EOF - test_cmp expected actual + diff_cmp expected actual ' (cd sm1; git commit -mchange foo6 >/dev/null) && @@ -486,7 +498,7 @@ head8=$(cd sm1; git rev-parse --short --verify HEAD) && test_expect_success 'submodule is modified' ' git diff-index -p --submodule=diff HEAD >actual && cat >expected <<-EOF && - Submodule sm1 17243c9..$head8: + Submodule sm1 $head7..$head8: diff --git a/sm1/foo6 b/sm1/foo6 index 462398b..3e75765 100644 --- a/sm1/foo6 @@ -495,7 +507,7 @@ test_expect_success 'submodule is modified' ' -foo6 +new EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'modified submodule contains untracked content' ' @@ -503,7 +515,7 @@ test_expect_success 'modified submodule contains untracked content' ' git diff-index -p --submodule=diff HEAD >actual && cat >expected <<-EOF && Submodule sm1 contains untracked content - Submodule sm1 17243c9..$head8: + Submodule sm1 $head7..$head8: diff --git a/sm1/foo6 b/sm1/foo6 index 462398b..3e75765 100644 --- a/sm1/foo6 @@ -512,13 +524,13 @@ test_expect_success 'modified submodule contains untracked content' ' -foo6 +new EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'modified submodule contains untracked content (untracked ignored)' ' git diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual && cat >expected <<-EOF && - Submodule sm1 17243c9..$head8: + Submodule sm1 $head7..$head8: diff --git a/sm1/foo6 b/sm1/foo6 index 462398b..3e75765 100644 --- a/sm1/foo6 @@ -527,13 +539,13 @@ test_expect_success 'modified submodule contains untracked content (untracked ig -foo6 +new EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'modified submodule contains untracked content (dirty ignored)' ' git diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual && cat >expected <<-EOF && - Submodule sm1 17243c9..cfce562: + Submodule sm1 $head7..$head8: diff --git a/sm1/foo6 b/sm1/foo6 index 462398b..3e75765 100644 --- a/sm1/foo6 @@ -542,7 +554,7 @@ test_expect_success 'modified submodule contains untracked content (dirty ignore -foo6 +new EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'modified submodule contains untracked content (all ignored)' ' @@ -556,7 +568,7 @@ test_expect_success 'modified submodule contains untracked and modified content' cat >expected <<-EOF && Submodule sm1 contains untracked content Submodule sm1 contains modified content - Submodule sm1 17243c9..cfce562: + Submodule sm1 $head7..$head8: diff --git a/sm1/foo6 b/sm1/foo6 index 462398b..dfda541 100644 --- a/sm1/foo6 @@ -566,7 +578,7 @@ test_expect_success 'modified submodule contains untracked and modified content' +new +modification EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'modified submodule contains untracked and modified content (untracked ignored)' ' @@ -574,7 +586,7 @@ test_expect_success 'modified submodule contains untracked and modified content git diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual && cat >expected <<-EOF && Submodule sm1 contains modified content - Submodule sm1 17243c9..cfce562: + Submodule sm1 $head7..$head8: diff --git a/sm1/foo6 b/sm1/foo6 index 462398b..e20e2d9 100644 --- a/sm1/foo6 @@ -585,14 +597,14 @@ test_expect_success 'modified submodule contains untracked and modified content +modification +modification EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'modified submodule contains untracked and modified content (dirty ignored)' ' echo modification >> sm1/foo6 && git diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual && cat >expected <<-EOF && - Submodule sm1 17243c9..cfce562: + Submodule sm1 $head7..$head8: diff --git a/sm1/foo6 b/sm1/foo6 index 462398b..3e75765 100644 --- a/sm1/foo6 @@ -601,7 +613,7 @@ test_expect_success 'modified submodule contains untracked and modified content -foo6 +new EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'modified submodule contains untracked and modified content (all ignored)' ' @@ -616,7 +628,7 @@ test_expect_success 'modified submodule contains modified content' ' git diff-index -p --submodule=diff HEAD >actual && cat >expected <<-EOF && Submodule sm1 contains modified content - Submodule sm1 17243c9..cfce562: + Submodule sm1 $head7..$head8: diff --git a/sm1/foo6 b/sm1/foo6 index 462398b..ac466ca 100644 --- a/sm1/foo6 @@ -629,29 +641,29 @@ test_expect_success 'modified submodule contains modified content' ' +modification +modification EOF - test_cmp expected actual + diff_cmp expected actual ' rm -rf sm1 test_expect_success 'deleted submodule' ' git diff-index -p --submodule=diff HEAD >actual && cat >expected <<-EOF && - Submodule sm1 17243c9...0000000 (submodule deleted) + Submodule sm1 $head7...0000000 (submodule deleted) EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'create second submodule' ' test_create_repo sm2 && - head7=$(add_file sm2 foo8 foo9) && + head9=$(add_file sm2 foo8 foo9) && git add sm2 ' test_expect_success 'multiple submodules' ' git diff-index -p --submodule=diff HEAD >actual && cat >expected <<-EOF && - Submodule sm1 17243c9...0000000 (submodule deleted) - Submodule sm2 0000000...a5a65c9 (new submodule) + Submodule sm1 $head7...0000000 (submodule deleted) + Submodule sm2 0000000...$head9 (new submodule) diff --git a/sm2/foo8 b/sm2/foo8 new file mode 100644 index 0000000..db9916b @@ -667,13 +679,13 @@ test_expect_success 'multiple submodules' ' @@ -0,0 +1 @@ +foo9 EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'path filter' ' git diff-index -p --submodule=diff HEAD sm2 >actual && cat >expected <<-EOF && - Submodule sm2 0000000...a5a65c9 (new submodule) + Submodule sm2 0000000...$head9 (new submodule) diff --git a/sm2/foo8 b/sm2/foo8 new file mode 100644 index 0000000..db9916b @@ -689,15 +701,15 @@ test_expect_success 'path filter' ' @@ -0,0 +1 @@ +foo9 EOF - test_cmp expected actual + diff_cmp expected actual ' commit_file sm2 test_expect_success 'given commit' ' git diff-index -p --submodule=diff HEAD^ >actual && cat >expected <<-EOF && - Submodule sm1 17243c9...0000000 (submodule deleted) - Submodule sm2 0000000...a5a65c9 (new submodule) + Submodule sm1 $head7...0000000 (submodule deleted) + Submodule sm2 0000000...$head9 (new submodule) diff --git a/sm2/foo8 b/sm2/foo8 new file mode 100644 index 0000000..db9916b @@ -713,7 +725,7 @@ test_expect_success 'given commit' ' @@ -0,0 +1 @@ +foo9 EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'setup .git file for sm2' ' @@ -726,8 +738,8 @@ test_expect_success 'setup .git file for sm2' ' test_expect_success 'diff --submodule=diff with .git file' ' git diff --submodule=diff HEAD^ >actual && cat >expected <<-EOF && - Submodule sm1 17243c9...0000000 (submodule deleted) - Submodule sm2 0000000...a5a65c9 (new submodule) + Submodule sm1 $head7...0000000 (submodule deleted) + Submodule sm2 0000000...$head9 (new submodule) diff --git a/sm2/foo8 b/sm2/foo8 new file mode 100644 index 0000000..db9916b @@ -743,25 +755,27 @@ test_expect_success 'diff --submodule=diff with .git file' ' @@ -0,0 +1 @@ +foo9 EOF - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'setup nested submodule' ' git submodule add -f ./sm2 && git commit -a -m "add sm2" && git -C sm2 submodule add ../sm2 nested && - git -C sm2 commit -a -m "nested sub" + git -C sm2 commit -a -m "nested sub" && + head10=$(git -C sm2 rev-parse --short --verify HEAD) ' test_expect_success 'move nested submodule HEAD' ' echo "nested content" >sm2/nested/file && git -C sm2/nested add file && - git -C sm2/nested commit --allow-empty -m "new HEAD" + git -C sm2/nested commit --allow-empty -m "new HEAD" && + head11=$(git -C sm2/nested rev-parse --short --verify HEAD) ' test_expect_success 'diff --submodule=diff with moved nested submodule HEAD' ' cat >expected <<-EOF && - Submodule nested a5a65c9..b55928c: + Submodule nested $head9..$head11: diff --git a/nested/file b/nested/file new file mode 100644 index 0000000..ca281f5 @@ -772,13 +786,13 @@ test_expect_success 'diff --submodule=diff with moved nested submodule HEAD' ' EOF git -C sm2 diff --submodule=diff >actual 2>err && test_must_be_empty err && - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'diff --submodule=diff recurses into nested submodules' ' cat >expected <<-EOF && Submodule sm2 contains modified content - Submodule sm2 a5a65c9..280969a: + Submodule sm2 $head9..$head10: diff --git a/sm2/.gitmodules b/sm2/.gitmodules new file mode 100644 index 0000000..3a816b8 @@ -788,7 +802,7 @@ test_expect_success 'diff --submodule=diff recurses into nested submodules' ' +[submodule "nested"] + path = nested + url = ../sm2 - Submodule nested 0000000...b55928c (new submodule) + Submodule nested 0000000...$head11 (new submodule) diff --git a/sm2/nested/file b/sm2/nested/file new file mode 100644 index 0000000..ca281f5 @@ -813,7 +827,7 @@ test_expect_success 'diff --submodule=diff recurses into nested submodules' ' EOF git diff --submodule=diff >actual 2>err && test_must_be_empty err && - test_cmp expected actual + diff_cmp expected actual ' test_done From patchwork Mon Jan 13 12:38:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330019 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B79BC14E3 for ; Mon, 13 Jan 2020 12:40:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D50521739 for ; Mon, 13 Jan 2020 12:40:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="Rp0bzhtW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728688AbgAMMkk (ORCPT ); Mon, 13 Jan 2020 07:40:40 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37622 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728646AbgAMMki (ORCPT ); Mon, 13 Jan 2020 07:40:38 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 5003A607FA; Mon, 13 Jan 2020 12:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919237; bh=gbLmKUXxtyA158kwNXH2y6D9PAn8TpijdENNDxul7F8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=Rp0bzhtWzwDVz+LKu9yyua6jcnKvfP1TvVFrTcVP2J5d7stZSGVOMOMdHyzlkjKqM GeGPWOj5Sw0OGqa0CLVcAWxub0FNY2M5fyrNU1m6z8S2pJNL52PUL5JSSZW6lqHcUd 5QAtBeb72GQyLvGP5J0CCHDGg6xtrSEgBeZGxDzyngGJAhxK79M30DN8LV/VpLlTmG 5mZATxtNUOfa35IcJ5+dlhaARD2aQRJfvi4l7hMz0QU65lyKJn8lfLWlB3og5PkBDU 2x7Q2607fR5nxL6im00SLmUKAljlEpi9F2F8GLbzpmB2LYhsp2Mx1b66TzDm9uIQIK pTqlY+SgHjL3M5OKIjPMY4zAiiYilcE6xzge8v+HqgmCWP2+Gsf07qOto/LFIv8yCr rQsiQKse/oM05PZEcT3AQT+itPy5d4GREC7js9odiQTp8M9njXIlrANoV9rQE29kjw Hes6kZiw1UBvhI9WiRt8eItwzXguUx4thauX8g/O9/j4x4+8j2q From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 11/24] t4211: make test hash independent Date: Mon, 13 Jan 2020 12:38:44 +0000 Message-Id: <20200113123857.3684632-12-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test uses several test files that contain hard-coded SHA-1 object IDs. Replace these values with generic ones of the correct size so that the test works with either SHA-1 or SHA-256. Signed-off-by: brian m. carlson --- t/t4211-line-log.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index 8319163744..2cbfd8dd9e 100755 --- a/t/t4211-line-log.sh +++ b/t/t4211-line-log.sh @@ -8,10 +8,20 @@ test_expect_success 'setup (import history)' ' git reset --hard ' +process_output () { + x07="$_x05[0-9a-f][0-9a-f]" + sed -e "s/commit $OID_REGEX/commit $ZERO_OID/" \ + -e "s/commit $_x40$/commit $ZERO_OID/" \ + -e "s/Merge: $x07 $x07$/Merge: 0000000 0000000/" \ + "$1" +} + canned_test_1 () { test_expect_$1 "$2" " - git log $2 >actual && - test_cmp \"\$TEST_DIRECTORY\"/t4211/expect.$3 actual + git log $2 >result && + process_output result >actual && + process_output \"\$TEST_DIRECTORY\"/t4211/expect.$3 >expected && + test_cmp expected actual " } From patchwork Mon Jan 13 12:38:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330023 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26CC213A0 for ; Mon, 13 Jan 2020 12:40:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0506320678 for ; Mon, 13 Jan 2020 12:40:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="xDXdwlJu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728709AbgAMMkl (ORCPT ); Mon, 13 Jan 2020 07:40:41 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37642 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728656AbgAMMkj (ORCPT ); Mon, 13 Jan 2020 07:40:39 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id CC4FC607F9; Mon, 13 Jan 2020 12:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919238; bh=fMUxjGVjhUrESSW40/sCXR/0wiwqI71DHozpjAit15o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=xDXdwlJuqfGdM8Hp8BOSnUr2VhhOzDG395NIX+ISeqD+dx3c+3aWTRXYiF0pfCtA8 IXSYWuuoo0nwFXreg5rZaW5z1Fh7PPNSfKY6Se6OcbsBpgvidSsoZ+J+JJ/YPSqoeU PTLg0xHOjMiqpzxjGPOhAGeeDk8hh3u9PE4KXQmox4pZCsVzajPd8FNTUn8ZPtsBDe eJwEM97jkA5dKmcgerwQ1fK3htySEHO+oyQqNsOg8iqfsXsLDG2Wm2VxORAk1GGeW3 xNagrh07+OA26LNKQYqjbk3mGXQJL3w2gxt6Em2C/3LpFJ+VYmIDLeM7T6oHhYczym 496vzpgqGD1yQjzs/q3zEtwC1jwwsTClg4H4I+BXyv79YboBgZZ5BBzTVSTAUeUKwq llrXLBTOeFZ50E+BD2mkF61Hbws8CB2qNZq/oTZmvnotPMbKp/PNXLWRR4wtyqXOvF OHr9hI2x7B5sYe9sLPLvx/LVkbdNo5yhG/0rY2woxRFNFFJuU5a From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 12/24] t5302: make hash size independent Date: Mon, 13 Jan 2020 12:38:45 +0000 Message-Id: <20200113123857.3684632-13-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Compute the length of object IDs and pack offsets instead of hard-coding constants. Signed-off-by: brian m. carlson --- t/t5302-pack-index.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh index 91d51b35f9..93ac003639 100755 --- a/t/t5302-pack-index.sh +++ b/t/t5302-pack-index.sh @@ -8,7 +8,8 @@ test_description='pack index with 64-bit offsets and object CRC' test_expect_success \ 'setup' \ - 'rm -rf .git && + 'test_oid_init && + rm -rf .git && git init && git config pack.threads 1 && i=1 && @@ -32,7 +33,9 @@ test_expect_success \ echo $tree && git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\) .*/\\1/" } >obj-list && - git update-ref HEAD $commit' + git update-ref HEAD $commit && + rawsz=$(test_oid rawsz) +' test_expect_success \ 'pack-objects with index version 1' \ @@ -152,6 +155,7 @@ test_expect_success \ '[index v1] 2) create a stealth corruption in a delta base reference' \ '# This test assumes file_101 is a delta smaller than 16 bytes. # It should be against file_100 but we substitute its base for file_099 + offset=$((rawsz + 4)) && sha1_101=$(git hash-object file_101) && sha1_099=$(git hash-object file_099) && offs_101=$(index_obj_offset 1.idx $sha1_101) && @@ -159,8 +163,8 @@ test_expect_success \ chmod +w ".git/objects/pack/pack-${pack1}.pack" && dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \ if=".git/objects/pack/pack-${pack1}.idx" \ - skip=$((4 + 256 * 4 + $nr_099 * 24)) \ - bs=1 count=20 conv=notrunc && + skip=$((4 + 256 * 4 + $nr_099 * offset)) \ + bs=1 count=$rawsz conv=notrunc && git cat-file blob $sha1_101 > file_101_foo1' test_expect_success \ @@ -200,8 +204,8 @@ test_expect_success \ chmod +w ".git/objects/pack/pack-${pack1}.pack" && dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \ if=".git/objects/pack/pack-${pack1}.idx" \ - skip=$((8 + 256 * 4 + $nr_099 * 20)) \ - bs=1 count=20 conv=notrunc && + skip=$((8 + 256 * 4 + $nr_099 * rawsz)) \ + bs=1 count=$rawsz conv=notrunc && git cat-file blob $sha1_101 > file_101_foo2' test_expect_success \ @@ -226,7 +230,7 @@ test_expect_success \ nr=$(index_obj_nr ".git/objects/pack/pack-${pack1}.idx" $obj) && chmod +w ".git/objects/pack/pack-${pack1}.idx" && printf xxxx | dd of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \ - bs=1 count=4 seek=$((8 + 256 * 4 + $(wc -l /dev/null || exit 1 done X-Patchwork-Id: 11330057 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5AF7192A for ; Mon, 13 Jan 2020 12:41:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 398642081E for ; Mon, 13 Jan 2020 12:41:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="EEEqGn55" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728794AbgAMMk7 (ORCPT ); Mon, 13 Jan 2020 07:40:59 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37648 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728669AbgAMMkj (ORCPT ); Mon, 13 Jan 2020 07:40:39 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 5682F60800; Mon, 13 Jan 2020 12:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919238; bh=rt5DiMkEaojCqryZXItjFk7ouIEXKkpQBMjtvt74YP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=EEEqGn55AOBXWhxUQRHH3gWX9YW8zLNPLaftrQQtFTLXScbxUNWcq1RyZYnOz4kQG VutIlNZRdPdB4qMwp5/2UnOzmb4GV0Jkjndj36pxC+oVgcNCrdOn1oJoTwQjOorOWW I6xAmFC69nT/8izu4zt715PpHzg5e1kWdgkgaFma+1ladR3iixo5eA995waoAvnX6Z CfkFOrGB+EoMYj0kovWBkq0h1Br6l4Jqn/iRw24Q8sfIodh9cVH2yK5+1iVnU8qtJU Lb9q/YBxFJ+wOZiEZtGxMksm0jM1PJ+ACs2Sj/73z/dhvzOQS8h98f4zYo+fDDvcsO WS4BCtaKtjVs4RVCYa4rQsMZE3L07SLlwKt+o9cxBk7hvfhGgCa+mycKd9FVeL91HO 4J1lQEV1wa00Uo1WR644JqAjdFdy7mCar7KTvMnJSlS0bzpWTysqaVCul+N9ptbqKn YJPyQ3UJnUY4QjAZDQV0Z8doGvyL9VFtqTtnR0Q6Yh6urbORN4C From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 13/24] t5309: make test hash independent Date: Mon, 13 Jan 2020 12:38:46 +0000 Message-Id: <20200113123857.3684632-14-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use the proper pack constants defined in lib-pack.sh to make this test work with SHA-256. Signed-off-by: brian m. carlson --- t/t5309-pack-delta-cycles.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/t/t5309-pack-delta-cycles.sh b/t/t5309-pack-delta-cycles.sh index 491556dad9..b6b9792913 100755 --- a/t/t5309-pack-delta-cycles.sh +++ b/t/t5309-pack-delta-cycles.sh @@ -4,15 +4,9 @@ test_description='test index-pack handling of delta cycles in packfiles' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-pack.sh -if ! test_have_prereq SHA1 -then - skip_all='not using SHA-1 for objects' - test_done -fi - # Two similar-ish objects that we have computed deltas between. -A=01d7713666f4de822776c7622c10f1b07de280dc -B=e68fe8129b546b101aee9510c5328e7f21ca1d18 +A=$(test_oid packlib_7_0) +B=$(test_oid packlib_7_76) # double-check our hand-constucted packs test_expect_success 'index-pack works with a single delta (A->B)' ' From patchwork Mon Jan 13 12:38:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330033 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EAD6892A for ; Mon, 13 Jan 2020 12:40:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA1452073D for ; Mon, 13 Jan 2020 12:40:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="dw/UfAeK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728757AbgAMMkr (ORCPT ); Mon, 13 Jan 2020 07:40:47 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37622 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728679AbgAMMkj (ORCPT ); Mon, 13 Jan 2020 07:40:39 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id D2760607FD; Mon, 13 Jan 2020 12:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919239; bh=aGgZXgjC/u7SYDnExKoklgw7U9IxQ+/KT83xluNkPZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=dw/UfAeKRPEYVWxFbP2xFy3oZyVm/FNSkjON494B7gOK43LSO+6z2uBjZ3BgBZ056 uzat7Kp8Ot78rGpLJtyKGVseET+/1pmWh1ZeXM8B9J/EmN0q6CVtjzLYHQ86VLS6H2 yHZFg0HsAiIzr3gUM7Mf4CSA6zhcBJLeCS2ABubnPGBZuPeGMJWJ3Yv8etbQbZfd5F oMOvaiz9R74cgZcF2oGeGgTPoDb0oCSoMZ5PhM4E0yZVdVIpHcjw9tYYf+lv5Jlcfi z6JfpBVDi39nlnfD45jebr3IWe9OcklIg65fb2AoARIzalyjLiVYi4lf400zVTkqYb 8xSlq+yJSd/lDVQ6S0VNoBPFKXlrU+5opIbrjPongTk+ickDghYpk0sat2W83cMrDn DpJNHGQlLaC0WneFbWgF/CSc3CtXzNy+wtV74PU2CsZ9cA7FIfmjIpTBpzh3X0CPQA P6TyduaDMKEEelMXSRax/Xm8smMdMfileylZyuuppCsvZ6el+MC From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 14/24] t5313: make test hash independent Date: Mon, 13 Jan 2020 12:38:47 +0000 Message-Id: <20200113123857.3684632-15-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Make this test hash independent by computing the length of the object offsets and looking up values which will hash to object IDs with the right properties. Signed-off-by: brian m. carlson --- t/t5313-pack-bounds-checks.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/t/t5313-pack-bounds-checks.sh b/t/t5313-pack-bounds-checks.sh index f1708d415e..8d805f845a 100755 --- a/t/t5313-pack-bounds-checks.sh +++ b/t/t5313-pack-bounds-checks.sh @@ -38,16 +38,27 @@ munge () { # for the initial, and another ofs(4*nr) past that for the extended. # ofs_table () { - echo $((4 + 4 + 4*256 + 20*$1 + 4*$1)) + echo $((4 + 4 + 4*256 + $(test_oid rawsz)*$1 + 4*$1)) } extended_table () { echo $(($(ofs_table "$1") + 4*$1)) } +test_expect_success 'setup' ' + test_oid_init && + test_oid_cache <<-EOF + oid000 sha1:1485 + oid000 sha256:4222 + + oidfff sha1:74 + oidfff sha256:1350 + EOF +' + test_expect_success 'set up base packfile and variables' ' # the hash of this content starts with ff, which # makes some later computations much simpler - echo 74 >file && + echo $(test_oid oidfff) >file && git add file && git commit -m base && git repack -ad && @@ -140,10 +151,10 @@ test_expect_success 'bogus offset inside v2 extended table' ' # an extended table (if the first object were larger than 2^31). # # Note that the value is important here. We want $object as - # the second entry in sorted-sha1 order. The sha1 of 1485 starts + # the second entry in sorted-sha1 order. The hash of this object starts # with "000", which sorts before that of $object (which starts # with "fff"). - second=$(echo 1485 | git hash-object -w --stdin) && + second=$(test_oid oid000 | git hash-object -w --stdin) && do_pack "$object $second" --index-version=2 && # We have to make extra room for the table, so we cannot From patchwork Mon Jan 13 12:38:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330055 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F6C813A0 for ; Mon, 13 Jan 2020 12:41:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E12F2073D for ; Mon, 13 Jan 2020 12:41:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="PpJMpEqW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726163AbgAMMk6 (ORCPT ); Mon, 13 Jan 2020 07:40:58 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37654 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728682AbgAMMkk (ORCPT ); Mon, 13 Jan 2020 07:40:40 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 5A51B607FF; Mon, 13 Jan 2020 12:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919239; bh=1MOOFACdi6walbZenN3/PtmmpgSl97nBTVUJrzTxn5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=PpJMpEqWmneDdg0TMIqJjMq6m3cDfl0StErICGgwz5guTF6y2wvNCXeBB9oR5Yrxb BzWHuLKu4RB0w2A4T54U8uwCYX3U6VKe7QqTIQZ7VBXT46rEWgmZCkBSLKWsyD5bdm yfjx19FnBT0FvP9ocArhWSW3CPgI6jaNrb8iuukPOIQSioTYnmjsYtBBdxiqfhlAcq eEvC53kQkLguqEhzSjfeWtEZgb/NJG9Oqj9/C5u4FobNjIqRlyxF59iNGkyy3tizls 3vdlXfpyV0C+FdplQaqRQL/+ChJcYkIKlEx2igdcvXfzICCfflWT5fFj+UqI0tcGXZ tZN/kxhAgp/kE/rPq17dW5YkFfO8JJ+gzelhAMg9n8x1Qwf1RKss/+i8+bWvpW9X6E y+HPsbmiEnx/ONHjk2O06QxFUlChl1MEJQejkJJI0Mvz7xN2RXYBwPQ2K5Xa+Ig4Vi NS+saWy18uOrOFfzjp/2rgxTb9novxRkvdywKVf8y1NS1TbEGjM From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 15/24] t5321: make test hash independent Date: Mon, 13 Jan 2020 12:38:48 +0000 Message-Id: <20200113123857.3684632-16-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use the proper pack constants defined in lib-pack.sh to make this test work with SHA-256. Signed-off-by: brian m. carlson --- t/t5321-pack-large-objects.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5321-pack-large-objects.sh b/t/t5321-pack-large-objects.sh index a75eab87d3..8a56d98a0e 100755 --- a/t/t5321-pack-large-objects.sh +++ b/t/t5321-pack-large-objects.sh @@ -10,8 +10,8 @@ test_description='git pack-object with "large" deltas . "$TEST_DIRECTORY"/lib-pack.sh # Two similar-ish objects that we have computed deltas between. -A=01d7713666f4de822776c7622c10f1b07de280dc -B=e68fe8129b546b101aee9510c5328e7f21ca1d18 +A=$(test_oid packlib_7_0) +B=$(test_oid packlib_7_76) test_expect_success 'setup' ' clear_packs && From patchwork Mon Jan 13 12:38:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330049 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A326913A0 for ; Mon, 13 Jan 2020 12:40:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8184A206D7 for ; Mon, 13 Jan 2020 12:40:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="fGRna6gt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728783AbgAMMkz (ORCPT ); Mon, 13 Jan 2020 07:40:55 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37642 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728689AbgAMMkl (ORCPT ); Mon, 13 Jan 2020 07:40:41 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id F07BE607F9; Mon, 13 Jan 2020 12:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919240; bh=KMlbQUXnLJwuatxpaf7NN8zHuMWYuxvhu8lVfi5kLeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=fGRna6gt1OLdjIMmUXo0Xl+20mGLll2j6Nng4q3EIzdC/ra+TkCqu1IwDRKHIIzdF 4L0sus45aFkp9FgYijIzKtpZyk1q3Cdq6hOzxHK++eIZycEfnVa8Irl3ZmhOmKJGBW totMW/0+zELSl93vcWbVs83EyKG7xEUhxC34K1NSxmyelm1mup5n1nqyEmWHIKaxQJ tFHTR3YJk2XV+YOsuF0gJNeLlDR9UBhe/BFJH1wSF5pidFJaU17dcfYnOQYt9aeZAD X2u8IWCVns19GuSb05b9fOJNyjvoRF6BlNaUqoqV5XiXkyPRcJyWWwxCibF1sBo1NN hSqhinClp/ox8PknNQ5R+AGOSn5B7I3YzjlED2n1Cy9BRQUNCkrbKwNeIW1z4+TSOq pcJNDKuQf2FeomffWl6HNMbpNiEEsnWHMeA2FzeAO72sDtvOz003GZ0v2JTBdo5r4a A/m9Cm0wbv9KzOEdcOidI+kX5UfrZswJ8HCWHwYLqCbdpu4uSGU From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 16/24] t5515: make test hash independent Date: Mon, 13 Jan 2020 12:38:49 +0000 Message-Id: <20200113123857.3684632-17-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test contains a large number of data files, mostly using the same object ID values for refs. Instead of producing two separate sets of test files, keep the test files using SHA-1 and translate them on the fly by replacing the SHA-1 values with the values for the current hash algorithm in use. Signed-off-by: brian m. carlson --- t/t5515-fetch-merge-logic.sh | 51 +++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh index 961eb35c99..ed49df582d 100755 --- a/t/t5515-fetch-merge-logic.sh +++ b/t/t5515-fetch-merge-logic.sh @@ -12,11 +12,50 @@ GIT_TEST_PROTOCOL_VERSION= . ./test-lib.sh +convert_expected () { + file="$1" && + for i in one three_file master master2 one_tree three two two2 three2 + do + sed -e "s/$(test_oid --hash=sha1 "$i")/$(test_oid "$i")/g" \ + "$file" >"$file.tmp" && + mv "$file.tmp" "$file" + done +} + test_expect_success setup ' GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" && GIT_COMMITTER_DATE="2006-06-26 00:00:00 +0000" && export GIT_AUTHOR_DATE GIT_COMMITTER_DATE && + test_oid_cache <<-EOF && + one sha1:8e32a6d901327a23ef831511badce7bf3bf46689 + one sha256:8739546433ab1ac72ee93088dce611210effee072b2b586ceac6dde43ebec9ce + + three_file sha1:0e3b14047d3ee365f4f2a1b673db059c3972589c + three_file sha256:bc4447d50c07497a8bfe6eef817f2364ecca9d471452e43b52756cc1a908bd32 + + master sha1:6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 + master sha256:8521c3072461fcfe8f32d67f95cc6e6b832a2db2fa29769ffc788bce85ebcd75 + + one_tree sha1:22feea448b023a2d864ef94b013735af34d238ba + one_tree sha256:6e4743f4ef2356b881dda5e91f5c7cdffe870faf350bf7b312f80a20935f5d83 + + three sha1:c61a82b60967180544e3c19f819ddbd0c9f89899 + three sha256:0cc6d1eda617ded715170786e31ba4e2d0185404ec5a3508dd0d73b324860c6a + + two sha1:525b7fb068d59950d185a8779dc957c77eed73ba + two sha256:3b21de3440cd38c2a9e9b464adb923f7054949ed4c918e1a0ac4c95cd52774db + + master2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f + master2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0 + + two2 sha1:6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 + two2 sha256:87a2d3ee29c83a3dc7afd41c0606b11f67603120b910a7be7840accdc18344d4 + + three2 sha1:0567da4d5edd2ff4bb292a465ba9e64dcad9536b + three2 sha256:cceb3e8eca364fa9a0a39a1efbebecacc664af86cbbd8070571f5faeb5f0e8c3 + EOF + echo >file original && git add file && git commit -a -m One && @@ -137,6 +176,10 @@ do actual_r="$pfx-refs.$test" test_expect_success "$cmd" ' + cp "$expect_f" expect_f && + convert_expected expect_f && + cp "$expect_r" expect_r && + convert_expected expect_r && { echo "# $cmd" set x $cmd; shift @@ -152,18 +195,18 @@ do cat .git/FETCH_HEAD } >"$actual_f" && git show-ref >"$actual_r" && - if test -f "$expect_f" + if test -f "expect_f" then - test_cmp "$expect_f" "$actual_f" && + test_cmp "expect_f" "$actual_f" && rm -f "$actual_f" else # this is to help developing new tests. cp "$actual_f" "$expect_f" false fi && - if test -f "$expect_r" + if test -f "expect_r" then - test_cmp "$expect_r" "$actual_r" && + test_cmp "expect_r" "$actual_r" && rm -f "$actual_r" else # this is to help developing new tests. From patchwork Mon Jan 13 12:38:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330051 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C860113A0 for ; Mon, 13 Jan 2020 12:40:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D7B920678 for ; Mon, 13 Jan 2020 12:40:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="Ccwo7hY/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728789AbgAMMk5 (ORCPT ); Mon, 13 Jan 2020 07:40:57 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37688 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728695AbgAMMkl (ORCPT ); Mon, 13 Jan 2020 07:40:41 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 787EE60801; Mon, 13 Jan 2020 12:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919240; bh=c545IyMuR7DdPUJnClTjechfdZUp/6Yx52J2M+FpRPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=Ccwo7hY/vN+3sMuhNcsERPgVoEMvkeiDPKcWs4WnAHPHhD/hwni3ATWVRks2c8NGC wvbzWyiGUpt2o6SUivqKj5fJS6bY/v6H3YQRr9mswOeseD9cLVH1x9MJdMb+yq5MIN Yp2B8ybZapDb4A17Fc0vozyz2CX3ZQDJBMcr/zbYyXvfby3AH1A4aAjubVnOrRs2xX b/bMt3sIGWRw7BVtSNO1VAbJWI8y7Pl8xG7AGL+70zR8ej61ZCaNch5jGZFCm7EGBn Rw3CXBKPENsBd+BuNrtn8/U9HWAxnxxZnRW2Mf3+3n9hziN5SWpeLaB5XYjeYTK3BJ 0n/w9vpSLUEBcZcvYdWwD1rOe+UPFFxduoTo/H/1iNDhMPbwSMX59N9Nq4ztcE9npT IXIE5qoXsMuHSQqyPBX+1AmHOL8kZ584HjqXoJmhD3l3uVhPxjlPU8go/qmkcSqfmy gUBve67YoRoTEmM00YGPgI16khoL8Kmvw5iv/qb0C8cpI6yIaOY From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 17/24] t5318: update for SHA-256 Date: Mon, 13 Jan 2020 12:38:50 +0000 Message-Id: <20200113123857.3684632-18-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Switch two tests to use $ZERO_OID to represent the all-zeros object ID. --- t/t5318-commit-graph.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index 3f03de6018..55a94072b1 100755 --- a/t/t5318-commit-graph.sh +++ b/t/t5318-commit-graph.sh @@ -629,7 +629,7 @@ test_expect_success 'corrupt commit-graph write (broken parent)' ' empty="$(git mktree broken <<-EOF && tree $empty - parent 0000000000000000000000000000000000000000 + parent $ZERO_OID author whatever 1234 -0000 committer whatever 1234 -0000 @@ -650,7 +650,7 @@ test_expect_success 'corrupt commit-graph write (missing tree)' ' cd repo && tree="$(git mktree broken <<-EOF && - parent 0000000000000000000000000000000000000000 + parent $ZERO_OID author whatever 1234 -0000 committer whatever 1234 -0000 From patchwork Mon Jan 13 12:38:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330045 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1866992A for ; Mon, 13 Jan 2020 12:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB9F92073D for ; Mon, 13 Jan 2020 12:40:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="eIB2kMRM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728777AbgAMMky (ORCPT ); Mon, 13 Jan 2020 07:40:54 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37692 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728712AbgAMMkn (ORCPT ); Mon, 13 Jan 2020 07:40:43 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 02A4160803; Mon, 13 Jan 2020 12:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919241; bh=Y7kJpbQwjoMAfH3zbNksxZJsfsrGPg2xO3iFh85F+GI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=eIB2kMRMt4+s4AJyqkj/ERt+lUnoKHrWkND1uXa9DbdPYzzboMbFu78+Qmm4pVoSp iZmz1maWr1jSO40hOzMHV4+RC9V4uuWomZXDYgOFmhR8fKRH3nM7YDWmUp6ZgeFBO0 WWmxwTZweMTrOfQPfWOZzavkUe0okMjP3x7jefQb046j6xmC9VUePkjgVxa3f58Bqg OPe/pySpFE/D9k1XmMyYnOBHPX3IbjWOiLBv2hOZ/dHwO5ElEVra4LZ2+M+3D2ML1v Rev2GRToFZioaU8sa/ERfho8zWZuxwUG9AqZoZ3c0YWU4t1fjaLvJRDWQVriAEHpeF 7tKaAnPQYOrT4zigM2afKJJRbvkm/emoRmh4XMkS5Z5vHAJtaHWK0V+lZyfmmG8Wlm lLmxHugjAZuusiH6CWg0Fs7Lw2KH6gBwd3QkMxvRw0fg4dPM8AItx7+NbzL1a8LHSC FkNNe2SslHsgrohowYbB+BAsh/3M6UsNiE0f69A/rixsgdNeidn From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 18/24] t5616: use correct filter syntax Date: Mon, 13 Jan 2020 12:38:51 +0000 Message-Id: <20200113123857.3684632-19-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In the setup steps for the promisor remote tests, we clone a repository and filter out all trees with depth greater than or equal to zero, which also filters out all blobs. With SHA-1, this test passes because the object we happen to request from the server is the blob that the promisor remote has. However, due to a different ordering with SHA-256, we request the tree containing that blob, which the promisor remote does not have. As a consequence, we fail with a "not our ref" error. Since what we want to test is that the blob is transferred, let's adjust the filter to just filter out blobs, not trees. That means that we'll transfer the previously problematic tree as part of the normal clone, and we can then test that the blob is fetched from the promisor remote as expected. Signed-off-by: brian m. carlson --- t/t5616-partial-clone.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh index fea56cda6d..9fd6e780f9 100755 --- a/t/t5616-partial-clone.sh +++ b/t/t5616-partial-clone.sh @@ -317,7 +317,7 @@ setup_triangle () { cp big-blob.txt server && git -C server add big-blob.txt && git -C server commit -m "initial" && - git clone --bare --filter=tree:0 "file://$(pwd)/server" client && + git clone --bare --filter=blob:none "file://$(pwd)/server" client && echo another line >>server/big-blob.txt && git -C server commit -am "append line to big blob" && From patchwork Mon Jan 13 12:38:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330047 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D4B292A for ; Mon, 13 Jan 2020 12:40:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F69020678 for ; Mon, 13 Jan 2020 12:40:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="cq5cl4t1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728779AbgAMMky (ORCPT ); Mon, 13 Jan 2020 07:40:54 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37698 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728714AbgAMMkn (ORCPT ); Mon, 13 Jan 2020 07:40:43 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 9966D60804; Mon, 13 Jan 2020 12:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919242; bh=8FU4zHKprYpeY3ERg5TngHjUqssaMsZOwf9nyGbqoW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=cq5cl4t1Ggv5Hu/6eMjQyDA/ksTX0vRmMqUE2eWBkS43dxg03OvfdpncPTC69UvPS +vlxP0YeLLBq+cA+5OF4XSz2oIu8k3qGZmPUvPCW517ONQaqST0WzmMoa7pT94LAE2 +1du38w+E96WuFK52q7WmPIMf4lNg5k/otW/7Y1TFslPrwb1SCwzPnI77JFdaaz+h5 /jv/Kyd81s8bOaSbYtMRcXJODh30rfYsBpoY5z4BU13SluOpy4wqrOcr/j9RukonZ/ GtYCb3tGsIW8dzl6bmWF9TS4IlNzsZ3UwR/NTfRaPtqzp7I3vAnQY0FfzGrI158nUr QC0TLLU1Fe2gwBk8cN3BF7xV5tGeYexL4BDoQA0D66RUu3zBeHZuhVvHix8WVpQuk2 Rh7pwBe8L/ILqbP2hjIwr4ilOH/nKwuj2I8O433Y1M31cLXrVQJmtUkFWf7HJKbsJ+ eitFQ+CKTAkDyEK5q2VA2nBtFK+RP8LKVN0tUsUxF1aGJ1ROtUQ From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 19/24] t5607: make hash size independent Date: Mon, 13 Jan 2020 12:38:52 +0000 Message-Id: <20200113123857.3684632-20-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use $OID_REGEX instead of a hard-coded regular expression. Signed-off-by: brian m. carlson --- t/t5607-clone-bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh index b7a3fdf02d..9108ff6fbd 100755 --- a/t/t5607-clone-bundle.sh +++ b/t/t5607-clone-bundle.sh @@ -64,7 +64,7 @@ test_expect_success 'ridiculously long subject in boundary' ' test -s heads && git fetch long-subject-bundle.bdl && sed -n "/^-/{p;q;}" long-subject-bundle.bdl >boundary && - grep "^-[0-9a-f]\\{40\\} " boundary + grep "^-$OID_REGEX " boundary ' test_expect_success 'prerequisites with an empty commit message' ' From patchwork Mon Jan 13 12:38:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330037 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2AEE413A0 for ; Mon, 13 Jan 2020 12:40:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F324B2073D for ; Mon, 13 Jan 2020 12:40:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="QUeL9Kpb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728761AbgAMMkt (ORCPT ); Mon, 13 Jan 2020 07:40:49 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37706 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728721AbgAMMko (ORCPT ); Mon, 13 Jan 2020 07:40:44 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 39A7E60805; Mon, 13 Jan 2020 12:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919242; bh=UiEBiYonKIHRzY5R3z8HJ6v27fAEBjI9BEMPBGR3hDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=QUeL9Kpb+HKzfFImD8ZSoolCPJjxQTV+Kd/YqxSqwjc1VJ7up9xlR53AU9r0OsXhO 5zAzHiNB69I8PNbFKaZJVUlLbS819v0GdZtsVUHTqlcmsO2tNuwhhCJo5d+lqDes5R sASAFbl1tg1ZGRwafBBOlPlfLrWymTJdVpPHs4y94ruXPwfSNtPptpZ8DCfLa8RCT3 O0S50YR74mf5hUmQCQheO4eVsGCpiGRxcp/tInMovBYocQj2XcUjC0RrOGmor1RJie d3mUJ5ZUAqQ8qq/osvLGu6GhAh8LpGcaQDbKC43lrFF2yLVOlOtuMMurPcRWdO0rL/ w0ZCv91p5b/e/I2qDPYzenH3vCm1OjaAZsB8UiiGt/b1rSkJm/Fe22FCa34g3WD9aY Y5DViq/Q6P4s6pwq4RcQWH8Ei8XpJNQgnSiI4IIqzIEdm+crKxOKTEFiTkdUnAwAwk LviTbJkVIWFkEm+9av6DrqIBAQ6+pWFPzIJZc50/+4iYM4j0Yi1 From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 20/24] t5703: make test work with SHA-256 Date: Mon, 13 Jan 2020 12:38:53 +0000 Message-Id: <20200113123857.3684632-21-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test used an object ID which was 40 hex characters in length, causing the test not only not to pass, but to hang, when run with SHA-256 as the hash. Change this value to a fixed dummy object ID using test_oid_init and test_oid. Furthermore, ensure we extract an object ID of the appropriate length using cut with fields instead of a fixed length. Signed-off-by: brian m. carlson --- t/t5703-upload-pack-ref-in-want.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh index 1424fabd4a..852c01ecb4 100755 --- a/t/t5703-upload-pack-ref-in-want.sh +++ b/t/t5703-upload-pack-ref-in-want.sh @@ -19,7 +19,7 @@ get_actual_commits () { }' o.pack && git index-pack o.pack && git verify-pack -v o.idx >objs && - grep commit objs | cut -c-40 | sort >actual_commits + grep commit objs | cut -d" " -f1 | sort >actual_commits } check_output () { @@ -37,6 +37,7 @@ check_output () { # \ | / # a test_expect_success 'setup repository' ' + test_oid_init && test_commit a && git checkout -b o/foo && test_commit b && From patchwork Mon Jan 13 12:38:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330035 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE63613A0 for ; Mon, 13 Jan 2020 12:40:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BCA94206D7 for ; Mon, 13 Jan 2020 12:40:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="obFrzwy1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728759AbgAMMks (ORCPT ); Mon, 13 Jan 2020 07:40:48 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37708 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726946AbgAMMko (ORCPT ); Mon, 13 Jan 2020 07:40:44 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id B411C60806; Mon, 13 Jan 2020 12:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919243; bh=QHnDg5ZYTySZwXWhyF/Hv57H78VbkNYZhjhoZotl4fE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=obFrzwy1Pq6KLTU+bZgEb3upp0IVgk5tfEO+lSebBGqvCt5dRXf656uMucWPCrcsA 0Uw1V+otr7cilr1POHzGebfjCMeSODuqmv59i58Y+XR4WG/k+Z99ENkioXn+jLxp0L 3bOsBnMPj1yxqrUAoOXsQ0sP2KVXVEHMzsN+JpMZBY1+cNYCgVGsdWYopG0kVNbjQY 1N+xjqLLlPBUFFkmUtATueTRpCl7eiBCpFb7WWzWUUiWgfddtReIP3U7LsMqOHq+gO labGCh2Mysw8wgviShtuMCXRtKaSX2o4gVojcqnOjPrfXnzl4KnzrdsGbLsemapM9L GHlraYd2eX+8IPb3FNejtHLKdMeH+TPDbwvWDTHPl8mxHiYc/thAna0rAH8tnNnzpp VPMK7MGRIxibZ+MuVYwiwQWK7UnYvubvhhieGVCvueHz2xwAEc7vuFBWgv7aXMD5EM I0kEAHMlNnBERR6a8q2h18TNTQB+TlWNFxPxokla8RDQlfn1RQj From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 21/24] t5703: switch tests to use test_oid Date: Mon, 13 Jan 2020 12:38:54 +0000 Message-Id: <20200113123857.3684632-22-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org To make this test work correctly with SHA-256, switch the hard-coded invalid object IDs to use test_oid. Signed-off-by: brian m. carlson --- t/t5703-upload-pack-ref-in-want.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh index 852c01ecb4..8aeeaac509 100755 --- a/t/t5703-upload-pack-ref-in-want.sh +++ b/t/t5703-upload-pack-ref-in-want.sh @@ -334,7 +334,7 @@ test_expect_success 'server is initially ahead - no ref in want' ' git -C "$REPO" config uploadpack.allowRefInWant false && rm -rf local && cp -r "$LOCAL_PRISTINE" local && - inconsistency master 1234567890123456789012345678901234567890 && + inconsistency master $(test_oid numeric) && test_must_fail git -C local fetch 2>err && test_i18ngrep "fatal: remote error: upload-pack: not our ref" err ' @@ -343,7 +343,7 @@ test_expect_success 'server is initially ahead - ref in want' ' git -C "$REPO" config uploadpack.allowRefInWant true && rm -rf local && cp -r "$LOCAL_PRISTINE" local && - inconsistency master 1234567890123456789012345678901234567890 && + inconsistency master $(test_oid numeric) && git -C local fetch && git -C "$REPO" rev-parse --verify master >expected && From patchwork Mon Jan 13 12:38:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330043 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DBE9B14E3 for ; Mon, 13 Jan 2020 12:40:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA300206D7 for ; Mon, 13 Jan 2020 12:40:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="kWzO40xB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728774AbgAMMkw (ORCPT ); Mon, 13 Jan 2020 07:40:52 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37726 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728738AbgAMMkp (ORCPT ); Mon, 13 Jan 2020 07:40:45 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 3C40860807; Mon, 13 Jan 2020 12:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919243; bh=v2ra5Eax7vyEoIVpdVzxoQPYGq+Dzugdnx/nwcCR7xo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=kWzO40xBIqnaH2GxJrt8XVQ+rrt12ojALyya1RlAreEk2cYAzjhCGcsJ+ddCGfHO4 BlVvQkYYJzD1eL9qcMCxff+NMKhnPiS3o5vvq6tPQEM3HGAqA96Q790+A2DbnjFTc0 epZo5ylir9TWqtEZ9i2tARw2Q2rjxwA3Tv7ZcfdPweX97AKiaj1MQD2XzTsevG1SJx BQfcUlRj/r5k3PEvc/e30kANEM04ewHvAHTTUCtAIynCX57Sc9xV80EgafZwdZRPDV 8Bs1qBDd3EiOpawXxSPzHDkIawJmYY5AElKudhu7pWI+p3aL5urmQdCZrmDMX+FGDU VRii+fEUB0/c5++b2eFfXkla6YAdrrVlgQzwcNSGrhAzukIalazdCw8z2zWwBkmYFs earudX1lW7vj1MshbUJGAnBfRueM3sb2+QWiT03KBjoMFbihJmbRnCdXFtHIl1VNNX z4jxXjwm49qXMxwQCR6hI1cO9Hlag+0/IxUD8/8wSlynPkc1JFI From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 22/24] t6000: abstract away SHA-1-specific constants Date: Mon, 13 Jan 2020 12:38:55 +0000 Message-Id: <20200113123857.3684632-23-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t6000-rev-list-misc.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh index b8cf82349b..a0baf9ee43 100755 --- a/t/t6000-rev-list-misc.sh +++ b/t/t6000-rev-list-misc.sh @@ -104,13 +104,16 @@ test_expect_success 'rev-list can show index objects' ' # - we do not show the root tree; since we updated the index, it # does not have a valid cache tree # - cat >expect <<-\EOF && - 8e4020bb5a8d8c873b25de15933e75cc0fc275df one - d9d3a7417b9605cfd88ee6306b28dadc29e6ab08 only-in-index - 9200b628cf9dc883a85a7abc8d6e6730baee589c two - EOF echo only-in-index >only-in-index && test_when_finished "git reset --hard" && + rev1=$(git rev-parse HEAD:one) && + rev2=$(git rev-parse HEAD:two) && + revi=$(git hash-object only-in-index) && + cat >expect <<-EOF && + $rev1 one + $revi only-in-index + $rev2 two + EOF git add only-in-index && git rev-list --objects --indexed-objects >actual && test_cmp expect actual From patchwork Mon Jan 13 12:38:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E1D113A0 for ; Mon, 13 Jan 2020 12:40:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C5222073D for ; Mon, 13 Jan 2020 12:40:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="uGE5JYUx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728769AbgAMMkw (ORCPT ); Mon, 13 Jan 2020 07:40:52 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37622 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728734AbgAMMkp (ORCPT ); Mon, 13 Jan 2020 07:40:45 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id B7B8B60808; Mon, 13 Jan 2020 12:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919244; bh=UDDWDfHq6vQ4mafDgi/0WqfOho8EmhNcpUk8RRIhlEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=uGE5JYUx19Xt9YSDm0kc13WeujRsOsHeYgs0vS++uSYm3AJ+aayYztKp8FQrRptGJ 7CTLY84VXY77KWEA8BMzqVNn7EZ8DK9ps6j4q5neo+TnPKhUoV090SWagp/OzY+S+k 90TV6WrUXE0EiZTpwRoNcBYZ6bhXPpTgMBRFHffb/V/mM1PnSQT3N6G1s5iIfol62q kS+RAlZV+ehwS4snhCHZusOfrtegTdikKeBfsSZPGniKD29Fc1Z97nflhvRelW73Zz qe107yDL7yHujp13GeFa5xDYnJE+Jd7gNLomVVr8e0K1W2PxYgzUUbL2KDKK+VG9bV hnWkHMu9BXkRhXz5M+TnJM3vxxn+UddJPoF7cylNAQhcx/U08gvdMDQEEb/7AUihrl Im2squFdB1uEfajcbZ4k5A0yxWSyHE/2tSYutEg9YHb6Qn8i0cfvI0g7fYImKWShj3 FeDI7bF/ef31h6HZHAeEfB/kTIyZZF7/hNfrwtdAqwZy/vb6Sp3 From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 23/24] t6006: make hash size independent Date: Mon, 13 Jan 2020 12:38:56 +0000 Message-Id: <20200113123857.3684632-24-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Instead of hard-coding the length of an object ID when creating a tree, compute it for the hash in use using the translation tables. Signed-off-by: brian m. carlson --- t/t6006-rev-list-format.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index ebdc49c496..7e82e43a63 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -32,6 +32,7 @@ changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding) truncate_count=20 test_expect_success 'setup' ' + test_oid_init && : >foo && git add foo && git config i18n.commitEncoding $test_encoding && @@ -463,9 +464,10 @@ test_expect_success '--abbrev' ' ' test_expect_success '%H is not affected by --abbrev-commit' ' + expected=$(($(test_oid hexsz) + 1)) && git log -1 --format=%H --abbrev-commit --abbrev=20 HEAD >actual && len=$(wc -c X-Patchwork-Id: 11330039 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99C5692A for ; Mon, 13 Jan 2020 12:40:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 761BC2073D for ; Mon, 13 Jan 2020 12:40:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="ZLj5FCQG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728766AbgAMMku (ORCPT ); Mon, 13 Jan 2020 07:40:50 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37698 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728741AbgAMMkq (ORCPT ); Mon, 13 Jan 2020 07:40:46 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 3F08E60809; Mon, 13 Jan 2020 12:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919244; bh=3jHcppxLGE4Za6iMdX4YGpER+IYmmrm5+fCZnYM9gqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=ZLj5FCQGP9dhI9cUdH8N1dF1epZvYnzscUqQ98rPyIMTEnFjguxYO97uzG09iWbQs VrK55Nkb8SO3jvhSDRVFzUQXylMj5l0IpH9J8erEi17xwtA/OcDE/59DQPR08EeWYR zZUB2zf0BvFPq8twzy2IQ7pqcl8Q7fJYWDPY2t7SW+QI49D6yPPB1CD3phCSzfVq9v ofVAgm5dW/Ixm/v4eiT00AcUqBWQKGFICt5CFbkUU83GnaZnBcw+BFfMZxQQ2o9qO8 fJpKUW2DTrb74+RjLH7ICi05pWlCiOw3taoe5ptAKCg4XW9REh+JTi7Lvc7AYoqAm7 SiribPBvY93peCekY+gPY4LVUn1Bv990zuNdVksUkyuCARQvUlszbaEUwaJ2UP+kzJ ur7oetbJCw2QR/P3ZwDE7I7SDrh5nzu1LBarki8Dj8u+7Y7QcU9m3tG2VChFR1ZhfN uUgLg+/VfFMXOy+ZKIPhMaxGhQt+QfJajNL2bpQm9hyWBHN8QSG From: "brian m. carlson" To: Cc: Jonathan Tan , Johannes Schindelin Subject: [PATCH 24/24] t6024: update for SHA-256 Date: Mon, 13 Jan 2020 12:38:57 +0000 Message-Id: <20200113123857.3684632-25-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113123857.3684632-1-sandals@crustytoothpaste.net> References: <20200113123857.3684632-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org To make this test work with SHA-256, compute two of the items in the conflicted index entry. The other entry is a conflict within a conflict and computing it is difficult, so use test_oid_cache to specify the proper values for both hash algorithms. Signed-off-by: brian m. carlson --- t/t6024-recursive-merge.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/t/t6024-recursive-merge.sh b/t/t6024-recursive-merge.sh index 0c9e3c20e8..332cfc53fd 100755 --- a/t/t6024-recursive-merge.sh +++ b/t/t6024-recursive-merge.sh @@ -57,7 +57,12 @@ test_expect_success 'setup tests' ' git rev-parse C >.git/MERGE_HEAD && echo F >a1 && git update-index a1 && - GIT_AUTHOR_DATE="2006-12-12 23:00:08" git commit -m F + GIT_AUTHOR_DATE="2006-12-12 23:00:08" git commit -m F && + + test_oid_cache <<-EOF + idxstage1 sha1:ec3fe2a791706733f2d8fa7ad45d9a9672031f5e + idxstage1 sha256:b3c8488929903aaebdeb22270cb6d36e5b8724b01ae0d4da24632f158c99676f + EOF ' test_expect_success 'combined merge conflicts' ' @@ -79,10 +84,10 @@ test_expect_success 'result contains a conflict' ' test_expect_success 'virtual trees were processed' ' git ls-files --stage >out && - cat >expect <<-\EOF && - 100644 ec3fe2a791706733f2d8fa7ad45d9a9672031f5e 1 a1 - 100644 cf84443e49e1b366fac938711ddf4be2d4d1d9e9 2 a1 - 100644 fd7923529855d0b274795ae3349c5e0438333979 3 a1 + cat >expect <<-EOF && + 100644 $(test_oid idxstage1) 1 a1 + 100644 $(git rev-parse F:a1) 2 a1 + 100644 $(git rev-parse G:a1) 3 a1 EOF test_cmp expect out