From patchwork Sun Aug 18 19:16:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099867 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D337713A0 for ; Sun, 18 Aug 2019 19:20:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C547D1FE8D for ; Sun, 18 Aug 2019 19:20:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8F95228C8; Sun, 18 Aug 2019 19:20:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FF0A1FE8D for ; Sun, 18 Aug 2019 19:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbfHRTUr (ORCPT ); Sun, 18 Aug 2019 15:20:47 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57748 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfHRTUr (ORCPT ); Sun, 18 Aug 2019 15:20:47 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 2CDDC60736; Sun, 18 Aug 2019 19:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156044; bh=P8yCDhvUZ0BVNjy3lVDLrSRJYFvrMTlDtO5h5NmPOdI=; 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=c9crZbbDpc9046kJSehu5qHMQ+g2ekvoZOiM+0ebLYKqxJg76CPVzCbEC/oPw1BxB kKwjDusTv1xqMY6Cp0fMClpGaV2lwjapXMmLZ6wUgsq8LhmE41u7rhkb5N8XHeTqig xHqauCuhqkRy0qghUH4VBqZzNNdjTE+dbvPNS3VvfL9FfEk8FwE8pi8FeIEnhEXwK+ xYX5hjKMmylxW4wn1fvctISOOksrV1xXHTtX48B7TnVvY1p2y95CwVdPt/iGSB7hup /GR192pEM3UwvauxJzUeBqtiKLk7zTanTarYqGg4Ikv+XpKyKPN+Vy/KRGQeL3A1Em gdjh0THwD0QTTDZxTK4Y+G+PCHV04Ft4mP4J3kg3LfN+keWtJYO1NaO9R6U2eoh0dv yUuJnFMANKl+Js0q2zkr6rkMabrtJtgN6btn2NofUjgrBHND11UknS9IOQbPCtdrkH JA3ddQQqjTl9YcjDmVWPef0KL7kk3izH03hL0B9zUOwhyIfxLLq From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 01/14] t3201: abstract away SHA-1-specific constants Date: Sun, 18 Aug 2019 19:16:33 +0000 Message-Id: <20190818191646.868106-2-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t3201-branch-contains.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh index 0ea4fc4694..40251c9f8f 100755 --- a/t/t3201-branch-contains.sh +++ b/t/t3201-branch-contains.sh @@ -192,10 +192,10 @@ test_expect_success 'branch --merged with --verbose' ' EOF test_cmp expect actual && git branch --verbose --merged topic >actual && - cat >expect <<-\EOF && - master c77a0a9 second on master - * topic 2c939f4 [ahead 1] foo - zzz c77a0a9 second on master + cat >expect <<-EOF && + master $(git rev-parse --short master) second on master + * topic $(git rev-parse --short topic ) [ahead 1] foo + zzz $(git rev-parse --short zzz ) second on master EOF test_i18ncmp expect actual ' From patchwork Sun Aug 18 19:16:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F7BE1399 for ; Sun, 18 Aug 2019 19:20:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3AF31FE8D for ; Sun, 18 Aug 2019 19:20:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E834C22A65; Sun, 18 Aug 2019 19:20:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 127651FE8D for ; Sun, 18 Aug 2019 19:20:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726976AbfHRTUv (ORCPT ); Sun, 18 Aug 2019 15:20:51 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57760 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfHRTUu (ORCPT ); Sun, 18 Aug 2019 15:20:50 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 5971B60737; Sun, 18 Aug 2019 19:20:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156046; bh=t0czfkGDAFXzYqPCbU7uRCHt31/A/mAgC50mztHv+zI=; 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=zujH3fG/CbTs3ktYU0YjfJEVUzKgpLgjPppcZThM5MqX89ewx9BDt9zt2YeN/9RN/ M+mtZz/98R/+TmmTpar90KVv0MljNMC3EWbek9F23fm6m2JZQmycp/x0wT/Gp7CRut vu0ZnSPT3KQ7FTdYoQlxTVy0JyQsdV+HHv7mbwZED/guxeYfgrL63p3YkEvCujUart r+NEggphxLMQvgOK/TaOzhqB180qsbcYr1YgHcS+thM1zR/Z8vBnX4ezShjeduvirF Islcn9V6NgqthI/HWztBZh4TnIKG7hKk0MwCGJYi87rJlZekpBmLgQ2fKD9qzHMpCQ 6utUZkUu24m/QT49Idwa4SH8jDrMTGVI10XL0EnItjj2ypzRrzifnOd/RPbKNfxVl6 YRSSRjgnpcUAlsx532kKikCTi7pxbS2vHgWP3g7y88GiAu2APeICclJQyZG8+3ptGQ SUljl3V1EcmFSbwOcGQ8xScjBpfAZsD2sh64jBE5OSewiAkI+v3 From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 02/14] t3206: abstract away hash size constants Date: Sun, 18 Aug 2019 19:16:34 +0000 Message-Id: <20190818191646.868106-3-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP The various short object IDs in the range-diff output differ between hash algorithms. Use test_oid_cache to look up values for both SHA-1 and SHA-256. Signed-off-by: brian m. carlson --- t/t3206-range-diff.sh | 227 +++++++++++++++++++++++++++++++----------- 1 file changed, 167 insertions(+), 60 deletions(-) diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh index ec548654ce..0120f769f1 100755 --- a/t/t3206-range-diff.sh +++ b/t/t3206-range-diff.sh @@ -8,17 +8,124 @@ test_description='range-diff tests' # harm than good. We need some real history. test_expect_success 'setup' ' - git fast-import < "$TEST_DIRECTORY"/t3206/history.export + git fast-import < "$TEST_DIRECTORY"/t3206/history.export && + test_oid_cache <<-EOF + # topic + t1 sha1:4de457d + t2 sha1:fccce22 + t3 sha1:147e64e + t4 sha1:a63e992 + t1 sha256:b89f8b9 + t2 sha256:5f12aad + t3 sha256:ea8b273 + t4 sha256:14b7336 + + # unmodified + u1 sha1:35b9b25 + u2 sha1:de345ab + u3 sha1:9af6654 + u4 sha1:2901f77 + u1 sha256:e3731be + u2 sha256:14fadf8 + u3 sha256:736c4bc + u4 sha256:673e77d + + # reordered + r1 sha1:aca177a + r2 sha1:14ad629 + r3 sha1:ee58208 + r4 sha1:307b27a + r1 sha256:f59d3aa + r2 sha256:fb261a8 + r3 sha256:cb2649b + r4 sha256:958577e + + # removed (deleted) + d1 sha1:7657159 + d2 sha1:43d84d3 + d3 sha1:a740396 + d1 sha256:e312513 + d2 sha256:eb19258 + d3 sha256:1ccb3c1 + + # added + a1 sha1:2716022 + a2 sha1:b62accd + a3 sha1:df46cfa + a4 sha1:3e64548 + a5 sha1:12b4063 + a1 sha256:d724f4d + a2 sha256:1de7762 + a3 sha256:e159431 + a4 sha256:b3e483c + a5 sha256:90866a7 + + # rebased + b1 sha1:cc9c443 + b2 sha1:c5d9641 + b3 sha1:28cc2b6 + b4 sha1:5628ab7 + b5 sha1:a31b12e + b1 sha256:a1a8717 + b2 sha256:20a5862 + b3 sha256:587172a + b4 sha256:2721c5d + b5 sha256:7b57864 + + # changed + c1 sha1:a4b3333 + c2 sha1:f51d370 + c3 sha1:0559556 + c4 sha1:d966c5c + c1 sha256:f8c2b9d + c2 sha256:3fb6318 + c3 sha256:168ab68 + c4 sha256:3526539 + + # changed-message + m1 sha1:f686024 + m2 sha1:4ab067d + m3 sha1:b9cb956 + m4 sha1:8add5f1 + m1 sha256:31e6281 + m2 sha256:a06bf1b + m3 sha256:82dc654 + m4 sha256:48470c5 + + # renamed + n1 sha1:f258d75 + n2 sha1:017b62d + n3 sha1:3ce7af6 + n4 sha1:1e6226b + n1 sha256:ad52114 + n2 sha256:3b54c8f + n3 sha256:3b0a644 + n4 sha256:e461653 + + # added and removed + s1 sha1:096b1ba + s2 sha1:d92e698 + s3 sha1:9a1db4d + s4 sha1:fea3b5c + s1 sha256:a7f9134 + s2 sha256:b4c2580 + s3 sha256:1d62aa2 + s4 sha256:48160e8 + + # Empty delimiter (included so lines match neatly) + __ sha1:------- + __ sha256:------- + EOF ' test_expect_success 'simple A..B A..C (unmodified)' ' git range-diff --no-color master..topic master..unmodified \ >actual && cat >expected <<-EOF && - 1: 4de457d = 1: 35b9b25 s/5/A/ - 2: fccce22 = 2: de345ab s/4/A/ - 3: 147e64e = 3: 9af6654 s/11/B/ - 4: a63e992 = 4: 2901f77 s/12/B/ + 1: $(test_oid t1) = 1: $(test_oid u1) s/5/A/ + 2: $(test_oid t2) = 2: $(test_oid u2) s/4/A/ + 3: $(test_oid t3) = 3: $(test_oid u3) s/11/B/ + 4: $(test_oid t4) = 4: $(test_oid u4) s/12/B/ EOF test_cmp expected actual ' @@ -38,10 +145,10 @@ test_expect_success 'simple A B C (unmodified)' ' test_expect_success 'trivial reordering' ' git range-diff --no-color master topic reordered >actual && cat >expected <<-EOF && - 1: 4de457d = 1: aca177a s/5/A/ - 3: 147e64e = 2: 14ad629 s/11/B/ - 4: a63e992 = 3: ee58208 s/12/B/ - 2: fccce22 = 4: 307b27a s/4/A/ + 1: $(test_oid t1) = 1: $(test_oid r1) s/5/A/ + 3: $(test_oid t3) = 2: $(test_oid r2) s/11/B/ + 4: $(test_oid t4) = 3: $(test_oid r3) s/12/B/ + 2: $(test_oid t2) = 4: $(test_oid r4) s/4/A/ EOF test_cmp expected actual ' @@ -49,10 +156,10 @@ test_expect_success 'trivial reordering' ' test_expect_success 'removed a commit' ' git range-diff --no-color master topic removed >actual && cat >expected <<-EOF && - 1: 4de457d = 1: 7657159 s/5/A/ - 2: fccce22 < -: ------- s/4/A/ - 3: 147e64e = 2: 43d84d3 s/11/B/ - 4: a63e992 = 3: a740396 s/12/B/ + 1: $(test_oid t1) = 1: $(test_oid d1) s/5/A/ + 2: $(test_oid t2) < -: $(test_oid __) s/4/A/ + 3: $(test_oid t3) = 2: $(test_oid d2) s/11/B/ + 4: $(test_oid t4) = 3: $(test_oid d3) s/12/B/ EOF test_cmp expected actual ' @@ -60,11 +167,11 @@ test_expect_success 'removed a commit' ' test_expect_success 'added a commit' ' git range-diff --no-color master topic added >actual && cat >expected <<-EOF && - 1: 4de457d = 1: 2716022 s/5/A/ - 2: fccce22 = 2: b62accd s/4/A/ - -: ------- > 3: df46cfa s/6/A/ - 3: 147e64e = 4: 3e64548 s/11/B/ - 4: a63e992 = 5: 12b4063 s/12/B/ + 1: $(test_oid t1) = 1: $(test_oid a1) s/5/A/ + 2: $(test_oid t2) = 2: $(test_oid a2) s/4/A/ + -: $(test_oid __) > 3: $(test_oid a3) s/6/A/ + 3: $(test_oid t3) = 4: $(test_oid a4) s/11/B/ + 4: $(test_oid t4) = 5: $(test_oid a5) s/12/B/ EOF test_cmp expected actual ' @@ -72,10 +179,10 @@ test_expect_success 'added a commit' ' test_expect_success 'new base, A B C' ' git range-diff --no-color master topic rebased >actual && cat >expected <<-EOF && - 1: 4de457d = 1: cc9c443 s/5/A/ - 2: fccce22 = 2: c5d9641 s/4/A/ - 3: 147e64e = 3: 28cc2b6 s/11/B/ - 4: a63e992 = 4: 5628ab7 s/12/B/ + 1: $(test_oid t1) = 1: $(test_oid b1) s/5/A/ + 2: $(test_oid t2) = 2: $(test_oid b2) s/4/A/ + 3: $(test_oid t3) = 3: $(test_oid b3) s/11/B/ + 4: $(test_oid t4) = 4: $(test_oid b4) s/12/B/ EOF test_cmp expected actual ' @@ -84,11 +191,11 @@ test_expect_success 'new base, B...C' ' # this syntax includes the commits from master! git range-diff --no-color topic...rebased >actual && cat >expected <<-EOF && - -: ------- > 1: a31b12e unrelated - 1: 4de457d = 2: cc9c443 s/5/A/ - 2: fccce22 = 3: c5d9641 s/4/A/ - 3: 147e64e = 4: 28cc2b6 s/11/B/ - 4: a63e992 = 5: 5628ab7 s/12/B/ + -: $(test_oid __) > 1: $(test_oid b5) unrelated + 1: $(test_oid t1) = 2: $(test_oid b1) s/5/A/ + 2: $(test_oid t2) = 3: $(test_oid b2) s/4/A/ + 3: $(test_oid t3) = 4: $(test_oid b3) s/11/B/ + 4: $(test_oid t4) = 5: $(test_oid b4) s/12/B/ EOF test_cmp expected actual ' @@ -96,9 +203,9 @@ test_expect_success 'new base, B...C' ' test_expect_success 'changed commit' ' git range-diff --no-color topic...changed >actual && cat >expected <<-EOF && - 1: 4de457d = 1: a4b3333 s/5/A/ - 2: fccce22 = 2: f51d370 s/4/A/ - 3: 147e64e ! 3: 0559556 s/11/B/ + 1: $(test_oid t1) = 1: $(test_oid c1) s/5/A/ + 2: $(test_oid t2) = 2: $(test_oid c2) s/4/A/ + 3: $(test_oid t3) ! 3: $(test_oid c3) s/11/B/ @@ file: A 9 10 @@ -108,7 +215,7 @@ test_expect_success 'changed commit' ' 12 13 14 - 4: a63e992 ! 4: d966c5c s/12/B/ + 4: $(test_oid t4) ! 4: $(test_oid c4) s/12/B/ @@ file @@ file: A 9 @@ -125,10 +232,10 @@ test_expect_success 'changed commit' ' test_expect_success 'changed commit with --no-patch diff option' ' git range-diff --no-color --no-patch topic...changed >actual && cat >expected <<-EOF && - 1: 4de457d = 1: a4b3333 s/5/A/ - 2: fccce22 = 2: f51d370 s/4/A/ - 3: 147e64e ! 3: 0559556 s/11/B/ - 4: a63e992 ! 4: d966c5c s/12/B/ + 1: $(test_oid t1) = 1: $(test_oid c1) s/5/A/ + 2: $(test_oid t2) = 2: $(test_oid c2) s/4/A/ + 3: $(test_oid t3) ! 3: $(test_oid c3) s/11/B/ + 4: $(test_oid t4) ! 4: $(test_oid c4) s/12/B/ EOF test_cmp expected actual ' @@ -136,16 +243,16 @@ test_expect_success 'changed commit with --no-patch diff option' ' test_expect_success 'changed commit with --stat diff option' ' git range-diff --no-color --stat topic...changed >actual && cat >expected <<-EOF && - 1: 4de457d = 1: a4b3333 s/5/A/ + 1: $(test_oid t1) = 1: $(test_oid c1) s/5/A/ a => b | 0 1 file changed, 0 insertions(+), 0 deletions(-) - 2: fccce22 = 2: f51d370 s/4/A/ + 2: $(test_oid t2) = 2: $(test_oid c2) s/4/A/ a => b | 0 1 file changed, 0 insertions(+), 0 deletions(-) - 3: 147e64e ! 3: 0559556 s/11/B/ + 3: $(test_oid t3) ! 3: $(test_oid c3) s/11/B/ a => b | 0 1 file changed, 0 insertions(+), 0 deletions(-) - 4: a63e992 ! 4: d966c5c s/12/B/ + 4: $(test_oid t4) ! 4: $(test_oid c4) s/12/B/ a => b | 0 1 file changed, 0 insertions(+), 0 deletions(-) EOF @@ -155,9 +262,9 @@ test_expect_success 'changed commit with --stat diff option' ' test_expect_success 'changed commit with sm config' ' git range-diff --no-color --submodule=log topic...changed >actual && cat >expected <<-EOF && - 1: 4de457d = 1: a4b3333 s/5/A/ - 2: fccce22 = 2: f51d370 s/4/A/ - 3: 147e64e ! 3: 0559556 s/11/B/ + 1: $(test_oid t1) = 1: $(test_oid c1) s/5/A/ + 2: $(test_oid t2) = 2: $(test_oid c2) s/4/A/ + 3: $(test_oid t3) ! 3: $(test_oid c3) s/11/B/ @@ file: A 9 10 @@ -167,7 +274,7 @@ test_expect_success 'changed commit with sm config' ' 12 13 14 - 4: a63e992 ! 4: d966c5c s/12/B/ + 4: $(test_oid t4) ! 4: $(test_oid c4) s/12/B/ @@ file @@ file: A 9 @@ -184,8 +291,8 @@ test_expect_success 'changed commit with sm config' ' test_expect_success 'renamed file' ' git range-diff --no-color --submodule=log topic...renamed-file >actual && sed s/Z/\ /g >expected <<-EOF && - 1: 4de457d = 1: f258d75 s/5/A/ - 2: fccce22 ! 2: 017b62d s/4/A/ + 1: $(test_oid t1) = 1: $(test_oid n1) s/5/A/ + 2: $(test_oid t2) ! 2: $(test_oid n2) s/4/A/ @@ Metadata ZAuthor: Thomas Rast Z @@ -198,7 +305,7 @@ test_expect_success 'renamed file' ' Z@@ Z 1 Z 2 - 3: 147e64e ! 3: 3ce7af6 s/11/B/ + 3: $(test_oid t3) ! 3: $(test_oid n3) s/11/B/ @@ Metadata Z ## Commit message ## Z s/11/B/ @@ -210,7 +317,7 @@ test_expect_success 'renamed file' ' Z 8 Z 9 Z 10 - 4: a63e992 ! 4: 1e6226b s/12/B/ + 4: $(test_oid t4) ! 4: $(test_oid n4) s/12/B/ @@ Metadata Z ## Commit message ## Z s/12/B/ @@ -229,8 +336,8 @@ test_expect_success 'renamed file' ' test_expect_success 'file added and later removed' ' git range-diff --no-color --submodule=log topic...added-removed >actual && sed s/Z/\ /g >expected <<-EOF && - 1: 4de457d = 1: 096b1ba s/5/A/ - 2: fccce22 ! 2: d92e698 s/4/A/ + 1: $(test_oid t1) = 1: $(test_oid s1) s/5/A/ + 2: $(test_oid t2) ! 2: $(test_oid s2) s/4/A/ @@ Metadata ZAuthor: Thomas Rast Z @@ -246,7 +353,7 @@ test_expect_success 'file added and later removed' ' Z 7 + + ## new-file (new) ## - 3: 147e64e ! 3: 9a1db4d s/11/B/ + 3: $(test_oid t3) ! 3: $(test_oid s3) s/11/B/ @@ Metadata ZAuthor: Thomas Rast Z @@ -262,7 +369,7 @@ test_expect_success 'file added and later removed' ' Z 14 + + ## new-file (deleted) ## - 4: a63e992 = 4: fea3b5c s/12/B/ + 4: $(test_oid t4) = 4: $(test_oid s4) s/12/B/ EOF test_cmp expected actual ' @@ -275,8 +382,8 @@ test_expect_success 'no commits on one side' ' test_expect_success 'changed message' ' git range-diff --no-color topic...changed-message >actual && sed s/Z/\ /g >expected <<-EOF && - 1: 4de457d = 1: f686024 s/5/A/ - 2: fccce22 ! 2: 4ab067d s/4/A/ + 1: $(test_oid t1) = 1: $(test_oid m1) s/5/A/ + 2: $(test_oid t2) ! 2: $(test_oid m2) s/4/A/ @@ Metadata Z ## Commit message ## Z s/4/A/ @@ -286,16 +393,16 @@ test_expect_success 'changed message' ' Z ## file ## Z@@ Z 1 - 3: 147e64e = 3: b9cb956 s/11/B/ - 4: a63e992 = 4: 8add5f1 s/12/B/ + 3: $(test_oid t3) = 3: $(test_oid m3) s/11/B/ + 4: $(test_oid t4) = 4: $(test_oid m4) s/12/B/ EOF test_cmp expected actual ' test_expect_success 'dual-coloring' ' - sed -e "s|^:||" >expect <<-\EOF && - :1: a4b3333 = 1: f686024 s/5/A/ - :2: f51d370 ! 2: 4ab067d s/4/A/ + sed -e "s|^:||" >expect <<-EOF && + :1: $(test_oid c1) = 1: $(test_oid m1) s/5/A/ + :2: $(test_oid c2) ! 2: $(test_oid m2) s/4/A/ : @@ Metadata : ## Commit message ## : s/4/A/ @@ -305,7 +412,7 @@ test_expect_success 'dual-coloring' ' : ## file ## : @@ : 1 - :3: 0559556 ! 3: b9cb956 s/11/B/ + :3: $(test_oid c3) ! 3: $(test_oid m3) s/11/B/ : @@ file: A : 9 : 10 @@ -315,7 +422,7 @@ test_expect_success 'dual-coloring' ' : 12 : 13 : 14 - :4: d966c5c ! 4: 8add5f1 s/12/B/ + :4: $(test_oid c4) ! 4: $(test_oid m4) s/12/B/ : @@ file : @@ file: A : 9 From patchwork Sun Aug 18 19:16:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ADFE318A6 for ; Sun, 18 Aug 2019 19:20:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D41D1FE8D for ; Sun, 18 Aug 2019 19:20:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 919FA228C8; Sun, 18 Aug 2019 19:20:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7431F212D9 for ; Sun, 18 Aug 2019 19:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727090AbfHRTUx (ORCPT ); Sun, 18 Aug 2019 15:20:53 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57770 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726950AbfHRTUx (ORCPT ); Sun, 18 Aug 2019 15:20:53 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id A7E076073E; Sun, 18 Aug 2019 19:20:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156049; bh=0aUrkkGgDyIzNnei0WzMtIoehV5rHqX1zjnet1bL7Rg=; 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=AixUVoUHRreyVpg3JPbRAC6TbYxKUIDGisDuRwrDfL0AgC6cdRUx2b4ni6W8kMfx4 x7/rIZpgL2+LmUsG2yzUOjOvkdZboDUGi56QqdKx+3FvaiBvtEkwVn2Ms073E371lX hlxLRyrCPuX6LQcxe4bLgZzItq+VW07xzq85Od1EeADSx03bBeHaTWHYRW5e/t9Gnp UCd8W+IzO1cLEaX1OCjjxRhD74ye7PF7MfqefgDozuH+zljHcqYTm/dqGH74YXTTd+ 3ZuO4F4Oi7d413Srrtje/muAwz/U87FdTjVohSOfThVEUcLaKmBrVCSc1xZQsAoAfF 9Jkgm8OvWOeuprN58AHF9MKpmxtTT9UktC0bPqeCD70c1PEHITRzKQtY79AOcRk7lA eq2WxJsw8v3jwrd3Id/pIuTFYPpRhdA0tO1Y/AruIST+W78V+vSQ4fxcTyjrIMguQC OwvIm4n78xqC5Mb1drjBsBbCIH2Wemc/lBTPCi/2iEK4Exc1BV6 From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 03/14] t3301: abstract away SHA-1-specific constants Date: Sun, 18 Aug 2019 19:16:35 +0000 Message-Id: <20190818191646.868106-4-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Move some invocations of test_commit around so that we can compute the object IDs for these commits. Compute several object IDs in the tests instead of using hard-coded values so that the test works with any hash algorithm. Since the actual values are sorted by the object ID of the object being annotated, sort the expected values accordingly as well. Signed-off-by: brian m. carlson --- t/t3301-notes.sh | 140 ++++++++++++++++++++++++++++++----------------- 1 file changed, 90 insertions(+), 50 deletions(-) diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh index 704bbc6541..d3fa298c6a 100755 --- a/t/t3301-notes.sh +++ b/t/t3301-notes.sh @@ -66,8 +66,9 @@ test_expect_success 'show notes entry with %N' ' ' test_expect_success 'create reflog entry' ' + ref=$(git rev-parse --short refs/notes/commits) && cat <<-EOF >expect && - a1d8fa6 refs/notes/commits@{0}: notes: Notes added by '\''git notes add'\'' + $ref refs/notes/commits@{0}: notes: Notes added by '\''git notes add'\'' EOF git reflog show refs/notes/commits >actual && test_cmp expect actual @@ -134,8 +135,9 @@ test_expect_success 'can overwrite existing note with "git notes add -f"' ' ' test_expect_success 'show notes' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 7a4ca6ee52a974a66cbaa78e33214535dff1d691 + commit $commit Author: A U Thor Date: Thu Apr 7 15:14:13 2005 -0700 @@ -152,8 +154,9 @@ test_expect_success 'show notes' ' test_expect_success 'show multi-line notes' ' test_commit 3rd && MSG="b3${LF}c3c3c3c3${LF}d3d3d3" git notes add && + commit=$(git rev-parse HEAD) && cat >expect-multiline <<-EOF && - commit d07d62e5208f22eb5695e7eb47667dc8b9860290 + commit $commit Author: A U Thor Date: Thu Apr 7 15:15:13 2005 -0700 @@ -174,8 +177,9 @@ test_expect_success 'show -F notes' ' test_commit 4th && echo "xyzzy" >note5 && git notes add -F note5 && + commit=$(git rev-parse HEAD) && cat >expect-F <<-EOF && - commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 + commit $commit Author: A U Thor Date: Thu Apr 7 15:16:13 2005 -0700 @@ -198,10 +202,13 @@ test_expect_success 'Re-adding -F notes without -f fails' ' ' test_expect_success 'git log --pretty=raw does not show notes' ' + commit=$(git rev-parse HEAD) && + tree=$(git rev-parse HEAD^{tree}) && + parent=$(git rev-parse HEAD^) && cat >expect <<-EOF && - commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 - tree 05ac65288c4c4b3b709a020ae94b2ece2f2201ae - parent d07d62e5208f22eb5695e7eb47667dc8b9860290 + commit $commit + tree $tree + parent $parent author A U Thor 1112912173 -0700 committer C O Mitter 1112912173 -0700 @@ -291,8 +298,9 @@ test_expect_success 'git log --no-notes resets ref list' ' test_expect_success 'show -m notes' ' test_commit 5th && git notes add -m spam -m "foo${LF}bar${LF}baz" && + commit=$(git rev-parse HEAD) && cat >expect-m <<-EOF && - commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361 + commit $commit Author: A U Thor Date: Thu Apr 7 15:17:13 2005 -0700 @@ -313,8 +321,9 @@ test_expect_success 'show -m notes' ' test_expect_success 'remove note with add -f -F /dev/null' ' git notes add -f -F /dev/null && + commit=$(git rev-parse HEAD) && cat >expect-rm-F <<-EOF && - commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361 + commit $commit Author: A U Thor Date: Thu Apr 7 15:17:13 2005 -0700 @@ -356,14 +365,16 @@ test_expect_success 'create note with combination of -m and -F' ' test_expect_success 'remove note with "git notes remove"' ' git notes remove HEAD^ && git notes remove && + commit=$(git rev-parse HEAD) && + parent=$(git rev-parse HEAD^) && cat >expect-rm-remove <<-EOF && - commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361 + commit $commit Author: A U Thor Date: Thu Apr 7 15:17:13 2005 -0700 ${indent}5th - commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 + commit $parent Author: A U Thor Date: Thu Apr 7 15:16:13 2005 -0700 @@ -459,9 +470,11 @@ test_expect_success 'removing with --stdin --ignore-missing' ' ' test_expect_success 'list notes with "git notes list"' ' - cat >expect <<-EOF && - c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061 7a4ca6ee52a974a66cbaa78e33214535dff1d691 - c18dc024e14f08d18d14eea0d747ff692d66d6a3 d07d62e5208f22eb5695e7eb47667dc8b9860290 + commit_2=$(git rev-parse 2nd) && + commit_3=$(git rev-parse 3rd) && + sort -t" " -k2 >expect <<-EOF && + $(git rev-parse refs/notes/commits:$commit_2) $commit_2 + $(git rev-parse refs/notes/commits:$commit_3) $commit_3 EOF git notes list >actual && test_cmp expect actual @@ -474,7 +487,7 @@ test_expect_success 'list notes with "git notes"' ' test_expect_success 'list specific note with "git notes list "' ' cat >expect <<-EOF && - c18dc024e14f08d18d14eea0d747ff692d66d6a3 + $(git rev-parse refs/notes/commits:$commit_3) EOF git notes list HEAD^^ >actual && test_cmp expect actual @@ -498,10 +511,11 @@ test_expect_success 'append to existing note with "git notes append"' ' ' test_expect_success '"git notes list" does not expand to "git notes list HEAD"' ' - cat >expect_list <<-EOF && - c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061 7a4ca6ee52a974a66cbaa78e33214535dff1d691 - 4b6ad22357cc8a1296720574b8d2fbc22fab0671 7f9ad8836c775acb134c0a055fc55fb4cd1ba361 - c18dc024e14f08d18d14eea0d747ff692d66d6a3 d07d62e5208f22eb5695e7eb47667dc8b9860290 + commit_5=$(git rev-parse 5th) && + sort -t" " -k2 >expect_list <<-EOF && + $(git rev-parse refs/notes/commits:$commit_2) $commit_2 + $(git rev-parse refs/notes/commits:$commit_3) $commit_3 + $(git rev-parse refs/notes/commits:$commit_5) $commit_5 EOF git notes list >actual && test_cmp expect_list actual @@ -531,8 +545,9 @@ test_expect_success 'appending empty string to non-existing note does not create test_expect_success 'create other note on a different notes ref (setup)' ' test_commit 6th && GIT_NOTES_REF="refs/notes/other" git notes add -m "other note" && + commit=$(git rev-parse HEAD) && cat >expect-not-other <<-EOF && - commit 2c125331118caba0ff8238b7f4958ac6e93fe39c + commit $commit Author: A U Thor Date: Thu Apr 7 15:18:13 2005 -0700 @@ -569,8 +584,10 @@ test_expect_success 'Do not show note when core.notesRef is overridden' ' ' test_expect_success 'Show all notes when notes.displayRef=refs/notes/*' ' + commit=$(git rev-parse HEAD) && + parent=$(git rev-parse HEAD^) && cat >expect-both <<-EOF && - commit 2c125331118caba0ff8238b7f4958ac6e93fe39c + commit $commit Author: A U Thor Date: Thu Apr 7 15:18:13 2005 -0700 @@ -582,7 +599,7 @@ test_expect_success 'Show all notes when notes.displayRef=refs/notes/*' ' Notes (other): ${indent}other note - commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361 + commit $parent Author: A U Thor Date: Thu Apr 7 15:17:13 2005 -0700 @@ -616,8 +633,9 @@ test_expect_success 'notes.displayRef can be given more than once' ' ' test_expect_success 'notes.displayRef respects order' ' + commit=$(git rev-parse HEAD) && cat >expect-both-reversed <<-EOF && - commit 2c125331118caba0ff8238b7f4958ac6e93fe39c + commit $commit Author: A U Thor Date: Thu Apr 7 15:18:13 2005 -0700 @@ -642,14 +660,16 @@ test_expect_success 'GIT_NOTES_DISPLAY_REF works' ' ' test_expect_success 'GIT_NOTES_DISPLAY_REF overrides config' ' + commit=$(git rev-parse HEAD) && + parent=$(git rev-parse HEAD^) && cat >expect-none <<-EOF && - commit 2c125331118caba0ff8238b7f4958ac6e93fe39c + commit $commit Author: A U Thor Date: Thu Apr 7 15:18:13 2005 -0700 ${indent}6th - commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361 + commit $parent Author: A U Thor Date: Thu Apr 7 15:17:13 2005 -0700 @@ -666,8 +686,9 @@ test_expect_success '--show-notes=* adds to GIT_NOTES_DISPLAY_REF' ' ' test_expect_success '--no-standard-notes' ' + commit=$(git rev-parse HEAD) && cat >expect-commits <<-EOF && - commit 2c125331118caba0ff8238b7f4958ac6e93fe39c + commit $commit Author: A U Thor Date: Thu Apr 7 15:18:13 2005 -0700 @@ -712,8 +733,10 @@ test_expect_success 'Allow notes on non-commits (trees, blobs, tags)' ' ' test_expect_success 'create note from other note with "git notes add -C"' ' + test_commit 7th && + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit fb01e0ca8c33b6cc0c6451dde747f97df567cb5c + commit $commit Author: A U Thor Date: Thu Apr 7 15:19:13 2005 -0700 @@ -722,7 +745,6 @@ test_expect_success 'create note from other note with "git notes add -C"' ' Notes: ${indent}order test EOF - test_commit 7th && git notes add -C $(git notes list HEAD^) && git log -1 >actual && test_cmp expect actual && @@ -744,8 +766,9 @@ test_expect_success 'create note from non-blob with "git notes add -C" fails' ' ' test_expect_success 'create note from blob with "git notes add -C" reuses blob id' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 9a4c31c7f722b5d517e92c64e932dd751e1413bf + commit $commit Author: A U Thor Date: Thu Apr 7 15:20:13 2005 -0700 @@ -762,8 +785,10 @@ test_expect_success 'create note from blob with "git notes add -C" reuses blob i ' test_expect_success 'create note from other note with "git notes add -c"' ' + test_commit 9th && + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 2e0db4bc649e174d667a1cde19e725cf897a5bd2 + commit $commit Author: A U Thor Date: Thu Apr 7 15:21:13 2005 -0700 @@ -772,7 +797,6 @@ test_expect_success 'create note from other note with "git notes add -c"' ' Notes: ${indent}yet another note EOF - test_commit 9th && MSG="yet another note" git notes add -c $(git notes list HEAD^^) && git log -1 >actual && test_cmp expect actual @@ -785,8 +809,9 @@ test_expect_success 'create note from non-existing note with "git notes add -c" ' test_expect_success 'append to note from other note with "git notes append -C"' ' + commit=$(git rev-parse HEAD^) && cat >expect <<-EOF && - commit 2e0db4bc649e174d667a1cde19e725cf897a5bd2 + commit $commit Author: A U Thor Date: Thu Apr 7 15:21:13 2005 -0700 @@ -803,8 +828,9 @@ test_expect_success 'append to note from other note with "git notes append -C"' ' test_expect_success 'create note from other note with "git notes append -c"' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406 + commit $commit Author: A U Thor Date: Thu Apr 7 15:22:13 2005 -0700 @@ -819,8 +845,9 @@ test_expect_success 'create note from other note with "git notes append -c"' ' ' test_expect_success 'append to note from other note with "git notes append -c"' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406 + commit $commit Author: A U Thor Date: Thu Apr 7 15:22:13 2005 -0700 @@ -837,8 +864,10 @@ test_expect_success 'append to note from other note with "git notes append -c"' ' test_expect_success 'copy note with "git notes copy"' ' + test_commit 11th && + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5 + commit $commit Author: A U Thor Date: Thu Apr 7 15:23:13 2005 -0700 @@ -849,7 +878,6 @@ test_expect_success 'copy note with "git notes copy"' ' ${indent} ${indent}yet another note EOF - test_commit 11th && git notes copy HEAD^ HEAD && git log -1 >actual && test_cmp expect actual && @@ -864,8 +892,9 @@ test_expect_success 'prevent overwrite with "git notes copy"' ' ' test_expect_success 'allow overwrite with "git notes copy -f"' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5 + commit $commit Author: A U Thor Date: Thu Apr 7 15:23:13 2005 -0700 @@ -889,8 +918,10 @@ test_expect_success 'cannot copy note from object without notes' ' ' test_expect_success 'git notes copy --stdin' ' + commit=$(git rev-parse HEAD) && + parent=$(git rev-parse HEAD^) && cat >expect <<-EOF && - commit e871aa61182b1d95d0a6fb75445d891722863b6b + commit $commit Author: A U Thor Date: Thu Apr 7 15:25:13 2005 -0700 @@ -901,7 +932,7 @@ test_expect_success 'git notes copy --stdin' ' ${indent} ${indent}yet another note - commit 65e263ded02ae4e8839bc151095113737579dc12 + commit $parent Author: A U Thor Date: Thu Apr 7 15:24:13 2005 -0700 @@ -922,21 +953,23 @@ test_expect_success 'git notes copy --stdin' ' ' test_expect_success 'git notes copy --for-rewrite (unconfigured)' ' + test_commit 14th && + test_commit 15th && + commit=$(git rev-parse HEAD) && + parent=$(git rev-parse HEAD^) && cat >expect <<-EOF && - commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89 + commit $commit Author: A U Thor Date: Thu Apr 7 15:27:13 2005 -0700 ${indent}15th - commit 07c85d77059393ed0154b8c96906547a59dfcddd + commit $parent Author: A U Thor Date: Thu Apr 7 15:26:13 2005 -0700 ${indent}14th EOF - test_commit 14th && - test_commit 15th && (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^) && echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) | git notes copy --for-rewrite=foo && @@ -945,8 +978,10 @@ test_expect_success 'git notes copy --for-rewrite (unconfigured)' ' ' test_expect_success 'git notes copy --for-rewrite (enabled)' ' + commit=$(git rev-parse HEAD) && + parent=$(git rev-parse HEAD^) && cat >expect <<-EOF && - commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89 + commit $commit Author: A U Thor Date: Thu Apr 7 15:27:13 2005 -0700 @@ -957,7 +992,7 @@ test_expect_success 'git notes copy --for-rewrite (enabled)' ' ${indent} ${indent}yet another note - commit 07c85d77059393ed0154b8c96906547a59dfcddd + commit $parent Author: A U Thor Date: Thu Apr 7 15:26:13 2005 -0700 @@ -986,8 +1021,9 @@ test_expect_success 'git notes copy --for-rewrite (disabled)' ' ' test_expect_success 'git notes copy --for-rewrite (overwrite)' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89 + commit $commit Author: A U Thor Date: Thu Apr 7 15:27:13 2005 -0700 @@ -1015,8 +1051,9 @@ test_expect_success 'git notes copy --for-rewrite (ignore)' ' ' test_expect_success 'git notes copy --for-rewrite (append)' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89 + commit $commit Author: A U Thor Date: Thu Apr 7 15:27:13 2005 -0700 @@ -1037,8 +1074,9 @@ test_expect_success 'git notes copy --for-rewrite (append)' ' ' test_expect_success 'git notes copy --for-rewrite (append two to one)' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89 + commit $commit Author: A U Thor Date: Thu Apr 7 15:27:13 2005 -0700 @@ -1075,8 +1113,9 @@ test_expect_success 'git notes copy --for-rewrite (append empty)' ' ' test_expect_success 'GIT_NOTES_REWRITE_MODE works' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89 + commit $commit Author: A U Thor Date: Thu Apr 7 15:27:13 2005 -0700 @@ -1095,8 +1134,9 @@ test_expect_success 'GIT_NOTES_REWRITE_MODE works' ' ' test_expect_success 'GIT_NOTES_REWRITE_REF works' ' + commit=$(git rev-parse HEAD) && cat >expect <<-EOF && - commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89 + commit $commit Author: A U Thor Date: Thu Apr 7 15:27:13 2005 -0700 From patchwork Sun Aug 18 19:16:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099869 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6480413A0 for ; Sun, 18 Aug 2019 19:20:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54C03212D9 for ; Sun, 18 Aug 2019 19:20:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46D6C22A65; Sun, 18 Aug 2019 19:20:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3E8B212D9 for ; Sun, 18 Aug 2019 19:20:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbfHRTUw (ORCPT ); Sun, 18 Aug 2019 15:20:52 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57782 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfHRTUw (ORCPT ); Sun, 18 Aug 2019 15:20:52 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 1C39060748; Sun, 18 Aug 2019 19:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156050; bh=sqDqmzcAnVDIFDb/zQUwfajaGniHUQyxH1FfBFGE/oE=; 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=d1YY6YkiJPB3gHha/fq+VmyE6f4lEc4GH0pCqzH9mZgln1xMuamwmBpe7upAcIE3T BHITq13P9A/kIIMVv+zn32kJn46Z3AHkfZgW5dysDaoehDXIGKbsdnlTAOqGM9v0jj 3YDTsDLdoo04uJwyawmkQPLpHmset40bxs+fpW7cDPBlitzyIKuE1QWSp7uqbXAioO GJl2O+wC9eIAbabyuu0D3ODnfZYoRJmUQeJFsJkFlNaxjjGClCYhbuvJ8X3swXRpIq 2zNcsKBUAv++BZ5z54X/3R6ZXPCmCBgXo9oNNFOSpa4kxxLWWurg8LbTsH8J5ScJNh G7cPIm+PmfS6NMtkoK8Ry/KymxqAJ7/2jIWiX/yq/yTahx6rp8f+3hHa76r96QoDVF 65h9W7nySfzQBUWhinMDpogIcSDdZLJFed6mNjBYfU9klHheaKCVWp5BNxEYHXX9cT E2tAnB7F8sVuekCYeArfa/7ZhsrRCo/l0P7M1VhSnMmH8QSbD+q From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 04/14] t3305: make hash size independent Date: Sun, 18 Aug 2019 19:16:36 +0000 Message-Id: <20190818191646.868106-5-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Instead of hard-coding 40-character shell patterns, use grep to determine if all of the paths have either zero or one levels of fanout, as appropriate. Note that the final test is implicitly dependent on the hash algorithm. Depending on the algorithm in use, the fanout may or may not completely compress. In its current state, this is not a problem, but it could be if the hash algorithm changes again. Signed-off-by: brian m. carlson --- t/t3305-notes-fanout.sh | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/t/t3305-notes-fanout.sh b/t/t3305-notes-fanout.sh index 54460beec4..831f83d211 100755 --- a/t/t3305-notes-fanout.sh +++ b/t/t3305-notes-fanout.sh @@ -35,15 +35,10 @@ test_expect_success 'many notes created with git-notes triggers fanout' ' git ls-tree -r --name-only refs/notes/commits | while read path do - case "$path" in - ??/??????????????????????????????????????) - : true - ;; - *) + echo $path | grep "^../[0-9a-f]*$" || { echo "Invalid path \"$path\"" && - return 1 - ;; - esac + return 1; + } done ' @@ -77,15 +72,10 @@ test_expect_success 'deleting most notes triggers fanout consolidation' ' git ls-tree -r --name-only refs/notes/commits | while read path do - case "$path" in - ????????????????????????????????????????) - : true - ;; - *) + echo $path | grep -v "^../.*" || { echo "Invalid path \"$path\"" && - return 1 - ;; - esac + return 1; + } done ' From patchwork Sun Aug 18 19:16:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A8511399 for ; Sun, 18 Aug 2019 19:20:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17B7B212D9 for ; Sun, 18 Aug 2019 19:20:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A0611FE8D; Sun, 18 Aug 2019 19:20:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FBCC1FE8D for ; Sun, 18 Aug 2019 19:20:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727100AbfHRTUz (ORCPT ); Sun, 18 Aug 2019 15:20:55 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57788 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbfHRTUy (ORCPT ); Sun, 18 Aug 2019 15:20:54 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 6754D6074A; Sun, 18 Aug 2019 19:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156051; bh=p17VuaSheP1+ohXjcp12g/UGe7MYk2eIBZfRmD4076o=; 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=S8eaBzbqUt3zLSnVm0Szyj6XyldnxsAEb/KxuOCYgW1zB9qSejI6lbMLwzlBL7RnE veXNFkuUOJSh4A9/CSNXqR0KjqaYGmzvw4vF4G0An3qOnbtMhhTlAxK0ZB5e9odnfu 0rJYJMT3Ybc9HEhTmR2NH7yQCRec/Z+628uwltRsrBb6/LrjqszJcL9kPUcCMQYyDf PZHf0Wbciz1RyNUjGobtaqexg7dGDTIX/eciEvA14G8sO0kkpCV8NkLJz2LJ+mzH1q MwXQAIW0vY5614J8/33tk/Du1YGWGFVqfmTatFKMONFDXW/F5x1c/5YvC5W1X8CIta MRhMB1vnSF0Fjdb2EETO4t2z4KLFY+5iTltnl43zauLA3zIf4dbZevGRdklJdZkEoO SrYBnB0bE1I03HcqZjae7+3jygYI0Lvu8r5mS/TWdcj/6294ow91tnVR/CuLIq1TxJ ILKsqRJOZR9RlmwQ67anhG5wasGzHCIQCR5wYu2YBLWgh2kkKbv From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 05/14] t3306: abstract away SHA-1-specific constants Date: Sun, 18 Aug 2019 19:16:37 +0000 Message-Id: <20190818191646.868106-6-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Convert some single-line heredocs into inline uses of echo now that they can be expressed succinctly. Signed-off-by: brian m. carlson --- t/t3306-notes-prune.sh | 45 ++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/t/t3306-notes-prune.sh b/t/t3306-notes-prune.sh index 61748088eb..8f4102ff9e 100755 --- a/t/t3306-notes-prune.sh +++ b/t/t3306-notes-prune.sh @@ -11,23 +11,26 @@ test_expect_success 'setup: create a few commits with notes' ' test_tick && git commit -m 1st && git notes add -m "Note #1" && + first=$(git rev-parse HEAD) && : > file2 && git add file2 && test_tick && git commit -m 2nd && git notes add -m "Note #2" && + second=$(git rev-parse HEAD) && : > file3 && git add file3 && test_tick && git commit -m 3rd && - COMMIT_FILE=.git/objects/5e/e1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && + third=$(git rev-parse HEAD) && + COMMIT_FILE=$(echo $third | sed "s!^..!.git/objects/&/!") && test -f $COMMIT_FILE && test-tool chmtime =+0 $COMMIT_FILE && git notes add -m "Note #3" ' cat > expect < Date: Thu Apr 7 15:15:13 2005 -0700 @@ -36,7 +39,7 @@ Date: Thu Apr 7 15:15:13 2005 -0700 Notes: Note #3 -commit 08341ad9e94faa089d60fd3f523affb25c6da189 +commit $second Author: A U Thor Date: Thu Apr 7 15:14:13 2005 -0700 @@ -45,7 +48,7 @@ Date: Thu Apr 7 15:14:13 2005 -0700 Notes: Note #2 -commit ab5f302035f2e7aaf04265f08b42034c23256e1f +commit $first Author: A U Thor Date: Thu Apr 7 15:13:13 2005 -0700 @@ -70,16 +73,16 @@ test_expect_success 'remove some commits' ' test_expect_success 'verify that commits are gone' ' - test_must_fail git cat-file -p 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && - git cat-file -p 08341ad9e94faa089d60fd3f523affb25c6da189 && - git cat-file -p ab5f302035f2e7aaf04265f08b42034c23256e1f + test_must_fail git cat-file -p $third && + git cat-file -p $second && + git cat-file -p $first ' test_expect_success 'verify that notes are still present' ' - git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && - git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 && - git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f + git notes show $third && + git notes show $second && + git notes show $first ' test_expect_success 'prune -n does not remove notes' ' @@ -90,13 +93,10 @@ test_expect_success 'prune -n does not remove notes' ' test_cmp expect actual ' -cat > expect <expect && git notes prune -n > actual && test_cmp expect actual ' @@ -109,9 +109,9 @@ test_expect_success 'prune notes' ' test_expect_success 'verify that notes are gone' ' - test_must_fail git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && - git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 && - git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f + test_must_fail git notes show $third && + git notes show $second && + git notes show $first ' test_expect_success 'remove some commits' ' @@ -121,21 +121,18 @@ test_expect_success 'remove some commits' ' git gc --prune=now ' -cat > expect <expect && git notes prune -v > actual && test_cmp expect actual ' test_expect_success 'verify that notes are gone' ' - test_must_fail git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && - test_must_fail git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 && - git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f + test_must_fail git notes show $third && + test_must_fail git notes show $second && + git notes show $first ' test_done From patchwork Sun Aug 18 19:16:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C7FB1399 for ; Sun, 18 Aug 2019 19:20:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F04C1FE8D for ; Sun, 18 Aug 2019 19:20:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52C82228C8; Sun, 18 Aug 2019 19:20:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB6881FE8D for ; Sun, 18 Aug 2019 19:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727119AbfHRTU4 (ORCPT ); Sun, 18 Aug 2019 15:20:56 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57800 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726950AbfHRTUz (ORCPT ); Sun, 18 Aug 2019 15:20:55 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id AAB906073E; Sun, 18 Aug 2019 19:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156054; bh=NfGVmjmYZCcknXWiSqjUlgvMi2dLT412qPnU3gYEWcA=; 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=cMni/1Z+sLsIJS8vvYI0pQXPFmnY32FEv/0QPH3VEOrgLR5OuPggESTh6VLVvxI0h 0d/pIYB1CJYXnbVS43qw0ovybAQ8lE1vhDpiqGZ0PwmcX36fvtfmKHC4qhCMbN5eEK ys4L7aZRJROXllX3q8DNW2zxUL0k8LnREiJilFsOvGsOZLKdM5qiIGwwv1K432/m1g XUIgGi5YCheiG4PmHy2Rnvv5wjxK4uCmyyspjjh79c3De1/X0pu/UiuH8aHUcoemqS XHyReDTdLb4ylnyysYy6dOS4sfTlj3F6aAXa7O4HN1xe6U+tHdMuufY+fkPo2R2HZz uBR4vTSZrbVi47BeaHOSkEliAffj4NaPyytAMUm/XeGsN2XL11EKDBcvsuqx3X9yng IwK42E3hMV7mZy8Sasumti0ecCYHNRZl2x7wm8qAhl1pDEwjf6ZyYQRPD9dSLbBRhe xCh2L9gfvn2TaAjWqOn3y0CyfmIfpQCN+Q8bYSzpuumlHnXGBBM From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 06/14] t3404: abstract away SHA-1-specific constants Date: Sun, 18 Aug 2019 19:16:38 +0000 Message-Id: <20190818191646.868106-7-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Add a use of $EMPTY_TREE instead of a hard-coded value. Remove a comment about hard-coded hashes which is no longer applicable. Signed-off-by: brian m. carlson --- t/t3404-rebase-interactive.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 461dd539ff..87ee69f78e 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -29,9 +29,6 @@ Initial setup: . "$TEST_DIRECTORY"/lib-rebase.sh -# WARNING: Modifications to the initial repository can change the SHA ID used -# in the expect2 file for the 'stop on conflicting pick' test. - test_expect_success 'setup' ' test_commit A file1 && test_commit B file1 && @@ -233,25 +230,28 @@ test_expect_success 'exchange two commits' ' set_fake_editor && FAKE_LINES="2 1" git rebase -i HEAD~2 && test H = $(git cat-file commit HEAD^ | sed -ne \$p) && - test G = $(git cat-file commit HEAD | sed -ne \$p) + test G = $(git cat-file commit HEAD | sed -ne \$p) && + blob1=$(git rev-parse --short HEAD^:file1) && + blob2=$(git rev-parse --short HEAD:file1) && + commit=$(git rev-parse --short HEAD) ' test_expect_success 'stop on conflicting pick' ' - cat >expect <<-\EOF && + cat >expect <<-EOF && diff --git a/file1 b/file1 - index f70f10e..fd79235 100644 + index $blob1..$blob2 100644 --- a/file1 +++ b/file1 @@ -1 +1 @@ -A +G EOF - cat >expect2 <<-\EOF && + cat >expect2 <<-EOF && <<<<<<< HEAD D ======= G - >>>>>>> 5d18e54... G + >>>>>>> $commit... G EOF git tag new-branch1 && set_fake_editor && @@ -1003,7 +1003,7 @@ test_expect_success 'rebase -i --root temporary sentinel commit' ' git checkout B && set_fake_editor && test_must_fail env FAKE_LINES="2" git rebase -i --root && - git cat-file commit HEAD | grep "^tree 4b825dc642cb" && + git cat-file commit HEAD | grep "^tree $EMPTY_TREE" && git rebase --abort ' @@ -1161,7 +1161,7 @@ test_expect_success 'rebase -i error on commits with \ in message' ' test_expect_code 1 grep " emp" error ' -test_expect_success 'short SHA-1 setup' ' +test_expect_success SHA1 'short SHA-1 setup' ' test_when_finished "git checkout master" && git checkout --orphan collide && git rm -rf . && @@ -1173,7 +1173,7 @@ test_expect_success 'short SHA-1 setup' ' ) ' -test_expect_success 'short SHA-1 collide' ' +test_expect_success SHA1 'short SHA-1 collide' ' test_when_finished "reset_rebase && git checkout master" && git checkout collide && ( From patchwork Sun Aug 18 19:16:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B2371399 for ; Sun, 18 Aug 2019 19:20:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B3CA1FE8D for ; Sun, 18 Aug 2019 19:20:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F3E8228C8; Sun, 18 Aug 2019 19:20:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0E0D1FE8D for ; Sun, 18 Aug 2019 19:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727124AbfHRTU5 (ORCPT ); Sun, 18 Aug 2019 15:20:57 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57808 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbfHRTU4 (ORCPT ); Sun, 18 Aug 2019 15:20:56 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 985A26075D; Sun, 18 Aug 2019 19:20:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156055; bh=OnewIo6qRCkCQKRbTcNKQUB3wtB2MIjxzXh1u+soRZ0=; 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=irL22/Rgi1ej0PE4P/eCE6IUoeb/etKvp9RxcH41CxDLokCO1Vq84Rm5fGqlKqFOd AcmDBnm0iFKqb9RDtQusmCJAvbZA7WrVdf+Qhe+zsq9kqKFopyNN5jz42UX713ROEh Y0dnWQ9o2IkanH/YorQuGbkLhFUQ+E03PGcL7unJ0D1T5Xfet6dxtmzg5GrveE01H5 2INxc0RGxLdu2EqeHxXUn/osskbHgpPeestTGr24b2q3o54DOE18mCG7z7jHekIO8j gF5iob1SouuiLhBQyybrRKcJTVeFcqHuRtOl0U/SbG6ynYBr4LOmX9l1CwpmZYe2/z Jk7lgp/8/p6tsqeSO8Og4JziV+hQEabyZjY9hMaLXNXEOiFIa3mxHCZrg3IaYxkfVt Sb5BnnIOQSj4Eb8nqbRuY+kr44445qWPwCWvV1vva6aZ67cAF293OO032L3trJLXXs TMiBsTX5zLBXXiLBvTi1DP8HviwRWpP5t1UVXmXI6QZtxyZy+WQ From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 07/14] t3430: avoid hard-coded object IDs Date: Sun, 18 Aug 2019 19:16:39 +0000 Message-Id: <20190818191646.868106-8-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Compute the object IDs used in the todo list instead of hard-coding them. Signed-off-by: brian m. carlson --- t/t3430-rebase-merges.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh index 7b6c4847ad..c1ea2ee297 100755 --- a/t/t3430-rebase-merges.sh +++ b/t/t3430-rebase-merges.sh @@ -37,20 +37,27 @@ test_expect_success 'setup' ' test_commit A && git checkout -b first && test_commit B && + b=$(git rev-parse --short HEAD) && git checkout master && test_commit C && + c=$(git rev-parse --short HEAD) && test_commit D && + d=$(git rev-parse --short HEAD) && git merge --no-commit B && test_tick && git commit -m E && git tag -m E E && + e=$(git rev-parse --short HEAD) && git checkout -b second C && test_commit F && + f=$(git rev-parse --short HEAD) && test_commit G && + g=$(git rev-parse --short HEAD) && git checkout master && git merge --no-commit G && test_tick && git commit -m H && + h=$(git rev-parse --short HEAD) && git tag -m H H && git checkout A && test_commit conflicting-G G.t @@ -93,24 +100,24 @@ test_expect_success 'create completely different structure' ' ' test_expect_success 'generate correct todo list' ' - cat >expect <<-\EOF && + cat >expect <<-EOF && label onto reset onto - pick d9df450 B + pick $b B label E reset onto - pick 5dee784 C + pick $c C label branch-point - pick ca2c861 F - pick 088b00a G + pick $f F + pick $g G label H reset branch-point # C - pick 12bd07b D - merge -C 2051b56 E # E - merge -C 233d48a H # H + pick $d D + merge -C $e E # E + merge -C $h H # H EOF From patchwork Sun Aug 18 19:16:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3475D13A0 for ; Sun, 18 Aug 2019 19:21:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26D8E1FE8D for ; Sun, 18 Aug 2019 19:21:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B66622A65; Sun, 18 Aug 2019 19:21:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF3961FE8D for ; Sun, 18 Aug 2019 19:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbfHRTVA (ORCPT ); Sun, 18 Aug 2019 15:21:00 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57816 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727122AbfHRTVA (ORCPT ); Sun, 18 Aug 2019 15:21:00 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id E94AA6073E; Sun, 18 Aug 2019 19:20:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156056; bh=99RdzmeZuXBMWE7I62G1cTehTZHTAN8mv28au5hvcEk=; 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=OR7hZCi8aWAcUMK8MEfziQfZ6Ub1n/NIZ2Te94Hp1C3IqWBZxA6g8CX5IzV6y2hbQ HObpgGJltnT5MdQqKrrdBh6dBLDWvV9sVXy9k2a+QGZjuBtroqVcGE4qGXVlTi4cJ4 yet8tLC+NHshJaInIsLC9RRFT7Uc58JUizgSfBqQqTDB9CVLcoNgQGqb6+/qUJaFdP qVcNai8LWra637JTAWI19q1smDYzvJ9RDAZdDhWL/JNn/FWtyEpw1QXjkL67/W8gFX D+qOsu/niEQTL+lWwEU9lpoea//A391qMJsNtNB2DgCa6U4dJqD6Y+mUnNIvf7aUoT 11sRWIQW2oCWq+MM1IHR5ufZdoFaeC+xeD3BX0rNL3HxMg4bG67pF3n8cwbYfRhOBe dWNmUcyuiBhSt6JA649TNw8hcF8jjAtfwIBFjkdIWCd+VW4qThxYer93TDhn7o4lrd Yp/Cm62+m3W/SKOiqyvxlu7k4ubWQVZEozhDU16oDiZsdyp1+eC From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 08/14] t3506: make hash independent Date: Sun, 18 Aug 2019 19:16:40 +0000 Message-Id: <20190818191646.868106-9-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP This test uses a hard-coded object ID to ensure that the result of cherry-pick --ff is correct. Use test_oid to make this work for both SHA-1 and SHA-256. Signed-off-by: brian m. carlson --- t/t3506-cherry-pick-ff.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/t3506-cherry-pick-ff.sh b/t/t3506-cherry-pick-ff.sh index 127dd0082f..9d5adbc130 100755 --- a/t/t3506-cherry-pick-ff.sh +++ b/t/t3506-cherry-pick-ff.sh @@ -16,7 +16,11 @@ test_expect_success setup ' git add file1 && test_tick && git commit -m "second" && - git tag second + git tag second && + test_oid_cache <<-EOF + cp_ff sha1:1df192cd8bc58a2b275d842cede4d221ad9000d1 + cp_ff sha256:e70d6b7fc064bddb516b8d512c9057094b96ce6ff08e12080acc4fe7f1d60a1d + EOF ' test_expect_success 'cherry-pick using --ff fast forwards' ' @@ -102,7 +106,7 @@ test_expect_success 'cherry pick a root commit with --ff' ' git add file2 && git commit --amend -m "file2" && git cherry-pick --ff first && - test "$(git rev-parse --verify HEAD)" = "1df192cd8bc58a2b275d842cede4d221ad9000d1" + test "$(git rev-parse --verify HEAD)" = "$(test_oid cp_ff)" ' test_expect_success 'cherry-pick --ff on unborn branch' ' From patchwork Sun Aug 18 19:16:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099893 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38ADA13A0 for ; Sun, 18 Aug 2019 19:21:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A74828555 for ; Sun, 18 Aug 2019 19:21:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15D4F28563; Sun, 18 Aug 2019 19:21:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3B7C28555 for ; Sun, 18 Aug 2019 19:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727143AbfHRTVD (ORCPT ); Sun, 18 Aug 2019 15:21:03 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57828 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727122AbfHRTVB (ORCPT ); Sun, 18 Aug 2019 15:21:01 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id BC07860745; Sun, 18 Aug 2019 19:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156060; bh=FfLfvtTNME7iELnEARnT73jkhI72fgAEvL/e/thv4GQ=; 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=iHQ60cIeK53JwFB/04zY7CKYFMHTdFoBJovJaRmpjgjwRC7U0BXPxkSCcy0LCjfG8 BAw0PKPcToQftcMHeNNOUmmDYTwS3vFqvRMz+6960g5WHISxjtdI/f81wyDJrMTcX+ Nc/+5k/JlIAr1Tw7hP1wdQLpLL35pr4Oty6cdv2x8wE6gQokXM0LyQL68gUdbe4eiC S5CvEi+SaDA0LIgJnOAMkISR3ML9UcX5undMzeZDOTdp8YUuYeiFWhUmvVDw+5WRel T5yMJTPmwk/fEPJs2cFFREaZj5xP2xKPcdhGAPeu35eJRHGSK9qKFsLJpzCcdl7gca zcs5q4ad1KQDZAgeltG/dwOU1nTDDrpW55rPcQaWwM43/kuh0kgoxbDcs3k/14sCS4 Squm7EUaB5J/134exQRwHqt1ErqjafFyjAOFB2kdstorTj9soNGPhDwzSC/pSzjsma ssA/VcR+serAwwlLoAgQRVQSCjfc83A/M5OJq2bB1CNuJ9/Uogk From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 09/14] t3600: make hash size independent Date: Sun, 18 Aug 2019 19:16:41 +0000 Message-Id: <20190818191646.868106-10-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Instead of hard-coding a fixed length invalid object ID in the test, compute one using the lookup tables. Signed-off-by: brian m. carlson --- t/t3600-rm.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index 66282a720e..8c8cca5bfb 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -240,12 +240,14 @@ test_expect_success 'refresh index before checking if it is up-to-date' ' ' test_expect_success 'choking "git rm" should not let it die with cruft' ' + test_oid_init && git reset -q --hard && test_when_finished "rm -f .git/index.lock && git reset -q --hard" && i=0 && + hash=$(test_oid deadbeef) && while test $i -lt 12000 do - echo "100644 1234567890123456789012345678901234567890 0 some-file-$i" + echo "100644 $hash 0 some-file-$i" i=$(( $i + 1 )) done | git update-index --index-info && git rm -n "some-file-*" | : && From patchwork Sun Aug 18 19:16:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099883 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 397C313A0 for ; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28C0F1FE8D for ; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D55926E78; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AE741FE8D for ; Sun, 18 Aug 2019 19:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727164AbfHRTVF (ORCPT ); Sun, 18 Aug 2019 15:21:05 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57836 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727128AbfHRTVE (ORCPT ); Sun, 18 Aug 2019 15:21:04 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 863756075B; Sun, 18 Aug 2019 19:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156061; bh=Z96NRj1jnqLTFdTVW5eJzqCq7iz3sJC1LVPXkDr4V1c=; 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=GC3053VejdVRfDqWSrJPvGqMzzsS68eK4FgM9UzUCtv0aGOHEVUPbA23vYEWAVV24 D7uxjfCG5794H0WKpaLzboqBg1LV9M2v6yiWaaIMv6TKQZLj7o3kgvpJKZauQA6Pds Sr/L/LlnXDZMDeD7+hIm+5DRQZ+25E/dKVy3/exBSUZly4ochZBI05v77g2vBEjRMV vM11rKZ+yIY/MGDhPBmSgdU+23KCWgAhkKN6zcROyPHSlQdSu/neoElwePxFUI48WX je0YEiJZqPMkBlgB0w39QFMQcvtulRc8mAMvkNfAxnoTVpDTwefqDFzVmfTjRJ/NqM Q8kPF5EwUxUGEDtgKKzAJ0+67GYgJUQh0ehhnxSFxQskSLo1+nCmb+ZOodFA0jHz+a XnjZuen+ECfJ1QA6dBF/r6QpyzhfEK5dKnb4qmfu5XfiI17VJJ4+IAZEEuVxAqtVwM DFztf1QSbcCX7ACJwLfnAupdqGJXsKgq9unz/HgSt02LAhGanCR From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 10/14] t3800: make hash-size independent Date: Sun, 18 Aug 2019 19:16:42 +0000 Message-Id: <20190818191646.868106-11-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Replace references to several hard-coded object IDs with a variable referring to the generated commit. Avoid matching on exact character positions, which will be different depending on the hash in use. In the test for a valid object ID, use an obviously invalid one from the lookup table. Signed-off-by: brian m. carlson --- t/t3800-mktag.sh | 49 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index 8eb47942e2..64dcc5ec28 100755 --- a/t/t3800-mktag.sh +++ b/t/t3800-mktag.sh @@ -23,6 +23,7 @@ check_verify_failure () { # first create a commit, so we have a valid object/type # for the tag. test_expect_success 'setup' ' + test_oid_init && echo Hello >A && git update-index --add A && git commit -m "Initial commit" && @@ -69,28 +70,28 @@ check_verify_failure '"object" line SHA1 check' '^error: char7: .*SHA1 hash$' # 4. type line label check cat >tag.sig < 0 +0000 EOF -check_verify_failure '"type" line label check' '^error: char47: .*"\\ntype "$' +check_verify_failure '"type" line label check' '^error: char.*: .*"\\ntype "$' ############################################################ # 5. type line eol check -echo "object 779e9b33986b1c2670fff52c5067603117b3e895" >tag.sig +echo "object $head" >tag.sig printf "type tagsssssssssssssssssssssssssssssss" >>tag.sig -check_verify_failure '"type" line eol check' '^error: char48: .*"\\n"$' +check_verify_failure '"type" line eol check' '^error: char.*: .*"\\n"$' ############################################################ # 6. tag line label check #1 cat >tag.sig < 0 +0000 @@ -98,37 +99,37 @@ tagger . <> 0 +0000 EOF check_verify_failure '"tag" line label check #1' \ - '^error: char57: no "tag " found$' + '^error: char.*: no "tag " found$' ############################################################ # 7. tag line label check #2 cat >tag.sig <tag.sig <tag.sig < 0 +0000 @@ -150,7 +151,7 @@ tagger . <> 0 +0000 EOF check_verify_failure 'verify tag-name check' \ - '^error: char67: could not verify tag name$' + '^error: char.*: could not verify tag name$' ############################################################ # 11. tagger line label check #1 @@ -164,7 +165,7 @@ This is filler EOF check_verify_failure '"tagger" line label check #1' \ - '^error: char70: could not find "tagger "$' + '^error: char.*: could not find "tagger "$' ############################################################ # 12. tagger line label check #2 @@ -179,7 +180,7 @@ This is filler EOF check_verify_failure '"tagger" line label check #2' \ - '^error: char70: could not find "tagger "$' + '^error: char.*: could not find "tagger "$' ############################################################ # 13. disallow missing tag author name @@ -194,7 +195,7 @@ This is filler EOF check_verify_failure 'disallow missing tag author name' \ - '^error: char77: missing tagger name$' + '^error: char.*: missing tagger name$' ############################################################ # 14. disallow missing tag author name @@ -209,7 +210,7 @@ tagger T A Gger < EOF check_verify_failure 'disallow malformed tagger' \ - '^error: char77: malformed tagger field$' + '^error: char.*: malformed tagger field$' ############################################################ # 15. allow empty tag email @@ -238,7 +239,7 @@ tagger T A Gger 0 +0000 EOF check_verify_failure 'disallow spaces in tag email' \ - '^error: char77: malformed tagger field$' + '^error: char.*: malformed tagger field$' ############################################################ # 17. disallow missing tag timestamp @@ -252,7 +253,7 @@ tagger T A Gger __ EOF check_verify_failure 'disallow missing tag timestamp' \ - '^error: char107: missing tag timestamp$' + '^error: char.*: missing tag timestamp$' ############################################################ # 18. detect invalid tag timestamp1 @@ -266,7 +267,7 @@ tagger T A Gger Tue Mar 25 15:47:44 2008 EOF check_verify_failure 'detect invalid tag timestamp1' \ - '^error: char107: missing tag timestamp$' + '^error: char.*: missing tag timestamp$' ############################################################ # 19. detect invalid tag timestamp2 @@ -280,7 +281,7 @@ tagger T A Gger 2008-03-31T12:20:15-0500 EOF check_verify_failure 'detect invalid tag timestamp2' \ - '^error: char111: malformed tag timestamp$' + '^error: char.*: malformed tag timestamp$' ############################################################ # 20. detect invalid tag timezone1 @@ -294,7 +295,7 @@ tagger T A Gger 1206478233 GMT EOF check_verify_failure 'detect invalid tag timezone1' \ - '^error: char118: malformed tag timezone$' + '^error: char.*: malformed tag timezone$' ############################################################ # 21. detect invalid tag timezone2 @@ -308,7 +309,7 @@ tagger T A Gger 1206478233 + 30 EOF check_verify_failure 'detect invalid tag timezone2' \ - '^error: char118: malformed tag timezone$' + '^error: char.*: malformed tag timezone$' ############################################################ # 22. detect invalid tag timezone3 @@ -322,7 +323,7 @@ tagger T A Gger 1206478233 -1430 EOF check_verify_failure 'detect invalid tag timezone3' \ - '^error: char118: malformed tag timezone$' + '^error: char.*: malformed tag timezone$' ############################################################ # 23. detect invalid header entry @@ -337,7 +338,7 @@ this line should not be here EOF check_verify_failure 'detect invalid header entry' \ - '^error: char124: trailing garbage in tag header$' + '^error: char.*: trailing garbage in tag header$' ############################################################ # 24. create valid tag From patchwork Sun Aug 18 19:16:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A08451399 for ; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E5AC1FE8D for ; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80588212D9; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1896212D9 for ; Sun, 18 Aug 2019 19:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727168AbfHRTVG (ORCPT ); Sun, 18 Aug 2019 15:21:06 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57850 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727127AbfHRTVE (ORCPT ); Sun, 18 Aug 2019 15:21:04 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 3167C6075D; Sun, 18 Aug 2019 19:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156062; bh=IuPf9FWSu4jKHpIr6ccgKNVinQdoZ4tgt5YbhUe2Xz4=; 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=gDFie5i9IW0XWfzgZLP3MejImhIlv3KLaQIkzHOhD16l6n+mEp4CmJmu2apN12N8P Qfy4r2kAjHMwfm3t1ef9jj68SCgVHCzcyekoYmouhYlvph/EecG4up8UQXKOWofyvI v3JDB+q3QOGtr6yVWZMK/2OrTpkj5IEA2zisSyXgldHnRcaGBe5IOYCJHZOGmjXIpq 5aFhm3InGLiNkeAlHstxbtEkFMeIqJsq/1dlxSWAcguIkCvHMzgufYRB+sxyAEyuAE bN/ife32fZTlNttUaxcDXOu3kq1zCJhdQ02vKWBV4CFPbz+23ynM69iUTgweUHBeM4 jzyAs93r2qnHi/lVkY44d2m0rxP8ir7QA37vIp7kj49AqAIQB5aCHtE6alDoH3LtBf gRSmKw/3y8ey8nIrn+8QRtpHrLV4bwcMhG33IH8K2wZM3ouwP5Igsx+xUbzD1+LPKi d0S+dyi2TfpcVYDafSGJcvlugjcZMQQWbbcVv0q7vDjtSwiNyZa From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 11/14] t3903: abstract away SHA-1-specific constants Date: Sun, 18 Aug 2019 19:16:43 +0000 Message-Id: <20190818191646.868106-12-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Abstract away the SHA-1-specific constants by sanitizing diff output to remove the index lines, since it's clear from the assertions in question that we are not interested in the specific object IDs. Signed-off-by: brian m. carlson --- t/t3903-stash.sh | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index b8e337893f..8e3e0992df 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -7,6 +7,18 @@ test_description='Test git stash' . ./test-lib.sh +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/' \ + -e 's/^index [0-9a-f]*,[0-9a-f]*\.\.[0-9a-f]*/index 1234567,7654321..89abcde/' \ + "$i" > "$i.compare" + done && + test_cmp "$1.compare" "$2.compare" && + rm -f "$1.compare" "$2.compare" +} + test_expect_success 'stash some dirty working directory' ' echo 1 >file && git add file && @@ -36,7 +48,7 @@ EOF test_expect_success 'parents of stash' ' test $(git rev-parse stash^) = $(git rev-parse HEAD) && git diff stash^2..stash >output && - test_cmp expect output + diff_cmp expect output ' test_expect_success 'applying bogus stash does nothing' ' @@ -210,13 +222,13 @@ test_expect_success 'stash branch' ' test refs/heads/stashbranch = $(git symbolic-ref HEAD) && test $(git rev-parse HEAD) = $(git rev-parse master^) && git diff --cached >output && - test_cmp expect output && + diff_cmp expect output && git diff >output && - test_cmp expect1 output && + diff_cmp expect1 output && git add file && git commit -m alternate\ second && git diff master..stashbranch >output && - test_cmp output expect2 && + diff_cmp output expect2 && test 0 = $(git stash list | wc -l) ' @@ -577,7 +589,7 @@ test_expect_success 'stash show -p - stashes on stack, stash-like argument' ' +bar EOF git stash show -p ${STASH_ID} >actual && - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'stash show - no stashes on stack, stash-like argument' ' @@ -609,7 +621,7 @@ test_expect_success 'stash show -p - no stashes on stack, stash-like argument' ' +foo EOF git stash show -p ${STASH_ID} >actual && - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'stash show --patience shows diff' ' @@ -627,7 +639,7 @@ test_expect_success 'stash show --patience shows diff' ' +foo EOF git stash show --patience ${STASH_ID} >actual && - test_cmp expected actual + diff_cmp expected actual ' test_expect_success 'drop: fail early if specified stash is not a stash ref' ' @@ -791,7 +803,7 @@ test_expect_success 'stash where working directory contains "HEAD" file' ' git diff-index --cached --quiet HEAD && test "$(git rev-parse stash^)" = "$(git rev-parse HEAD)" && git diff stash^..stash >output && - test_cmp expect output + diff_cmp expect output ' test_expect_success 'store called with invalid commit' ' @@ -847,7 +859,7 @@ test_expect_success 'stash list implies --first-parent -m' ' +working EOF git stash list --format=%gd -p >actual && - test_cmp expect actual + diff_cmp expect actual ' test_expect_success 'stash list --cc shows combined diff' ' @@ -864,7 +876,7 @@ test_expect_success 'stash list --cc shows combined diff' ' ++working EOF git stash list --format=%gd -p --cc >actual && - test_cmp expect actual + diff_cmp expect actual ' test_expect_success 'stash is not confused by partial renames' ' From patchwork Sun Aug 18 19:16:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D868A18EC for ; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9AFB1FE8D for ; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE2CB212D9; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ED4C22A65 for ; Sun, 18 Aug 2019 19:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727175AbfHRTVG (ORCPT ); Sun, 18 Aug 2019 15:21:06 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57862 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbfHRTVF (ORCPT ); Sun, 18 Aug 2019 15:21:05 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 9BDC060779; Sun, 18 Aug 2019 19:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156064; bh=Zevcrff+5grEzVWpQvl/rVLpLocwjlh6iPcNEHurD8k=; 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=Wozu8qUMXo925Otn4eYE65jHG7qt+z6iFOOy8EAqu8b5J7xtmp4XunkWjX9FAZZxc nix/mKdAZLoOFmVEU9XEgyXoyIHBEerJe1Yww+mYZ+Bg1GU4HeBeSDwgrNPcCNrEEx 9bTewPGyOqzP7mnZqJ9IgMkW4ZlWHwAki+xotl+cRW63sj3M3LYlAZc5gEvRc0JdHd cjtOqFqAj3NX13T7tcHE5pmbqDdTYaakEDdCDzJ80p8nhqNh2mzgbCRHxTiZ6aSkx0 023hvKYevEWpWiAYr94VqqdFc4DArEfrVqzBzbUK29rKJw+di+gTZXEgw2XSiSKUOZ V9Xx1FGnbBTdA/z82mv/PilJq/PJudODVvw8dG2ZDO0TGb5Ga2QyMzaG8NMh2NyaBH 61VQqKUIc2ler3ogXvf06iGHUxY6vBY+ADYoZAhbFiSVFqxLJSwPNr6EFjB1YSeIry 1A2bN0mrycABz6XF6Uhg6KU41x95siALbOU8oqPX2RLULLSuGug From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 12/14] t4000: make hash size independent Date: Sun, 18 Aug 2019 19:16:44 +0000 Message-Id: <20190818191646.868106-13-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Use $ZERO_OID instead of hard-coding a fixed size all-zeros object ID. Signed-off-by: brian m. carlson --- t/t4000-diff-format.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh index 8de36b7d12..e5116a76a1 100755 --- a/t/t4000-diff-format.sh +++ b/t/t4000-diff-format.sh @@ -78,7 +78,7 @@ test_expect_success 'git diff-files --no-patch --patch shows the patch' ' test_expect_success 'git diff-files --no-patch --patch-with-raw shows the patch and raw data' ' git diff-files --no-patch --patch-with-raw >actual && - grep -q "^:100644 100755 .* 0000000000000000000000000000000000000000 M path0\$" actual && + grep -q "^:100644 100755 .* $ZERO_OID M path0\$" actual && tail -n +4 actual >actual-patch && compare_diff_patch expected actual-patch ' From patchwork Sun Aug 18 19:16:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11099891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A1C418A6 for ; Sun, 18 Aug 2019 19:21:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB60A28555 for ; Sun, 18 Aug 2019 19:21:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3E612856D; Sun, 18 Aug 2019 19:21:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 767B528555 for ; Sun, 18 Aug 2019 19:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727191AbfHRTVK (ORCPT ); Sun, 18 Aug 2019 15:21:10 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57866 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbfHRTVJ (ORCPT ); Sun, 18 Aug 2019 15:21:09 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 84B106077D; Sun, 18 Aug 2019 19:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156065; bh=8pNmps3Sxa0cYDiyLq9zuC1d/BLuXEfYd7KHwXvAWjc=; 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=y5NyNGxqhnZ7OfKpmKEZokk8UqNWGIN0gf+0oHX5Us9lmxSz3NSAOa/+ePUppY+8o xrK44+OPKBdbBspsVSsOBbx3EOC1DjS0udj5by7iRqmP7uGc9hTRj/+/CCWeCQ3LiO ItIfE5ZBzU922QZio1g4dhyYEltDisDMRQRYvAOhR5fcwaPYo5nepAnQ0eXWXUTbFD HMYZ2JNj+gIiuujPs6VmhYF/ICWYyoIMfKaed67aB+bfs0YirwpkJaQ10d4T01waeg Ml0rs2TPPAXPmwRnz7XtZKDR4+pV3rjrDiRKb8bSGn3Wc6Obz7ZtKQlD9iPC2lqcjs 5mQWHZA2I7Z8YAXCfglW9IktZNIiDaOraRbwZXBcjt48E5eIgSWnzwJq7Z6mo1EPq4 hZGUWJ8wmuq7U4i5H5xBlcV3w6TM7HrlqzZOQ+AXR2k+5vd3QUCapoB2gclbE7Zrnn WMU5RUjl1vAM3HQ6wCN5KivhwAyXYWQ/eQapupsXYUf6JsGXBYM From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 13/14] t4002: make hash independent Date: Sun, 18 Aug 2019 19:16:45 +0000 Message-Id: <20190818191646.868106-14-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Refactor out the hard-coded object IDs and use test_oid to provide values for both SHA-1 and SHA-256. Signed-off-by: brian m. carlson --- t/t4002-diff-basic.sh | 367 +++++++++++++++++++++++++++++------------- 1 file changed, 258 insertions(+), 109 deletions(-) diff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh index 3a6c21e825..cbcdd10464 100755 --- a/t/t4002-diff-basic.sh +++ b/t/t4002-diff-basic.sh @@ -7,123 +7,272 @@ test_description='Test diff raw-output. ' . ./test-lib.sh + . "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh -cat >.test-plain-OA <<\EOF -:000000 100644 0000000000000000000000000000000000000000 ccba72ad3888a3520b39efcf780b9ee64167535d A AA -:000000 100644 0000000000000000000000000000000000000000 7e426fb079479fd67f6d81f984e4ec649a44bc25 A AN -:100644 000000 bcc68ef997017466d5c9094bcf7692295f588c9a 0000000000000000000000000000000000000000 D DD -:000000 040000 0000000000000000000000000000000000000000 6d50f65d3bdab91c63444294d38f08aeff328e42 A DF -:100644 000000 141c1f1642328e4bc46a7d801a71da392e66791e 0000000000000000000000000000000000000000 D DM -:100644 000000 35abde1506ddf806572ff4d407bd06885d0f8ee9 0000000000000000000000000000000000000000 D DN -:000000 100644 0000000000000000000000000000000000000000 1d41122ebdd7a640f29d3c9cc4f9d70094374762 A LL -:100644 100644 03f24c8c4700babccfd28b654e7e8eac402ad6cd 103d9f89b50b9aad03054b579be5e7aa665f2d57 M MD -:100644 100644 b258508afb7ceb449981bd9d63d2d3e971bf8d34 b431b272d829ff3aa4d1a5085f4394ab4d3305b6 M MM -:100644 100644 bd084b0c27c7b6cc34f11d6d0509a29be3caf970 a716d58de4a570e0038f5c307bd8db34daea021f M MN -:100644 100644 40c959f984c8b89a2b02520d17f00d717f024397 2ac547ae9614a00d1b28275de608131f7a0e259f M SS -:100644 100644 4ac13458899ab908ef3b1128fa378daefc88d356 4c86f9a85fbc5e6804ee2e17a797538fbe785bca M TT -:040000 040000 7d670fdcdb9929f6c7dac196ff78689cd1c566a1 5e5f22072bb39f6e12cf663a57cb634c76eefb49 M Z +test_oid_init + +test_oid_cache <<\EOF +aa_1 sha1:ccba72ad3888a3520b39efcf780b9ee64167535d +aa_1 sha256:9febfbf18197819b2735c45291f138525d2476d59470f98239647544586ba403 + +aa_2 sha1:6aa2b5335b16431a0ef71e5c0a28be69183cf6a2 +aa_2 sha256:6eaa3437de83f145a4aaa6ba355303075ade547b128ec6a2cd00a81ff7ce7a56 + +an_1 sha1:7e426fb079479fd67f6d81f984e4ec649a44bc25 +an_1 sha256:8f92a0bec99e399a38e3bd0e1bf19fbf121e0160efb29b857df79d439f1c4536 + +dd_1 sha1:bcc68ef997017466d5c9094bcf7692295f588c9a +dd_1 sha256:07e17428b00639b85485d2b01083d219e2f3e3ba8579e9ca44e9cc8dd554d952 + +df_1 sha1:6d50f65d3bdab91c63444294d38f08aeff328e42 +df_1 sha256:e367cecc27e9bf5451b1c65828cb21938d36a5f8e39c1b03ad6509cc36bb8e9d + +df_2 sha1:71420ab81e254145d26d6fc0cddee64c1acd4787 +df_2 sha256:0f0a86d10347ff6921d03a3c954679f3f1d14fa3d5cd82f57b32c09755f3a47d + +dfd1 sha1:68a6d8b91da11045cf4aa3a5ab9f2a781c701249 +dfd1 sha256:f3bd3265b02b6978ce86490d8ad026c573639c974b3de1d9faf30d8d5a77d3d5 + +dm_1 sha1:141c1f1642328e4bc46a7d801a71da392e66791e +dm_1 sha256:c89f8656e7b94e21ee5fbaf0e2149bbf783c51edbe2ce110349cac13059ee7ed + +dm_2 sha1:3c4d8de5fbad08572bab8e10eef8dbb264cf0231 +dm_2 sha256:83a572e37e0c94086294dae2cecc43d9131afd6f6c906e495c78972230b54988 + +dn_1 sha1:35abde1506ddf806572ff4d407bd06885d0f8ee9 +dn_1 sha256:775d5852582070e620be63327bfa515fab8f71c7ac3e4f0c3cd6267b4377ba28 + +ll_2 sha1:1d41122ebdd7a640f29d3c9cc4f9d70094374762 +ll_2 sha256:7917b4948a883cfed0a77d3d5a625dc8577d6ddcc3c6c3bbc56c4d4226a2246d + +md_1 sha1:03f24c8c4700babccfd28b654e7e8eac402ad6cd +md_1 sha256:fc9f30369b978595ad685ba11ca9a17de0af16d79cd4b629975f4f1590033902 + +md_2 sha1:103d9f89b50b9aad03054b579be5e7aa665f2d57 +md_2 sha256:fc78ec75275628762fe520479a6b2398dec295ce7aabcb1d15e5963c7b4e9317 + +mm_1 sha1:b258508afb7ceb449981bd9d63d2d3e971bf8d34 +mm_1 sha256:a4b7847d228e900e3000285e240c20fd96f9dd41ce1445305f6eada126d4a04a + +mm_2 sha1:b431b272d829ff3aa4d1a5085f4394ab4d3305b6 +mm_2 sha256:3f8b83ea36aacf689bcf1a1290a9a8ed341564d32682ea6f76fea9a979186782 + +mm_3 sha1:19989d4559aae417fedee240ccf2ba315ea4dc2b +mm_3 sha256:71b3bfc5747ac033fff9ea0ab39ee453a3af2969890e75d6ef547b87544e2681 + +mn_1 sha1:bd084b0c27c7b6cc34f11d6d0509a29be3caf970 +mn_1 sha256:47a67450583d7a329eb01a7c4ba644945af72c0ed2c7c95eb5a00d6e46d4d483 + +mn_2 sha1:a716d58de4a570e0038f5c307bd8db34daea021f +mn_2 sha256:f95104c1ebe27acb84bac25a7be98c71f6b8d3054b21f357a5be0c524ad97e08 + +nm_1 sha1:c8f25781e8f1792e3e40b74225e20553041b5226 +nm_1 sha256:09baddc7afaa62e62e152c23c9c3ab94bf15a3894031e227e9be7fe68e1f4e49 + +nm_2 sha1:cdb9a8c3da571502ac30225e9c17beccb8387983 +nm_2 sha256:58b5227956ac2d2a08d0efa513c0ae37430948b16791ea3869a1308dbf05536d + +na_1 sha1:15885881ea69115351c09b38371f0348a3fb8c67 +na_1 sha256:18e4fdd1670cd7968ee23d35bfd29e5418d56fb190c840094c1c57ceee0aad8f + +nd_1 sha1:a4e179e4291e5536a5e1c82e091052772d2c5a93 +nd_1 sha256:07dac9b01d00956ea0c65bd993d7de4864aeef2ed3cbb1255d9f1d949fcd6df6 + +ss_1 sha1:40c959f984c8b89a2b02520d17f00d717f024397 +ss_1 sha256:50fc1b5df74d9910db2f9270993484235f15b69b75b01bcfb53e059289d14af9 + +ss_2 sha1:2ac547ae9614a00d1b28275de608131f7a0e259f +ss_2 sha256:a90f02e6044f1497d13db587d22ab12f90150a7d1e084afcf96065fab35ae2bc + +tt_1 sha1:4ac13458899ab908ef3b1128fa378daefc88d356 +tt_1 sha256:c53113c7dd5060e86b5b251428bd058f6726f66273c6a24bff1c61a04f498dd3 + +tt_2 sha1:4c86f9a85fbc5e6804ee2e17a797538fbe785bca +tt_2 sha256:0775f2a296129a7cf2862b46bc0e88c14d593f2773a3e3fb1c5193db6f5a7e77 + +tt_3 sha1:c4e4a12231b9fa79a0053cb6077fcb21bb5b135a +tt_3 sha256:47860f93cdd211f96443e0560f21c57ab6c2f4b0ac27ff03651a352e53fe8484 + +z__1 sha1:7d670fdcdb9929f6c7dac196ff78689cd1c566a1 +z__1 sha256:44d0f37aff5e51cfcfdd1134c93a6419bcca7b9964f792ffcd5f9b4fcba1ee63 + +z__2 sha1:5e5f22072bb39f6e12cf663a57cb634c76eefb49 +z__2 sha256:d29de162113190fed104eb5f010820cef4e315f89b9326e8497f7219fb737894 + +z__3 sha1:1ba523955d5160681af65cb776411f574c1e8155 +z__3 sha256:07422d772b07794ab4369a5648e617719f89c2d2212cbeab05d97214b6471636 + +zaa1 sha1:8acb8e9750e3f644bf323fcf3d338849db106c77 +zaa1 sha256:e79b029282c8abec2d9f3f7faceaf2a1405e02d1f368e66450ae66cf5b68d1f4 + +zaa2 sha1:6c0b99286d0bce551ac4a7b3dff8b706edff3715 +zaa2 sha256:c82bd78c3e69ea1796e6b1a7a3ba45bb106c50e819296475b862123d3f5cc5a0 + +zan1 sha1:087494262084cefee7ed484d20c8dc0580791272 +zan1 sha256:4b159eb3804d05599023dd074f771d06d02870f4ab24a7165add8ac3d703b8d3 + +zdd1 sha1:879007efae624d2b1307214b24a956f0a8d686a8 +zdd1 sha256:eecfdd4d8092dd0363fb6d4548b54c6afc8982c3ed9b34e393f1d6a921d8eaa3 + +zdm1 sha1:9b541b2275c06e3a7b13f28badf5294e2ae63df4 +zdm1 sha256:ab136e88e19a843c4bf7713d2090d5a2186ba16a6a80dacc12eeddd256a8e556 + +zdm2 sha1:d77371d15817fcaa57eeec27f770c505ba974ec1 +zdm2 sha256:1c1a5f57363f46a15d95ce8527b3c2c158d88d16853b4acbf81bd20fd2c89a46 + +zdn1 sha1:beb5d38c55283d280685ea21a0e50cfcc0ca064a +zdn1 sha256:0f0eca66183617b0aa5ad74b256540329f841470922ca6760263c996d825eb18 + +zmd1 sha1:d41fda41b7ec4de46b43cb7ea42a45001ae393d5 +zmd1 sha256:1ed32d481852eddf31a0ce12652a0ad14bf5b7a842667b5dbb0b50f35bf1c80a + +zmd2 sha1:a79ac3be9377639e1c7d1edf1ae1b3a5f0ccd8a9 +zmd2 sha256:b238da211b404f8917df2d9c6f7030535e904b2186131007a3c292ec6902f933 + +zmm1 sha1:4ca22bae2527d3d9e1676498a0fba3b355bd1278 +zmm1 sha256:072b1d85b5f34fabc99dfa46008c5418df68302d3e317430006f49b32d244226 + +zmm2 sha1:61422ba9c2c873416061a88cd40a59a35b576474 +zmm2 sha256:81dd5d2b3c5cda16fef552256aed4e2ea0802a8450a08f308a92142112ff6dda + +zmm3 sha1:697aad7715a1e7306ca76290a3dd4208fbaeddfa +zmm3 sha256:8b10fab49e9be3414aa5e9a93d0e46f9569053440138a7c19a5eb5536d8e95bf + +zmn1 sha1:b16d7b25b869f2beb124efa53467d8a1550ad694 +zmn1 sha256:609e4f75d1295e844c826feeba213acb0b6cfc609adfe8ff705b19e3829ae3e9 + +zmn2 sha1:a5c544c21cfcb07eb80a4d89a5b7d1570002edfd +zmn2 sha256:d6d03edf2dc1a3b267a8205de5f41a2ff4b03def8c7ae02052b543fb09d589fc + +zna1 sha1:d12979c22fff69c59ca9409e7a8fe3ee25eaee80 +zna1 sha256:b37b80e789e8ea32aa323f004628f02013f632124b0282c7fe00a127d3c64c3c + +znd1 sha1:a18393c636b98e9bd7296b8b437ea4992b72440c +znd1 sha256:af92a22eee8c38410a0c9d2b5135a10aeb052cbc7cf675541ed9a67bfcaf7cf9 + +znm1 sha1:3fdbe17fd013303a2e981e1ca1c6cd6e72789087 +znm1 sha256:f75aeaa0c11e76918e381c105f0752932c6150e941fec565d24fa31098a13dc1 + +znm2 sha1:7e09d6a3a14bd630913e8c75693cea32157b606d +znm2 sha256:938d73cfbaa1c902a84fb5b3afd9736aa0590367fb9bd59c6c4d072ce70fcd6d +EOF + +cat >.test-plain-OA <.test-recursive-OA <<\EOF -:000000 100644 0000000000000000000000000000000000000000 ccba72ad3888a3520b39efcf780b9ee64167535d A AA -:000000 100644 0000000000000000000000000000000000000000 7e426fb079479fd67f6d81f984e4ec649a44bc25 A AN -:100644 000000 bcc68ef997017466d5c9094bcf7692295f588c9a 0000000000000000000000000000000000000000 D DD -:000000 100644 0000000000000000000000000000000000000000 68a6d8b91da11045cf4aa3a5ab9f2a781c701249 A DF/DF -:100644 000000 141c1f1642328e4bc46a7d801a71da392e66791e 0000000000000000000000000000000000000000 D DM -:100644 000000 35abde1506ddf806572ff4d407bd06885d0f8ee9 0000000000000000000000000000000000000000 D DN -:000000 100644 0000000000000000000000000000000000000000 1d41122ebdd7a640f29d3c9cc4f9d70094374762 A LL -:100644 100644 03f24c8c4700babccfd28b654e7e8eac402ad6cd 103d9f89b50b9aad03054b579be5e7aa665f2d57 M MD -:100644 100644 b258508afb7ceb449981bd9d63d2d3e971bf8d34 b431b272d829ff3aa4d1a5085f4394ab4d3305b6 M MM -:100644 100644 bd084b0c27c7b6cc34f11d6d0509a29be3caf970 a716d58de4a570e0038f5c307bd8db34daea021f M MN -:100644 100644 40c959f984c8b89a2b02520d17f00d717f024397 2ac547ae9614a00d1b28275de608131f7a0e259f M SS -:100644 100644 4ac13458899ab908ef3b1128fa378daefc88d356 4c86f9a85fbc5e6804ee2e17a797538fbe785bca M TT -:000000 100644 0000000000000000000000000000000000000000 8acb8e9750e3f644bf323fcf3d338849db106c77 A Z/AA -:000000 100644 0000000000000000000000000000000000000000 087494262084cefee7ed484d20c8dc0580791272 A Z/AN -:100644 000000 879007efae624d2b1307214b24a956f0a8d686a8 0000000000000000000000000000000000000000 D Z/DD -:100644 000000 9b541b2275c06e3a7b13f28badf5294e2ae63df4 0000000000000000000000000000000000000000 D Z/DM -:100644 000000 beb5d38c55283d280685ea21a0e50cfcc0ca064a 0000000000000000000000000000000000000000 D Z/DN -:100644 100644 d41fda41b7ec4de46b43cb7ea42a45001ae393d5 a79ac3be9377639e1c7d1edf1ae1b3a5f0ccd8a9 M Z/MD -:100644 100644 4ca22bae2527d3d9e1676498a0fba3b355bd1278 61422ba9c2c873416061a88cd40a59a35b576474 M Z/MM -:100644 100644 b16d7b25b869f2beb124efa53467d8a1550ad694 a5c544c21cfcb07eb80a4d89a5b7d1570002edfd M Z/MN +cat >.test-recursive-OA <.test-plain-OB <<\EOF -:000000 100644 0000000000000000000000000000000000000000 6aa2b5335b16431a0ef71e5c0a28be69183cf6a2 A AA -:100644 000000 bcc68ef997017466d5c9094bcf7692295f588c9a 0000000000000000000000000000000000000000 D DD -:000000 100644 0000000000000000000000000000000000000000 71420ab81e254145d26d6fc0cddee64c1acd4787 A DF -:100644 100644 141c1f1642328e4bc46a7d801a71da392e66791e 3c4d8de5fbad08572bab8e10eef8dbb264cf0231 M DM -:000000 100644 0000000000000000000000000000000000000000 1d41122ebdd7a640f29d3c9cc4f9d70094374762 A LL -:100644 000000 03f24c8c4700babccfd28b654e7e8eac402ad6cd 0000000000000000000000000000000000000000 D MD -:100644 100644 b258508afb7ceb449981bd9d63d2d3e971bf8d34 19989d4559aae417fedee240ccf2ba315ea4dc2b M MM -:000000 100644 0000000000000000000000000000000000000000 15885881ea69115351c09b38371f0348a3fb8c67 A NA -:100644 000000 a4e179e4291e5536a5e1c82e091052772d2c5a93 0000000000000000000000000000000000000000 D ND -:100644 100644 c8f25781e8f1792e3e40b74225e20553041b5226 cdb9a8c3da571502ac30225e9c17beccb8387983 M NM -:100644 100644 40c959f984c8b89a2b02520d17f00d717f024397 2ac547ae9614a00d1b28275de608131f7a0e259f M SS -:100644 100644 4ac13458899ab908ef3b1128fa378daefc88d356 c4e4a12231b9fa79a0053cb6077fcb21bb5b135a M TT -:040000 040000 7d670fdcdb9929f6c7dac196ff78689cd1c566a1 1ba523955d5160681af65cb776411f574c1e8155 M Z +cat >.test-plain-OB <.test-recursive-OB <<\EOF -:000000 100644 0000000000000000000000000000000000000000 6aa2b5335b16431a0ef71e5c0a28be69183cf6a2 A AA -:100644 000000 bcc68ef997017466d5c9094bcf7692295f588c9a 0000000000000000000000000000000000000000 D DD -:000000 100644 0000000000000000000000000000000000000000 71420ab81e254145d26d6fc0cddee64c1acd4787 A DF -:100644 100644 141c1f1642328e4bc46a7d801a71da392e66791e 3c4d8de5fbad08572bab8e10eef8dbb264cf0231 M DM -:000000 100644 0000000000000000000000000000000000000000 1d41122ebdd7a640f29d3c9cc4f9d70094374762 A LL -:100644 000000 03f24c8c4700babccfd28b654e7e8eac402ad6cd 0000000000000000000000000000000000000000 D MD -:100644 100644 b258508afb7ceb449981bd9d63d2d3e971bf8d34 19989d4559aae417fedee240ccf2ba315ea4dc2b M MM -:000000 100644 0000000000000000000000000000000000000000 15885881ea69115351c09b38371f0348a3fb8c67 A NA -:100644 000000 a4e179e4291e5536a5e1c82e091052772d2c5a93 0000000000000000000000000000000000000000 D ND -:100644 100644 c8f25781e8f1792e3e40b74225e20553041b5226 cdb9a8c3da571502ac30225e9c17beccb8387983 M NM -:100644 100644 40c959f984c8b89a2b02520d17f00d717f024397 2ac547ae9614a00d1b28275de608131f7a0e259f M SS -:100644 100644 4ac13458899ab908ef3b1128fa378daefc88d356 c4e4a12231b9fa79a0053cb6077fcb21bb5b135a M TT -:000000 100644 0000000000000000000000000000000000000000 6c0b99286d0bce551ac4a7b3dff8b706edff3715 A Z/AA -:100644 000000 879007efae624d2b1307214b24a956f0a8d686a8 0000000000000000000000000000000000000000 D Z/DD -:100644 100644 9b541b2275c06e3a7b13f28badf5294e2ae63df4 d77371d15817fcaa57eeec27f770c505ba974ec1 M Z/DM -:100644 000000 d41fda41b7ec4de46b43cb7ea42a45001ae393d5 0000000000000000000000000000000000000000 D Z/MD -:100644 100644 4ca22bae2527d3d9e1676498a0fba3b355bd1278 697aad7715a1e7306ca76290a3dd4208fbaeddfa M Z/MM -:000000 100644 0000000000000000000000000000000000000000 d12979c22fff69c59ca9409e7a8fe3ee25eaee80 A Z/NA -:100644 000000 a18393c636b98e9bd7296b8b437ea4992b72440c 0000000000000000000000000000000000000000 D Z/ND -:100644 100644 3fdbe17fd013303a2e981e1ca1c6cd6e72789087 7e09d6a3a14bd630913e8c75693cea32157b606d M Z/NM +cat >.test-recursive-OB <.test-plain-AB <<\EOF -:100644 100644 ccba72ad3888a3520b39efcf780b9ee64167535d 6aa2b5335b16431a0ef71e5c0a28be69183cf6a2 M AA -:100644 000000 7e426fb079479fd67f6d81f984e4ec649a44bc25 0000000000000000000000000000000000000000 D AN -:000000 100644 0000000000000000000000000000000000000000 71420ab81e254145d26d6fc0cddee64c1acd4787 A DF -:040000 000000 6d50f65d3bdab91c63444294d38f08aeff328e42 0000000000000000000000000000000000000000 D DF -:000000 100644 0000000000000000000000000000000000000000 3c4d8de5fbad08572bab8e10eef8dbb264cf0231 A DM -:000000 100644 0000000000000000000000000000000000000000 35abde1506ddf806572ff4d407bd06885d0f8ee9 A DN -:100644 000000 103d9f89b50b9aad03054b579be5e7aa665f2d57 0000000000000000000000000000000000000000 D MD -:100644 100644 b431b272d829ff3aa4d1a5085f4394ab4d3305b6 19989d4559aae417fedee240ccf2ba315ea4dc2b M MM -:100644 100644 a716d58de4a570e0038f5c307bd8db34daea021f bd084b0c27c7b6cc34f11d6d0509a29be3caf970 M MN -:000000 100644 0000000000000000000000000000000000000000 15885881ea69115351c09b38371f0348a3fb8c67 A NA -:100644 000000 a4e179e4291e5536a5e1c82e091052772d2c5a93 0000000000000000000000000000000000000000 D ND -:100644 100644 c8f25781e8f1792e3e40b74225e20553041b5226 cdb9a8c3da571502ac30225e9c17beccb8387983 M NM -:100644 100644 4c86f9a85fbc5e6804ee2e17a797538fbe785bca c4e4a12231b9fa79a0053cb6077fcb21bb5b135a M TT -:040000 040000 5e5f22072bb39f6e12cf663a57cb634c76eefb49 1ba523955d5160681af65cb776411f574c1e8155 M Z +cat >.test-plain-AB <.test-recursive-AB <<\EOF -:100644 100644 ccba72ad3888a3520b39efcf780b9ee64167535d 6aa2b5335b16431a0ef71e5c0a28be69183cf6a2 M AA -:100644 000000 7e426fb079479fd67f6d81f984e4ec649a44bc25 0000000000000000000000000000000000000000 D AN -:000000 100644 0000000000000000000000000000000000000000 71420ab81e254145d26d6fc0cddee64c1acd4787 A DF -:100644 000000 68a6d8b91da11045cf4aa3a5ab9f2a781c701249 0000000000000000000000000000000000000000 D DF/DF -:000000 100644 0000000000000000000000000000000000000000 3c4d8de5fbad08572bab8e10eef8dbb264cf0231 A DM -:000000 100644 0000000000000000000000000000000000000000 35abde1506ddf806572ff4d407bd06885d0f8ee9 A DN -:100644 000000 103d9f89b50b9aad03054b579be5e7aa665f2d57 0000000000000000000000000000000000000000 D MD -:100644 100644 b431b272d829ff3aa4d1a5085f4394ab4d3305b6 19989d4559aae417fedee240ccf2ba315ea4dc2b M MM -:100644 100644 a716d58de4a570e0038f5c307bd8db34daea021f bd084b0c27c7b6cc34f11d6d0509a29be3caf970 M MN -:000000 100644 0000000000000000000000000000000000000000 15885881ea69115351c09b38371f0348a3fb8c67 A NA -:100644 000000 a4e179e4291e5536a5e1c82e091052772d2c5a93 0000000000000000000000000000000000000000 D ND -:100644 100644 c8f25781e8f1792e3e40b74225e20553041b5226 cdb9a8c3da571502ac30225e9c17beccb8387983 M NM -:100644 100644 4c86f9a85fbc5e6804ee2e17a797538fbe785bca c4e4a12231b9fa79a0053cb6077fcb21bb5b135a M TT -:100644 100644 8acb8e9750e3f644bf323fcf3d338849db106c77 6c0b99286d0bce551ac4a7b3dff8b706edff3715 M Z/AA -:100644 000000 087494262084cefee7ed484d20c8dc0580791272 0000000000000000000000000000000000000000 D Z/AN -:000000 100644 0000000000000000000000000000000000000000 d77371d15817fcaa57eeec27f770c505ba974ec1 A Z/DM -:000000 100644 0000000000000000000000000000000000000000 beb5d38c55283d280685ea21a0e50cfcc0ca064a A Z/DN -:100644 000000 a79ac3be9377639e1c7d1edf1ae1b3a5f0ccd8a9 0000000000000000000000000000000000000000 D Z/MD -:100644 100644 61422ba9c2c873416061a88cd40a59a35b576474 697aad7715a1e7306ca76290a3dd4208fbaeddfa M Z/MM -:100644 100644 a5c544c21cfcb07eb80a4d89a5b7d1570002edfd b16d7b25b869f2beb124efa53467d8a1550ad694 M Z/MN -:000000 100644 0000000000000000000000000000000000000000 d12979c22fff69c59ca9409e7a8fe3ee25eaee80 A Z/NA -:100644 000000 a18393c636b98e9bd7296b8b437ea4992b72440c 0000000000000000000000000000000000000000 D Z/ND -:100644 100644 3fdbe17fd013303a2e981e1ca1c6cd6e72789087 7e09d6a3a14bd630913e8c75693cea32157b606d M Z/NM +cat >.test-recursive-AB < X-Patchwork-Id: 11099889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA7511399 for ; Sun, 18 Aug 2019 19:21:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB60E28562 for ; Sun, 18 Aug 2019 19:21:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFB9E2856B; Sun, 18 Aug 2019 19:21:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,LOTS_OF_MONEY,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 643E028562 for ; Sun, 18 Aug 2019 19:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727182AbfHRTVJ (ORCPT ); Sun, 18 Aug 2019 15:21:09 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57880 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727176AbfHRTVJ (ORCPT ); Sun, 18 Aug 2019 15:21:09 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id C569A6077E; Sun, 18 Aug 2019 19:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156067; bh=OskeKmdpZ9nLckrJUu3+POVkfA4cNtRkaT2wjBCy2qI=; 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=o1RA/kDr0gTbUp/hCcDA4DYByDoz8lHGSSTexSDifRIT4gdq7aQj8taDGPNtfZOYB Tgot9nwYTbBc8iXJTg65LelYRYQe6b1X9otQcC+j+jE6cfCW129QW6Z3Uvq38JMOFA rxc6TJbN5bQcKbX4nrpA6Jfl09n69xoIwvR1f58paxPvk/8ET/ruaqNxWRUmFw/5lI aL3j6fAtvUvOc4/Q+tHvaW+10uUAXl8oMfZ6QAQ5fN/9yJEw9JhlMTaDV+U+3joX4N 6+ZHjcMw9aiAJzK/dDzfTTxEiiUTgbz/m5uYjsCCzVMq8Y0WxfyvEgCSvgDddB1aK4 HrQa+BrVhPWy8WvjP5jG6lEAKa2fRGXiyXH3+lTKqOQIyysIAiXnDQxBwCKfULxJO+ UOYbBseNGQbGePUkL3Ak9FQhFSQBnP4yFokAmt5H4YPJkWQiqlwRrXXVvyXadw7Dy8 7ARjeS5m0jKWp5xStGeju6+FdDTS+mj4x1UpsVOGaqtPfghWdSn From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 14/14] t4009: make hash size independent Date: Sun, 18 Aug 2019 19:16:46 +0000 Message-Id: <20190818191646.868106-15-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 X-Virus-Scanned: ClamAV using ClamSMTP Instead of hard-coding object IDs, compute them and use those in the comparison. Note that the comparison code ignores the actual object IDs, but does check that they're the right size, so computing them is the easiest way to ensure that they are. Signed-off-by: brian m. carlson --- t/t4009-diff-rename-4.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh index 3641fd84d6..b63bdf031f 100755 --- a/t/t4009-diff-rename-4.sh +++ b/t/t4009-diff-rename-4.sh @@ -14,6 +14,7 @@ test_expect_success \ 'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING && echo frotz >rezrov && git update-index --add COPYING rezrov && + orig=$(git hash-object COPYING) && tree=$(git write-tree) && echo $tree' @@ -22,6 +23,8 @@ test_expect_success \ 'sed -e 's/HOWEVER/However/' COPYING.1 && sed -e 's/GPL/G.P.L/g' COPYING.2 && rm -f COPYING && + c1=$(git hash-object COPYING.1) && + c2=$(git hash-object COPYING.2) && git update-index --add --remove COPYING COPYING.?' # tree has COPYING and rezrov. work tree has COPYING.1 and COPYING.2, @@ -31,11 +34,11 @@ test_expect_success \ git diff-index -z -C $tree >current -cat >expected <<\EOF -:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0603b3238a076dc6c8022aedc6648fa523a17178 C1234 +cat >expected <current -cat >expected <<\EOF -:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 06c67961bbaed34a127f76d261f4c0bf73eda471 M +cat >expected <current -cat >expected <<\EOF -:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0603b3238a076dc6c8022aedc6648fa523a17178 C1234 +cat >expected <