From patchwork Sat Dec 21 19:49:17 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: 11307153 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB1AC139A for ; Sat, 21 Dec 2019 19:50:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F506206D8 for ; Sat, 21 Dec 2019 19:50:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="Hd4fQTA2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727250AbfLUTuG (ORCPT ); Sat, 21 Dec 2019 14:50:06 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41950 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbfLUTuG (ORCPT ); Sat, 21 Dec 2019 14:50:06 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 1F564607F0; Sat, 21 Dec 2019 19:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957805; bh=GQsS/lbLwzG1mmcJX4agdWd1aF/W4PpFsGSL5y5RFg8=; 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=Hd4fQTA2BGKptu9avvlJMA1SJbwxCUzu+8L9Ydj8SKAn/WVGFp5LlOUfz7Acx/vYR +sAXzczCRk8ZyxzmzYG5LjHpvvnTBgepROCsT2COtNYBw5cgZ4IElm37Miz1sWe8UO HRWzsOJt6Ah2fGRc3TyIcNlkfKWbtcKVxLCj9PvPOPOL65xxdq5dY3sPK3EVy9u1hT 6pY3xdYtGVEp4aRj4zQVG4RqPGT6Jhl/sEYwgA2iVdGkOpk9tx++/XyQh9sMQaKJPz d6X4pE0NQuyZccaWqhSWwml4KQ/kDWQFXrk1OZhW6z50iR9CZQE0zAly13frjoyVo5 RWwm74FIy2h+ctN+fiRmxltrezMYlMm7196eGiMCmOsJUJn8PuA7NUb7b+yQY7Xe7y tUpO9sxiydjTT1d6e5q7r5MKwiwI1q3SGBKpEjj0xJNHkruBjc/ZW3OQgmPW6Ov4yz AImd7kSU1JFhQOjtH43TFNMMfUmcQq8FD1GMlLIJsIXpE7dYzg5 From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 01/20] t4054: make hash-size independent Date: Sat, 21 Dec 2019 19:49:17 +0000 Message-Id: <20191221194936.1346664-2-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Instead of hard-coding the length of an object ID when creating a tree, generate it based on $ZERO_OID. Signed-off-by: brian m. carlson --- t/t4054-diff-bogus-tree.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t4054-diff-bogus-tree.sh b/t/t4054-diff-bogus-tree.sh index fcae82fffa..8c95f152b2 100755 --- a/t/t4054-diff-bogus-tree.sh +++ b/t/t4054-diff-bogus-tree.sh @@ -4,8 +4,9 @@ test_description='test diff with a bogus tree containing the null sha1' . ./test-lib.sh test_expect_success 'create bogus tree' ' + name=$(echo $ZERO_OID | sed -e "s/00/Q/g") && bogus_tree=$( - printf "100644 fooQQQQQQQQQQQQQQQQQQQQQ" | + printf "100644 fooQ$name" | q_to_nul | git hash-object -w --stdin -t tree ) From patchwork Sat Dec 21 19:49:18 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: 11307155 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E606D1892 for ; Sat, 21 Dec 2019 19:50:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C49B6206B7 for ; Sat, 21 Dec 2019 19:50:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="ddr4XvgT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727297AbfLUTuH (ORCPT ); Sat, 21 Dec 2019 14:50:07 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41960 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727126AbfLUTuG (ORCPT ); Sat, 21 Dec 2019 14:50:06 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id A5E75607F1; Sat, 21 Dec 2019 19:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957806; bh=jSzi3+oT97M7iFE7O5sO3e4khL3Sau129ZFQhFJcuLY=; 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=ddr4XvgTz9AFDpu6nBqiCLBttOHUXapjIeTuB4EGVsuXp+O0da+CYh+JEhVcXr+8m pqz3udR0UykA9BSUliOmS7d04W2W4txTe7Qh5tnJ5b1wVMxcwQOzr+ZyJLH7HdjWpg M2m8sj4uznZvIbYOwqkWBBI2hYkQU7yYu4gJlIDio059c5XM1ZiTL1Tslgnf85JmZ/ FzGB+0KQtobtm6B+OS1N/L4lxNzGMT5x8/mS4zYDZD78D+ipUvKRAiGWVhcP6/6HhU jH/R16Q9HqUDJGvC8BUA1crV5zT2W2DzcmLajwP2PKuMK3GXBlgyXXLiVPN8k9qMZs ESusgW50G6kwuWT929EnrfnYM87iZJKP6wwjvmcl0vBWr7To6OxRFNxU2ZHMpHV2Nd 8szIUGUZRqhsBhWIgjng9lU01rIHCNk9NTVZgflRQ/LH/oVzVZN48C2Nc8B9R5EEwO IPKTA+twiXBfiawFOHR4ooccMR8Lsg1LubpjAstTGvsWYlZvm3r From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 02/20] t4066: compute index line in diffs Date: Sat, 21 Dec 2019 19:49:18 +0000 Message-Id: <20191221194936.1346664-3-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-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 Since the object ID used in the index line will differ between different algorithms, compute these values instead of hard-coding them. Signed-off-by: brian m. carlson --- t/t4066-diff-emit-delay.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t4066-diff-emit-delay.sh b/t/t4066-diff-emit-delay.sh index 5df6b5e64e..6331f63b12 100755 --- a/t/t4066-diff-emit-delay.sh +++ b/t/t4066-diff-emit-delay.sh @@ -18,7 +18,7 @@ test_expect_success 'set up history with a merge' ' ' test_expect_success 'log --cc -p --stat --color-moved' ' - cat >expect <<-\EOF && + cat >expect <<-EOF && commit D --- D.t | 1 + @@ -26,7 +26,7 @@ test_expect_success 'log --cc -p --stat --color-moved' ' diff --git a/D.t b/D.t new file mode 100644 - index 0000000..1784810 + index 0000000..$(git rev-parse --short D:D.t) --- /dev/null +++ b/D.t @@ -0,0 +1 @@ @@ -42,7 +42,7 @@ test_expect_success 'log --cc -p --stat --color-moved' ' diff --git a/C.t b/C.t new file mode 100644 - index 0000000..3cc58df + index 0000000..$(git rev-parse --short C:C.t) --- /dev/null +++ b/C.t @@ -0,0 +1 @@ @@ -54,7 +54,7 @@ test_expect_success 'log --cc -p --stat --color-moved' ' diff --git a/B.t b/B.t new file mode 100644 - index 0000000..223b783 + index 0000000..$(git rev-parse --short B:B.t) --- /dev/null +++ b/B.t @@ -0,0 +1 @@ @@ -66,7 +66,7 @@ test_expect_success 'log --cc -p --stat --color-moved' ' diff --git a/A.t b/A.t new file mode 100644 - index 0000000..f70f10e + index 0000000..$(git rev-parse --short A:A.t) --- /dev/null +++ b/A.t @@ -0,0 +1 @@ From patchwork Sat Dec 21 19:49:19 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: 11307157 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2731D159A for ; Sat, 21 Dec 2019 19:50:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF381206B7 for ; Sat, 21 Dec 2019 19:50:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="lBNNnOyL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727355AbfLUTuI (ORCPT ); Sat, 21 Dec 2019 14:50:08 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41966 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbfLUTuH (ORCPT ); Sat, 21 Dec 2019 14:50:07 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 3BACC607F2; Sat, 21 Dec 2019 19:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957806; bh=r2tV6BQwbbIAolSCiUgyYPke9rmwMsCGcsq6XheiC7Q=; 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=lBNNnOyL/FDX0T5JkV0Ax95GyzaVRYy1WelwUfsXRRNL41casrhUE1gfk/M4l8E1l o/kkxyFEmHitbl9OlhNcPj6udm8qPhTjaTR7CC9EQgybk3RLCPzF3rNGq9456R2QpA tIPWzHuq4g4a35eciB2lgOfhy4glxZ2qF3IFAq/TKiEagqHaraVfEs4PfODEDyxzFj O2vtcxZpA/sDMMaR9kV+eLhW4cyF+GW2P6vfZTVm0a3AttcJXU/iH9FiJNKX7PLnAY rlkwqjys1OZj9qlz+cW+W5YIiLpdA13OyXpLqn57GIKT+ab48Tl7o9jojigFsd7niX wrjJBYOGZ9eO81BY1wQjnF8YrecVb5cuZ5LBtBL/f/RE3jZ+x2wn6l79Pl1rlhdyUq zYtGUVBOruhlQLUe/kMz3su8ivG8iuAUjQBBvIyYuZ6eD1ojoSEKPSeqxBm/R+eeE4 G7qN51ZLdYvIbP11V4Z/sjrPwN2+kvq96RN429uTvd61oI7QCBK From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 03/20] t4134: compute appropriate length constant Date: Sat, 21 Dec 2019 19:49:19 +0000 Message-Id: <20191221194936.1346664-4-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Instead of using a specific invalid hard-coded object ID, generate one of the appropriate length by looking one up in the translation tables. Signed-off-by: brian m. carlson --- t/t4134-apply-submodule.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/t4134-apply-submodule.sh b/t/t4134-apply-submodule.sh index 0043930ca6..99ed4cc546 100755 --- a/t/t4134-apply-submodule.sh +++ b/t/t4134-apply-submodule.sh @@ -8,6 +8,7 @@ test_description='git apply submodule tests' . ./test-lib.sh test_expect_success setup ' + test_oid_init && cat > create-sm.patch < remove-sm.patch < X-Patchwork-Id: 11307161 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91A85139A for ; Sat, 21 Dec 2019 19:50:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64CB4206B7 for ; Sat, 21 Dec 2019 19:50:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="jldcrd7w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727339AbfLUTuI (ORCPT ); Sat, 21 Dec 2019 14:50:08 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41972 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727280AbfLUTuH (ORCPT ); Sat, 21 Dec 2019 14:50:07 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id B7D53607F0; Sat, 21 Dec 2019 19:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957807; bh=PPh+KIhAigigKBimDAnxsmI6PGl1f018JooyKawflik=; 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=jldcrd7w49KpwghjuuHvVrVN37e/8LWFdjv6MixMFi7vDdM3ejlq7nnqrB6BDz1i+ 3G9aBtFKBRE//SyuppCkLtnr77Dycc2NhQKqAXf3LUg0euVaIgIoTYg/T2FPFI5hix uhUrSAP2OxIoQEKkNqOXuzYAoSt/uXl2q80NavGuk7bdD2NG5Ng8SBSphLkQjAxbw7 7yUClZjsenkKdcuswTgiGifGLDeXVyGH5JNjoSiI2eFwmuNI1WEQKpQuGzIuYfLHKz 1FwSJ9VzsoDzOFLKNjB7Pdjn/7OAuY4eFvC+txkl331DiGQ3KzNrevFfR9L6pk8q/7 CF0ZyrH4znQVTp/NuRqio5Wfsp5yYCC0RFkrafh0DrRc5WiE/XDN57XlefwmV+1gmp 3+TP1LMnllTLL13yGZcyEqoeOotLo/DehubAKizVc5TRlxSRknDdGpOm92TiKLOSnM BzX7pH0pEb23gSJMP95D3KYTggEkrHyUegIxoB6xFyshhri+kPb From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 04/20] t4200: make hash size independent Date: Sat, 21 Dec 2019 19:49:20 +0000 Message-Id: <20191221194936.1346664-5-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Instead of hard-coding a fixed length example object ID in the test, look one up using the translation tables. Signed-off-by: brian m. carlson --- t/t4200-rerere.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh index 55b7750ade..831d424c47 100755 --- a/t/t4200-rerere.sh +++ b/t/t4200-rerere.sh @@ -25,6 +25,7 @@ test_description='git rerere . ./test-lib.sh test_expect_success 'setup' ' + test_oid_init && cat >a1 <<-\EOF && Some title ========== @@ -210,7 +211,7 @@ test_expect_success 'set up for garbage collection tests' ' echo Hello >$rr/preimage && echo World >$rr/postimage && - sha2=4000000000000000000000000000000000000000 && + sha2=$(test_oid deadbeef) && rr2=.git/rr-cache/$sha2 && mkdir $rr2 && echo Hello >$rr2/preimage && From patchwork Sat Dec 21 19:49:21 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: 11307191 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43D6714B7 for ; Sat, 21 Dec 2019 19:50:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D65D206D8 for ; Sat, 21 Dec 2019 19:50:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="hR3qRXxc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbfLUTua (ORCPT ); Sat, 21 Dec 2019 14:50:30 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41960 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727126AbfLUTuI (ORCPT ); Sat, 21 Dec 2019 14:50:08 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 40FA9607F3; Sat, 21 Dec 2019 19:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957807; bh=/Fgd7Q2DZV3TOaDNq6V5s2Eimq5+5QAE9XdfQSUzq+Q=; 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=hR3qRXxcIvzX5k9fyw91Gs8Ut9b2+GUHEBPqfpWKFm5BVpjxDHB71PQuu3mB1bq+K CTBxZCzxrvY+l+4ZVMUNW5G2CdOmArTOQ+v6wcPTN+moJxx3dnfSyQyYiz5mnIXsNf oglQbQQFZZpM/TaJCd0gE4ctRWm/Be0kR8x0icEXSGxmt0Zq0Ky4R5SxMlU2uwgwgt WJhihrPTTPr8Wi35jOvTErHK7vtAYJwrBuilVHaV8IBPoLCfXWCffjZWqP6YDrekd0 NhkJdf1slad3Ugo9cAcPg76FDT7TcXdOv58sKgCn1lMZbhp/tGZYBmi2kYz4GcpFZk uRI8U4g4VC8HkVVSDcpwH+xiHefxsHpwBFgSdN94K13CUPzXcWUnGekz0YRdpAFi4Y HpTqQ5vMy+/cG/QBlxt5WqMWJr8EM3FcErFnIqdYFgFPpNwFwSW9XaH9pBYOQ2Acg0 RiZEmrkqjud7sXrfvXl7v1fWRVSET16wbJZTOTUPQkNaRE489ff From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 05/20] t4202: abstract away SHA-1-specific constants Date: Sat, 21 Dec 2019 19:49:21 +0000 Message-Id: <20191221194936.1346664-6-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Adjust the test so that it computes values for object IDs instead of using hard-coded hashes. Additionally, update the sanitize_output function to sanitize the index lines in diff output, 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/t4202-log.sh | 127 +++++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 62 deletions(-) diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 2c9489484a..192347a3e1 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -87,12 +87,12 @@ test_expect_success 'format %w(,1,2)' ' ' cat > expect << EOF -804a787 sixth -394ef78 fifth -5d31159 fourth -2fbe8c0 third -f7dab8e second -3a2fdcb initial +$(git rev-parse --short :/sixth ) sixth +$(git rev-parse --short :/fifth ) fifth +$(git rev-parse --short :/fourth ) fourth +$(git rev-parse --short :/third ) third +$(git rev-parse --short :/second ) second +$(git rev-parse --short :/initial) initial EOF test_expect_success 'oneline' ' @@ -173,43 +173,45 @@ test_expect_success 'git config log.follow is overridden by --no-follow' ' verbose test "$actual" = "$expect" ' +# Note that these commits are intentionally listed out of order. +last_three="$(git rev-parse :/fourth :/sixth :/fifth)" cat > expect << EOF -804a787 sixth -394ef78 fifth -5d31159 fourth +$(git rev-parse --short :/sixth ) sixth +$(git rev-parse --short :/fifth ) fifth +$(git rev-parse --short :/fourth) fourth EOF test_expect_success 'git log --no-walk sorts by commit time' ' - git log --no-walk --oneline 5d31159 804a787 394ef78 > actual && + git log --no-walk --oneline $last_three > actual && test_cmp expect actual ' test_expect_success 'git log --no-walk=sorted sorts by commit time' ' - git log --no-walk=sorted --oneline 5d31159 804a787 394ef78 > actual && + git log --no-walk=sorted --oneline $last_three > actual && test_cmp expect actual ' cat > expect << EOF -=== 804a787 sixth -=== 394ef78 fifth -=== 5d31159 fourth +=== $(git rev-parse --short :/sixth ) sixth +=== $(git rev-parse --short :/fifth ) fifth +=== $(git rev-parse --short :/fourth) fourth EOF test_expect_success 'git log --line-prefix="=== " --no-walk sorts by commit time' ' - git log --line-prefix="=== " --no-walk --oneline 5d31159 804a787 394ef78 > actual && + git log --line-prefix="=== " --no-walk --oneline $last_three > actual && test_cmp expect actual ' cat > expect << EOF -5d31159 fourth -804a787 sixth -394ef78 fifth +$(git rev-parse --short :/fourth) fourth +$(git rev-parse --short :/sixth ) sixth +$(git rev-parse --short :/fifth ) fifth EOF test_expect_success 'git log --no-walk=unsorted leaves list of commits as given' ' - git log --no-walk=unsorted --oneline 5d31159 804a787 394ef78 > actual && + git log --no-walk=unsorted --oneline $last_three > actual && test_cmp expect actual ' test_expect_success 'git show leaves list of commits as given' ' - git show --oneline -s 5d31159 804a787 394ef78 > actual && + git show --oneline -s $last_three > actual && test_cmp expect actual ' @@ -957,7 +959,7 @@ cat >expect <<\EOF | | | | diff --git a/reach.t b/reach.t | | new file mode 100644 -| | index 0000000..10c9591 +| | index BEFORE..AFTER | | --- /dev/null | | +++ b/reach.t | | @@ -0,0 +1 @@ @@ -980,7 +982,7 @@ cat >expect <<\EOF | | | | | | diff --git a/octopus-b.t b/octopus-b.t | | | new file mode 100644 -| | | index 0000000..d5fcad0 +| | | index BEFORE..AFTER | | | --- /dev/null | | | +++ b/octopus-b.t | | | @@ -0,0 +1 @@ @@ -996,7 +998,7 @@ cat >expect <<\EOF | | | | diff --git a/octopus-a.t b/octopus-a.t | | new file mode 100644 -| | index 0000000..11ee015 +| | index BEFORE..AFTER | | --- /dev/null | | +++ b/octopus-a.t | | @@ -0,0 +1 @@ @@ -1012,7 +1014,7 @@ cat >expect <<\EOF | | diff --git a/seventh.t b/seventh.t | new file mode 100644 -| index 0000000..9744ffc +| index BEFORE..AFTER | --- /dev/null | +++ b/seventh.t | @@ -0,0 +1 @@ @@ -1046,7 +1048,7 @@ cat >expect <<\EOF | | | | | | | | diff --git a/tangle-a b/tangle-a | | | | new file mode 100644 -| | | | index 0000000..7898192 +| | | | index BEFORE..AFTER | | | | --- /dev/null | | | | +++ b/tangle-a | | | | @@ -0,0 +1 @@ @@ -1068,7 +1070,7 @@ cat >expect <<\EOF | | | | | | | | diff --git a/2 b/2 | | | | new file mode 100644 -| | | | index 0000000..0cfbf08 +| | | | index BEFORE..AFTER | | | | --- /dev/null | | | | +++ b/2 | | | | @@ -0,0 +1 @@ @@ -1084,7 +1086,7 @@ cat >expect <<\EOF | | | | | | | | diff --git a/1 b/1 | | | | new file mode 100644 -| | | | index 0000000..d00491f +| | | | index BEFORE..AFTER | | | | --- /dev/null | | | | +++ b/1 | | | | @@ -0,0 +1 @@ @@ -1100,7 +1102,7 @@ cat >expect <<\EOF | | | | | | | | diff --git a/one b/one | | | | new file mode 100644 -| | | | index 0000000..9a33383 +| | | | index BEFORE..AFTER | | | | --- /dev/null | | | | +++ b/one | | | | @@ -0,0 +1 @@ @@ -1116,7 +1118,7 @@ cat >expect <<\EOF | | | | | | diff --git a/a/two b/a/two | | | deleted file mode 100644 -| | | index 9245af5..0000000 +| | | index BEFORE..AFTER | | | --- a/a/two | | | +++ /dev/null | | | @@ -1 +0,0 @@ @@ -1132,7 +1134,7 @@ cat >expect <<\EOF | | | | | | diff --git a/a/two b/a/two | | | new file mode 100644 -| | | index 0000000..9245af5 +| | | index BEFORE..AFTER | | | --- /dev/null | | | +++ b/a/two | | | @@ -0,0 +1 @@ @@ -1148,7 +1150,7 @@ cat >expect <<\EOF | | | | diff --git a/ein b/ein | | new file mode 100644 -| | index 0000000..9d7e69f +| | index BEFORE..AFTER | | --- /dev/null | | +++ b/ein | | @@ -0,0 +1 @@ @@ -1165,14 +1167,14 @@ cat >expect <<\EOF | | diff --git a/ichi b/ichi | new file mode 100644 -| index 0000000..9d7e69f +| index BEFORE..AFTER | --- /dev/null | +++ b/ichi | @@ -0,0 +1 @@ | +ichi | diff --git a/one b/one | deleted file mode 100644 -| index 9d7e69f..0000000 +| index BEFORE..AFTER | --- a/one | +++ /dev/null | @@ -1 +0,0 @@ @@ -1187,7 +1189,7 @@ cat >expect <<\EOF | 1 file changed, 1 insertion(+), 1 deletion(-) | | diff --git a/one b/one -| index 5626abf..9d7e69f 100644 +| index BEFORE..AFTER 100644 | --- a/one | +++ b/one | @@ -1 +1 @@ @@ -1204,7 +1206,7 @@ cat >expect <<\EOF diff --git a/one b/one new file mode 100644 - index 0000000..5626abf + index BEFORE..AFTER --- /dev/null +++ b/one @@ -0,0 +1 @@ @@ -1221,7 +1223,8 @@ sanitize_output () { -e 's/, 0 insertions(+)//' \ -e 's/ 1 files changed, / 1 file changed, /' \ -e 's/, 1 deletions(-)/, 1 deletion(-)/' \ - -e 's/, 1 insertions(+)/, 1 insertion(+)/' + -e 's/, 1 insertions(+)/, 1 insertion(+)/' \ + -e 's/index [0-9a-f]*\.\.[0-9a-f]*/index BEFORE..AFTER/' } test_expect_success 'log --graph with diff and stats' ' @@ -1247,7 +1250,7 @@ cat >expect <<\EOF *** | | *** | | diff --git a/reach.t b/reach.t *** | | new file mode 100644 -*** | | index 0000000..10c9591 +*** | | index BEFORE..AFTER *** | | --- /dev/null *** | | +++ b/reach.t *** | | @@ -0,0 +1 @@ @@ -1270,7 +1273,7 @@ cat >expect <<\EOF *** | | | *** | | | diff --git a/octopus-b.t b/octopus-b.t *** | | | new file mode 100644 -*** | | | index 0000000..d5fcad0 +*** | | | index BEFORE..AFTER *** | | | --- /dev/null *** | | | +++ b/octopus-b.t *** | | | @@ -0,0 +1 @@ @@ -1286,7 +1289,7 @@ cat >expect <<\EOF *** | | *** | | diff --git a/octopus-a.t b/octopus-a.t *** | | new file mode 100644 -*** | | index 0000000..11ee015 +*** | | index BEFORE..AFTER *** | | --- /dev/null *** | | +++ b/octopus-a.t *** | | @@ -0,0 +1 @@ @@ -1302,7 +1305,7 @@ cat >expect <<\EOF *** | *** | diff --git a/seventh.t b/seventh.t *** | new file mode 100644 -*** | index 0000000..9744ffc +*** | index BEFORE..AFTER *** | --- /dev/null *** | +++ b/seventh.t *** | @@ -0,0 +1 @@ @@ -1336,7 +1339,7 @@ cat >expect <<\EOF *** | | | | *** | | | | diff --git a/tangle-a b/tangle-a *** | | | | new file mode 100644 -*** | | | | index 0000000..7898192 +*** | | | | index BEFORE..AFTER *** | | | | --- /dev/null *** | | | | +++ b/tangle-a *** | | | | @@ -0,0 +1 @@ @@ -1358,7 +1361,7 @@ cat >expect <<\EOF *** | | | | *** | | | | diff --git a/2 b/2 *** | | | | new file mode 100644 -*** | | | | index 0000000..0cfbf08 +*** | | | | index BEFORE..AFTER *** | | | | --- /dev/null *** | | | | +++ b/2 *** | | | | @@ -0,0 +1 @@ @@ -1374,7 +1377,7 @@ cat >expect <<\EOF *** | | | | *** | | | | diff --git a/1 b/1 *** | | | | new file mode 100644 -*** | | | | index 0000000..d00491f +*** | | | | index BEFORE..AFTER *** | | | | --- /dev/null *** | | | | +++ b/1 *** | | | | @@ -0,0 +1 @@ @@ -1390,7 +1393,7 @@ cat >expect <<\EOF *** | | | | *** | | | | diff --git a/one b/one *** | | | | new file mode 100644 -*** | | | | index 0000000..9a33383 +*** | | | | index BEFORE..AFTER *** | | | | --- /dev/null *** | | | | +++ b/one *** | | | | @@ -0,0 +1 @@ @@ -1406,7 +1409,7 @@ cat >expect <<\EOF *** | | | *** | | | diff --git a/a/two b/a/two *** | | | deleted file mode 100644 -*** | | | index 9245af5..0000000 +*** | | | index BEFORE..AFTER *** | | | --- a/a/two *** | | | +++ /dev/null *** | | | @@ -1 +0,0 @@ @@ -1422,7 +1425,7 @@ cat >expect <<\EOF *** | | | *** | | | diff --git a/a/two b/a/two *** | | | new file mode 100644 -*** | | | index 0000000..9245af5 +*** | | | index BEFORE..AFTER *** | | | --- /dev/null *** | | | +++ b/a/two *** | | | @@ -0,0 +1 @@ @@ -1438,7 +1441,7 @@ cat >expect <<\EOF *** | | *** | | diff --git a/ein b/ein *** | | new file mode 100644 -*** | | index 0000000..9d7e69f +*** | | index BEFORE..AFTER *** | | --- /dev/null *** | | +++ b/ein *** | | @@ -0,0 +1 @@ @@ -1455,14 +1458,14 @@ cat >expect <<\EOF *** | *** | diff --git a/ichi b/ichi *** | new file mode 100644 -*** | index 0000000..9d7e69f +*** | index BEFORE..AFTER *** | --- /dev/null *** | +++ b/ichi *** | @@ -0,0 +1 @@ *** | +ichi *** | diff --git a/one b/one *** | deleted file mode 100644 -*** | index 9d7e69f..0000000 +*** | index BEFORE..AFTER *** | --- a/one *** | +++ /dev/null *** | @@ -1 +0,0 @@ @@ -1477,7 +1480,7 @@ cat >expect <<\EOF *** | 1 file changed, 1 insertion(+), 1 deletion(-) *** | *** | diff --git a/one b/one -*** | index 5626abf..9d7e69f 100644 +*** | index BEFORE..AFTER 100644 *** | --- a/one *** | +++ b/one *** | @@ -1 +1 @@ @@ -1494,7 +1497,7 @@ cat >expect <<\EOF *** *** diff --git a/one b/one *** new file mode 100644 -*** index 0000000..5626abf +*** index BEFORE..AFTER *** --- /dev/null *** +++ b/one *** @@ -0,0 +1 @@ @@ -1709,10 +1712,10 @@ test_expect_success 'set up --source tests' ' ' test_expect_success 'log --source paints branch names' ' - cat >expect <<-\EOF && - 09e12a9 source-b three - 8e393e1 source-a two - 1ac6c77 source-b one + cat >expect <<-EOF && + $(git rev-parse --short :/three) source-b three + $(git rev-parse --short :/two ) source-a two + $(git rev-parse --short :/one ) source-b one EOF git log --oneline --source source-a source-b >actual && test_cmp expect actual @@ -1720,19 +1723,19 @@ test_expect_success 'log --source paints branch names' ' test_expect_success 'log --source paints tag names' ' git tag -m tagged source-tag && - cat >expect <<-\EOF && - 09e12a9 source-tag three - 8e393e1 source-a two - 1ac6c77 source-tag one + cat >expect <<-EOF && + $(git rev-parse --short :/three) source-tag three + $(git rev-parse --short :/two ) source-a two + $(git rev-parse --short :/one ) source-tag one EOF git log --oneline --source source-tag source-a >actual && test_cmp expect actual ' test_expect_success 'log --source paints symmetric ranges' ' - cat >expect <<-\EOF && - 09e12a9 source-b three - 8e393e1 source-a two + cat >expect <<-EOF && + $(git rev-parse --short :/three) source-b three + $(git rev-parse --short :/two ) source-a two EOF git log --oneline --source source-a...source-b >actual && test_cmp expect actual From patchwork Sat Dec 21 19:49:22 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: 11307159 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B88A197C for ; Sat, 21 Dec 2019 19:50:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FCCB206B7 for ; Sat, 21 Dec 2019 19:50:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="UMzecauM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727366AbfLUTuJ (ORCPT ); Sat, 21 Dec 2019 14:50:09 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41966 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727311AbfLUTuI (ORCPT ); Sat, 21 Dec 2019 14:50:08 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id CECA7607F4; Sat, 21 Dec 2019 19:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957808; bh=1tUluqLtKGGOWKuZstGGIANvQnV5D3OR32/G3kdCD+I=; 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=UMzecauM6M9XK59s/lxSBKjHuGIpbXadY7oef44iv2Omo4byB99YlYPhh8SQSn1aU 9ptdpcg5bwTQVRPlJGGF8YEHKuYoLy57g5SoSo5ZGlC27VmAwbcT4NHlGWjc0Jqyez 1YziabXvEA9AQTgJHTnpU0nZOTeF79HjIDrEEchAep4E0bPgkOuOxEgfGgZSxAVBTX fWvKPmtfuIjXMCxjtNUCk+pqRdRXFJLd/FExWfeFaAZFG9/p8GwEGIIp8zr5OUpEjD KgQaaUPBr14prPtaaQnvP8wOPFfTrvWmd9FNnjdFLau6GsTcqX3tvJuxWyoB633CVD TrwumLkc1JRJlTb2Nx262Pm/MKEgH1A+kp5nrc/YR3PG7/7lPJyVtLKzp4V/cZVwev 9ittBsJVvNFJRuk+WsBhcAswOmcu9NtlSGiCsh2DmasYWooHLQwng1w6uH5w8iU2gk OxcNuEf7HHAbA5s+T4Z2Thdc+nd0a3ZMr+Iecvo7tEP2j3rmSqy From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 06/20] t4204: make hash size independent Date: Sat, 21 Dec 2019 19:49:22 +0000 Message-Id: <20191221194936.1346664-7-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use $OID_REGEX instead of a hard-coded regular expression. Signed-off-by: brian m. carlson --- t/t4204-patch-id.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh index 0288c17ec6..8ff8bd84c7 100755 --- a/t/t4204-patch-id.sh +++ b/t/t4204-patch-id.sh @@ -25,7 +25,7 @@ test_expect_success 'setup' ' test_expect_success 'patch-id output is well-formed' ' git log -p -1 | git patch-id >output && - grep "^[a-f0-9]\{40\} $(git rev-parse HEAD)$" output + grep "^$OID_REGEX $(git rev-parse HEAD)$" output ' #calculate patch id. Make sure output is not empty. From patchwork Sat Dec 21 19:49:23 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: 11307167 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13202159A for ; Sat, 21 Dec 2019 19:50:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD58B206B7 for ; Sat, 21 Dec 2019 19:50:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="usd7PhPr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727412AbfLUTuN (ORCPT ); Sat, 21 Dec 2019 14:50:13 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41984 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbfLUTuL (ORCPT ); Sat, 21 Dec 2019 14:50:11 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 61739607F5; Sat, 21 Dec 2019 19:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957808; bh=P9eMuEzSN5aqV0nMquA7z2VnEGmwNgMNakTVEl4JSCI=; 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=usd7PhPrpyghNZdSOkb/sLZMxkqMGIBhZW16AV9WJaB4UF0s0dfnhe6wPw4A12+PF eBBUKftOZf7h4Wv1p5hB4fNxthmdBh0EAyvC8jR6ju0uIxYiHKDH/fSxzrXFhsEh7Y eNgH0MusFuTnBCYP6ezaIybyP9YIiuyYUcODW0+d44aR0EmhKHgpZWU49I/77EVJZi dhcVdJ6Yk1Q2VYrQMmECuhqbHkORlPVKz0+/82QubAZJhYQYsOiHQLhpeTAh4UlWim urshsAGQI/VmFOSKQXtarDj3ZM8xSJFi/HC4FPwtGrC5FuTDgrvOo+ZYvINrFFDwu2 xo/BM7NSoi03U/4TWu0XO8cjVOdTAObtOfRgnUVSyT/0A/+8+WCpWmCRNSbTTHFNCE Vkq/8w9WyHPeB4SOiMpsEuv8JqG1FW79GxE/OPtsY7SUZH/hXs5FJP1xfLVlhEegOK /6LkgJBmBznT0NmqdT7A28+JaTxZA8StmvNTMiV4lzLEP7jYtTB From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 07/20] t4300: abstract away SHA-1-specific constants Date: Sat, 21 Dec 2019 19:49:23 +0000 Message-Id: <20191221194936.1346664-8-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Adjust the test so that it computes values for object IDs instead of using hard-coded hashes. Move the heredocs later in the tests so we can take advantage of computed values. Signed-off-by: brian m. carlson --- t/t4300-merge-tree.sh | 188 +++++++++++++++++++++--------------------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/t/t4300-merge-tree.sh b/t/t4300-merge-tree.sh index d87cc7d9ef..e59601e5fe 100755 --- a/t/t4300-merge-tree.sh +++ b/t/t4300-merge-tree.sh @@ -11,16 +11,16 @@ test_expect_success setup ' ' test_expect_success 'file add A, !B' ' - cat >expected <<\EXPECTED && + git reset --hard initial && + test_commit "add-a-not-b" "ONE" "AAA" && + git merge-tree initial initial add-a-not-b >actual && + cat >expected <actual && test_cmp expected actual ' @@ -41,10 +41,15 @@ test_expect_success 'file add A, B (same)' ' ' test_expect_success 'file add A, B (different)' ' - cat >expected <<\EXPECTED && + git reset --hard initial && + test_commit "add-a-b-diff-A" "ONE" "AAA" && + git reset --hard initial && + test_commit "add-a-b-diff-B" "ONE" "BBB" && + git merge-tree initial add-a-b-diff-A add-a-b-diff-B >actual && + cat >expected <>>>>>> .their EXPECTED - git reset --hard initial && - test_commit "add-a-b-diff-A" "ONE" "AAA" && - git reset --hard initial && - test_commit "add-a-b-diff-B" "ONE" "BBB" && - git merge-tree initial add-a-b-diff-A add-a-b-diff-B >actual && test_cmp expected actual ' @@ -69,18 +69,18 @@ test_expect_success 'file change A, !B' ' ' test_expect_success 'file change !A, B' ' - cat >expected <<\EXPECTED && + git reset --hard initial && + test_commit "change-not-a-b" "initial-file" "BBB" && + git merge-tree initial initial change-not-a-b >actual && + cat >expected <actual && test_cmp expected actual ' @@ -94,11 +94,16 @@ test_expect_success 'file change A, B (same)' ' ' test_expect_success 'file change A, B (different)' ' - cat >expected <<\EXPECTED && + git reset --hard initial && + test_commit "change-a-b-diff-A" "initial-file" "AAA" && + git reset --hard initial && + test_commit "change-a-b-diff-B" "initial-file" "BBB" && + git merge-tree initial change-a-b-diff-A change-a-b-diff-B >actual && + cat >expected <>>>>>> .their EXPECTED - git reset --hard initial && - test_commit "change-a-b-diff-A" "initial-file" "AAA" && - git reset --hard initial && - test_commit "change-a-b-diff-B" "initial-file" "BBB" && - git merge-tree initial change-a-b-diff-A change-a-b-diff-B >actual && test_cmp expected actual ' test_expect_success 'file change A, B (mixed)' ' - cat >expected <<\EXPECTED && -changed in both - base 100644 f4f1f998c7776568c4ff38f516d77fef9399b5a7 ONE - our 100644 af14c2c3475337c73759d561ef70b59e5c731176 ONE - their 100644 372d761493f524d44d59bd24700c3bdf914c973c ONE -@@ -7,7 +7,11 @@ - AAA - AAA - AAA -+<<<<<<< .our - BBB -+======= -+CCC -+>>>>>>> .their - AAA - AAA - AAA -EXPECTED - git reset --hard initial && test_commit "change-a-b-mix-base" "ONE" " AAA @@ -159,6 +140,26 @@ AAA" && "$(sed -e "1{s/AAA/BBB/;}" -e "10{s/AAA/CCC/;}" actual && + + cat >expected <>>>>>> .their + AAA + AAA + AAA +EXPECTED + test_cmp expected actual ' @@ -173,20 +174,20 @@ test_expect_success 'file remove A, !B' ' ' test_expect_success 'file remove !A, B' ' - cat >expected <<\EXPECTED && -removed in remote - base 100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE - our 100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE -@@ -1 +0,0 @@ --AAA -EXPECTED - git reset --hard initial && test_commit "rm-not-a-b-base" "ONE" "AAA" && git rm ONE && git commit -m "rm-not-a-b" && git tag "rm-not-a-b" && git merge-tree rm-a-not-b-base rm-a-not-b-base rm-a-not-b >actual && + cat >expected <expected <<\EXPECTED && -removed in remote - base 100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE - our 100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE -@@ -1 +0,0 @@ --BBB -EXPECTED - git reset --hard initial && test_commit "change-a-rm-b-base" "ONE" "AAA" && test_commit "change-a-rm-b-A" "ONE" "BBB" && @@ -218,16 +211,18 @@ EXPECTED git tag "change-a-rm-b-B" && git merge-tree change-a-rm-b-base change-a-rm-b-A change-a-rm-b-B \ >actual && + cat >expected <expected <<\EXPECTED && -removed in local - base 100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE - their 100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE -EXPECTED - git reset --hard initial && test_commit "rm-a-change-b-base" "ONE" "AAA" && @@ -238,6 +233,11 @@ EXPECTED test_commit "rm-a-change-b-B" "ONE" "BBB" && git merge-tree rm-a-change-b-base rm-a-change-b-A rm-a-change-b-B \ >actual && + cat >expected <expect <<-\EOF && + git reset --hard initial && + mkdir sub && + test_commit "add sub/file" "sub/file" "AAA" add-tree-a-b-A && + git reset --hard initial && + mkdir sub && + test_commit "add sub/file" "sub/file" "BBB" add-tree-a-b-B && + git merge-tree initial add-tree-a-b-A add-tree-a-b-B >actual && + cat >expect <<-EOF && added in both - our 100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file - their 100644 ba629238ca89489f2b350e196ca445e09d8bb834 sub/file + our 100644 $(git rev-parse add-tree-a-b-A:sub/file) sub/file + their 100644 $(git rev-parse add-tree-a-b-B:sub/file) sub/file @@ -1 +1,5 @@ +<<<<<<< .our AAA @@ -261,24 +268,10 @@ test_expect_success 'tree add A, B (different)' ' +BBB +>>>>>>> .their EOF - git reset --hard initial && - mkdir sub && - test_commit "add sub/file" "sub/file" "AAA" add-tree-a-b-A && - git reset --hard initial && - mkdir sub && - test_commit "add sub/file" "sub/file" "BBB" add-tree-a-b-B && - git merge-tree initial add-tree-a-b-A add-tree-a-b-B >actual && test_cmp expect actual ' test_expect_success 'tree unchanged A, removed B' ' - cat >expect <<-\EOF && - removed in remote - base 100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file - our 100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file - @@ -1 +0,0 @@ - -AAA - EOF git reset --hard initial && mkdir sub && test_commit "add sub/file" "sub/file" "AAA" tree-remove-b-initial && @@ -287,6 +280,13 @@ test_expect_success 'tree unchanged A, removed B' ' git commit -m "remove sub/file" && git tag tree-remove-b-B && git merge-tree tree-remove-b-initial tree-remove-b-initial tree-remove-b-B >actual && + cat >expect <<-EOF && + removed in remote + base 100644 $(git rev-parse tree-remove-b-initial:sub/file) sub/file + our 100644 $(git rev-parse tree-remove-b-initial:sub/file) sub/file + @@ -1 +0,0 @@ + -AAA + EOF test_cmp expect actual ' @@ -296,14 +296,14 @@ test_expect_success 'turn file to tree' ' mkdir initial-file && test_commit "turn-file-to-tree" "initial-file/ONE" "CCC" && git merge-tree initial initial turn-file-to-tree >actual && - cat >expect <<-\EOF && + cat >expect <<-EOF && added in remote - their 100644 43aa4fdec31eb92e1fdc2f0ce6ea9ddb7c32bcf7 initial-file/ONE + their 100644 $(git rev-parse turn-file-to-tree:initial-file/ONE) initial-file/ONE @@ -0,0 +1 @@ +CCC removed in remote - base 100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file - our 100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file + base 100644 $(git rev-parse initial:initial-file) initial-file + our 100644 $(git rev-parse initial:initial-file) initial-file @@ -1 +0,0 @@ -initial EOF @@ -318,14 +318,14 @@ test_expect_success 'turn tree to file' ' rm -fr dir && test_commit "make-file" "dir" "CCC" && git merge-tree add-tree add-another-tree make-file >actual && - cat >expect <<-\EOF && + cat >expect <<-EOF && removed in remote - base 100644 43d5a8ed6ef6c00ff775008633f95787d088285d dir/path - our 100644 43d5a8ed6ef6c00ff775008633f95787d088285d dir/path + base 100644 $(git rev-parse add-tree:dir/path) dir/path + our 100644 $(git rev-parse add-tree:dir/path) dir/path @@ -1 +0,0 @@ -AAA added in remote - their 100644 43aa4fdec31eb92e1fdc2f0ce6ea9ddb7c32bcf7 dir + their 100644 $(git rev-parse make-file:dir) dir @@ -0,0 +1 @@ +CCC EOF From patchwork Sat Dec 21 19:49:24 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: 11307163 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2488139A for ; Sat, 21 Dec 2019 19:50:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0747206B7 for ; Sat, 21 Dec 2019 19:50:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="Tdne4emt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727380AbfLUTuL (ORCPT ); Sat, 21 Dec 2019 14:50:11 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41988 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbfLUTuJ (ORCPT ); Sat, 21 Dec 2019 14:50:09 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 04EA660787; Sat, 21 Dec 2019 19:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957809; bh=a6HCmWXgmSxqY8mSmrSRfWUuJ7fKEpDN9ih76ul8/ew=; 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=Tdne4emtxTF3lNYOdNW3IVwBIdXsj72cdvEXaoIdRzYSZqWqgvpP00FBXutmLT6Yi iDU25CcGR+VKVhJ+jK6n8XzDcWAdKBI7WhJWBFdf8Wf236eglxAwpmfaxQhCp1TxFz 4/cJH6wzsBZ8bbHG7G0cL7cbuvwoLXcoFbzecSR558M02SSmcFtA9vzFBYeQMnA+RZ iBw1OGX50FIWbA4d+MIIwXpuHMsPXDEmm6gM3U4GAVkuMC9xp2vp9cO3Fs4IkN2RKQ g44/Eb7y1T/SSkKLxgqZQis4i7EBWpnVDbHGrXh0YMqOG5KDxgO4lkW0Np6EOlfBz8 3R0Y5Op0KHeY5v4ZKjHwcS8P3e8pSGKXAXZwyJdIBzcjoqk1VXwsoudFLBVUnd+pxc Rfv4lRYJaLtzhldI+ycfb+hQvenbUiUUruELfK+MvNa2b69wCnA4AQGBB/okbPmTiF DlIZmkIrMwWQvXVwJs4Mr3MaGk1bPV91iiuXN7dLC8FdLEURH+a From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 08/20] t5318: update for SHA-256 Date: Sat, 21 Dec 2019 19:49:24 +0000 Message-Id: <20191221194936.1346664-9-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-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 When running with SHA-256 as the hash algorithm, the hash version octet is 2 instead of 1. Pick the right value depending on the hash algorithm and use it where we look for the existing value. To ensure the test checking for invalid data passes, use 3 as the test value for an invalid hash version. Signed-off-by: brian m. carlson --- t/t5318-commit-graph.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index 3f03de6018..81cf118cb6 100755 --- a/t/t5318-commit-graph.sh +++ b/t/t5318-commit-graph.sh @@ -481,7 +481,7 @@ test_expect_success 'detect bad version' ' ' test_expect_success 'detect bad hash version' ' - corrupt_graph_and_verify $GRAPH_BYTE_HASH "\02" \ + corrupt_graph_and_verify $GRAPH_BYTE_HASH "\03" \ "hash version" ' From patchwork Sat Dec 21 19:49:25 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: 11307165 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C11FC139A for ; Sat, 21 Dec 2019 19:50:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9EDED206B7 for ; Sat, 21 Dec 2019 19:50:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="y8VJHQbt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727397AbfLUTuM (ORCPT ); Sat, 21 Dec 2019 14:50:12 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41996 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727311AbfLUTuK (ORCPT ); Sat, 21 Dec 2019 14:50:10 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 8C32D607F0; Sat, 21 Dec 2019 19:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957809; bh=ctRtF2cpQuHnjVmGoIZ146ZqSUvJVPK+ogRBQsCcJRA=; 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=y8VJHQbtYMuoT11/G7/K/7H0KqJlCgY8pIVYDj/eHUXoB9LOkj333agA61bjysp9x 1/vuUy8h1TdRs2AVZl6OUeI/UZERS5LF2L8lw/luFSxJXVQby99oiqICYug9n603xR L/ZwocUfPgqMDVxokk5vdgXb10TGh1099Wl/iGSBykxTbEVyreKK7LXdowXqwinX+D DZlSzC50U5NVzCLYmZBoAwWH6kwTiFdOzm4VNTBy6gaaoskdcTQt66kT0xgN+LCLGA z5Xh/X+ce7/uHO5xqy3gk7hvsRzUwgoElRkrDRYTBE0+vEJJHif1ee6s4ey2O08Htz wTr8SdRlvzeQeGtwdj1baywuLJunt+1fg+URRMokBEelCGKMgPgiMy1oWwRAg2vcNk gH3pIK6rT7oY42lA0DK0EHrx5MxLs0d304/QAtF8hcGUuu66LcdmM9wUBIZ7MWP5O/ yrvRVp3E8w3j4Tkw2eOHpCroUR9SkEXWL3Efl+/8WMyzPvM94kY From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 09/20] t5319: change invalid offset for SHA-256 compatibility Date: Sat, 21 Dec 2019 19:49:25 +0000 Message-Id: <20191221194936.1346664-10-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-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 When using SHA-1, the existing value of the byte we use is 0x13, so writing the byte 0x07 serves to corrupt the test and verify that we detect corruption. However, when we use SHA-256, the value at that offset is already 0x07, so our "corruption" doesn't work and the test fails to detect it. To provide a value that is truly out of range, let's use 0xff, which is not likely to be a valid value as the high byte of a two-byte offset in a multi-pack index this small. Signed-off-by: brian m. carlson --- t/t5319-multi-pack-index.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh index cd2f87be6a..464bb68e89 100755 --- a/t/t5319-multi-pack-index.sh +++ b/t/t5319-multi-pack-index.sh @@ -304,12 +304,12 @@ test_expect_success 'verify incorrect pack-int-id' ' ' test_expect_success 'verify incorrect offset' ' - corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\07" $objdir \ + corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\377" $objdir \ "incorrect object offset" ' test_expect_success 'git-fsck incorrect offset' ' - corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\07" $objdir \ + corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\377" $objdir \ "incorrect object offset" \ "git -c core.multipackindex=true fsck" ' From patchwork Sat Dec 21 19:49:26 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: 11307171 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E13F0139A for ; Sat, 21 Dec 2019 19:50:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF830206D8 for ; Sat, 21 Dec 2019 19:50:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="K3ox0sID" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727431AbfLUTuP (ORCPT ); Sat, 21 Dec 2019 14:50:15 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42000 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727367AbfLUTuL (ORCPT ); Sat, 21 Dec 2019 14:50:11 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 2837C607F3; Sat, 21 Dec 2019 19:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957810; bh=Txhv7CT376l/OBmn3gPP51anoCBfITfStdPyM+moIV0=; 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=K3ox0sIDRJ70p4KIKETaIvWqZNuphc0zl3A6ls4hbi+vfvl2eu5gfGIwJmOiwRhC+ ci1PwXWU0V0O0fAPqO3Kod/g+zIkwYKqzC7WjaOJFhMG0hoklDG7o4KwvtlSDDVnCa nPfwjDYmFEmEv/2m+ZMXOgb474N1v+W+JwABC+8tMZ/3cnvwVkvsKa3LidfIp6PCHs s1lomtZYikdSfBGslAjH9ShLfPJ6lbQHNjuSWsEaGPpwhjxa065GJ7R+qIbHQ9oNG9 ++Wph/1N5ikouglSEoGHwX6TrNfzFki66Mo0ZJIf0EQfM0/MSMdoyn9ZBelFpj6GaW 0kmN43txyHb2bosUsXKHC8vqBlzD5mMU1t0cvaI8ygHrnn8AJNjxO0E8eiEDvoCRM2 RmCxsTHe37dj1WzUF2JqixivELVt62K3S9OPTqyKllSrzWihAfHgugSO0x3ybxQszN xX+4UmkEkcLijvn8Jk/D5GdYnM9XprxGBJMtOqBABvbI9hxkhXD From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 10/20] t5319: make test work with SHA-256 Date: Sat, 21 Dec 2019 19:49:26 +0000 Message-Id: <20191221194936.1346664-11-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test corrupts various locations in a multi-pack index to test various error responses. However, these offsets differ between SHA-1 indexes and SHA-256 indexes due to differences in object length. Use test_oid to look up the correct offsets based on the algorithm. Signed-off-by: brian m. carlson --- t/t5319-multi-pack-index.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh index 464bb68e89..43a7a66c9d 100755 --- a/t/t5319-multi-pack-index.sh +++ b/t/t5319-multi-pack-index.sh @@ -28,6 +28,20 @@ midx_read_expect () { test_cmp expect actual } +test_expect_success 'setup' ' + test_oid_init && + test_oid_cache <<-EOF + idxoff sha1:2999 + idxoff sha256:3739 + + packnameoff sha1:652 + packnameoff sha256:940 + + fanoutoff sha1:1 + fanoutoff sha256:3 + EOF +' + test_expect_success 'write midx with no packs' ' test_when_finished rm -f pack/multi-pack-index && git multi-pack-index --object-dir=. write && @@ -225,7 +239,7 @@ test_expect_success 'verify bad signature' ' "multi-pack-index signature" ' -HASH_LEN=20 +HASH_LEN=$(test_oid rawsz) NUM_OBJECTS=74 MIDX_BYTE_VERSION=4 MIDX_BYTE_OID_VERSION=5 @@ -238,9 +252,9 @@ MIDX_CHUNK_LOOKUP_WIDTH=12 MIDX_OFFSET_PACKNAMES=$(($MIDX_HEADER_SIZE + \ $MIDX_NUM_CHUNKS * $MIDX_CHUNK_LOOKUP_WIDTH)) MIDX_BYTE_PACKNAME_ORDER=$(($MIDX_OFFSET_PACKNAMES + 2)) -MIDX_OFFSET_OID_FANOUT=$(($MIDX_OFFSET_PACKNAMES + 652)) +MIDX_OFFSET_OID_FANOUT=$(($MIDX_OFFSET_PACKNAMES + $(test_oid packnameoff))) MIDX_OID_FANOUT_WIDTH=4 -MIDX_BYTE_OID_FANOUT_ORDER=$((MIDX_OFFSET_OID_FANOUT + 250 * $MIDX_OID_FANOUT_WIDTH + 1)) +MIDX_BYTE_OID_FANOUT_ORDER=$((MIDX_OFFSET_OID_FANOUT + 250 * $MIDX_OID_FANOUT_WIDTH + $(test_oid fanoutoff))) MIDX_OFFSET_OID_LOOKUP=$(($MIDX_OFFSET_OID_FANOUT + 256 * $MIDX_OID_FANOUT_WIDTH)) MIDX_BYTE_OID_LOOKUP=$(($MIDX_OFFSET_OID_LOOKUP + 16 * $HASH_LEN)) MIDX_OFFSET_OBJECT_OFFSETS=$(($MIDX_OFFSET_OID_LOOKUP + $NUM_OBJECTS * $HASH_LEN)) @@ -387,7 +401,7 @@ test_expect_success 'force some 64-bit offsets with pack-objects' ' pack64=$(git pack-objects --index-version=2,0x40 objects64/pack/test-64 X-Patchwork-Id: 11307169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E30D1892 for ; Sat, 21 Dec 2019 19:50:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CD45206EF for ; Sat, 21 Dec 2019 19:50:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="JeAdZKct" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727426AbfLUTuP (ORCPT ); Sat, 21 Dec 2019 14:50:15 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42008 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbfLUTuL (ORCPT ); Sat, 21 Dec 2019 14:50:11 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id AB62B60787; Sat, 21 Dec 2019 19:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957811; bh=Ij8AsTxn8UmBMqPdKSFBnCn64fhTnfqnpgfTbXyoAnE=; 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=JeAdZKctHavgE+upwy+vdUsyDPuE/75+szbPQUP/5lrlOsukIoiixBWD+0rGvXyv3 1+YabQ82SiAX5ttoqnqqQAPEhLVapkrJNHj0qqMeFTizIchrRzJYqGcYTeL0mWRZqT r25uRjogliAa1hNM+gAwVwzQx2iqCizsM8lFPNReTjEg7mON+L9jAoFi07i9PZMuHh 9QHV0T6lyIxh7ZNS8EcCR3AVX97qkJlIwuK/8yn81qQxWssv4lSq0miySzwrcBl5q8 +PbtK341y+/MR8viRTCtzvxqMzOqFpj25SlB1XRsyC4GcunqQg+c4hDzAuswkbyfzH G62gJvFUoETHhfHOQxxHFTOBh3DfsRMX1HQsAUSyA74KcU6hclWokm/M+w/h/xX3C2 0oyteGF62aLcCBf0cSvomjbokXnXYQcB30WIlExSoweoI/KRm1A2z6Acs0HJPJSuqM TvHBhXk2vqAIslBJaK9YV9xg4AOlIpp5MKbEBJ9DHISUhKsULdw From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 11/20] t5324: make hash size independent Date: Sat, 21 Dec 2019 19:49:27 +0000 Message-Id: <20191221194936.1346664-12-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-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 There are some offsets in the commit graph files used to corrupt data. Compute these offsets for both SHA-1 and SHA-256 so that the test works with either. Signed-off-by: brian m. carlson --- t/t5324-split-commit-graph.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh index c24823431f..53b2e6b455 100755 --- a/t/t5324-split-commit-graph.sh +++ b/t/t5324-split-commit-graph.sh @@ -11,7 +11,14 @@ test_expect_success 'setup repo' ' git config gc.writeCommitGraph false && infodir=".git/objects/info" && graphdir="$infodir/commit-graphs" && - test_oid_init + test_oid_init && + test_oid_cache <<-EOM + shallow sha1:1760 + shallow sha256:2064 + + base sha1:1376 + base sha256:1496 + EOM ' graph_read_expect() { @@ -248,7 +255,7 @@ test_expect_success 'verify hashes along chain, even in shallow' ' cd verify && git commit-graph verify && base_file=$graphdir/graph-$(head -n 1 $graphdir/commit-graph-chain).graph && - corrupt_file "$base_file" 1760 "\01" && + corrupt_file "$base_file" $(test_oid shallow) "\01" && test_must_fail git commit-graph verify --shallow 2>test_err && grep -v "^+" test_err >err && test_i18ngrep "incorrect checksum" err @@ -275,7 +282,7 @@ test_expect_success 'warn on base graph chunk incorrect' ' cd base-chunk && git commit-graph verify && base_file=$graphdir/graph-$(tail -n 1 $graphdir/commit-graph-chain).graph && - corrupt_file "$base_file" 1376 "\01" && + corrupt_file "$base_file" $(test_oid base) "\01" && git commit-graph verify --shallow 2>test_err && grep -v "^+" test_err >err && test_i18ngrep "commit-graph chain does not match" err From patchwork Sat Dec 21 19:49:28 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: 11307179 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F963139A for ; Sat, 21 Dec 2019 19:50:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1ED7206EC for ; Sat, 21 Dec 2019 19:50:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="h0tZjYmM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727442AbfLUTuR (ORCPT ); Sat, 21 Dec 2019 14:50:17 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42000 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727384AbfLUTuM (ORCPT ); Sat, 21 Dec 2019 14:50:12 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 3A8A7607F0; Sat, 21 Dec 2019 19:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957811; bh=9yGHYf1/L7NFmFhBKJ623Nl1M3G4N44K42o4WNeBSJo=; 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=h0tZjYmMgzVFXD0lZJ2ZfVPrYPCON913vofb29Q3Q8RUX2QM86QyQX/Bn+iv4d5Ol d2vjb0J4tmHdp+NKS1ys+oGEx/XNGR7Eygu6d6bpY0S9WPc8EHSxdcqGmqsbuwuC+v /W90zsOH5SP0p2iPKWRuMTvZOPK+5JvItGV13bC2xGBGXvCOr+vo0XX9NMYtAfEaJn 4SoUcmwRxBaoYrMr60WvmRr06s7osjPiNp/ZyOUaMFhBVH4gIB/SssenL0SIBG1EJP EsvW5A0h+lKCk4LzboPQmn+reDKjn2xCBOKbRrTiP49gN8eQOopPDJXYcaMnL5lvAZ Xk3lIkMet9gJWnvs20YYqcNrwXMJ5XzIbcGkwrFRHpXNa11pUMNS8yh7v4bfjppvka QJRgT3Gr4NRi1Arl10GC12pQR6B12D88GebLWtUCzbvgNUgZVAeZoq4U2i5KYb1JIp 1peH+ZHANL2rTI4XABYx5k+VRwePLqMiBL+NeOBQJSj0dmAenff From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 12/20] t5504: make hash algorithm independent Date: Sat, 21 Dec 2019 19:49:28 +0000 Message-Id: <20191221194936.1346664-13-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Instead of hard-coding invalid object IDs in this test, use test_oid to look up ones of the appropriate length. Signed-off-by: brian m. carlson --- t/t5504-fetch-receive-strict.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh index fdfe179b11..645b4c78d3 100755 --- a/t/t5504-fetch-receive-strict.sh +++ b/t/t5504-fetch-receive-strict.sh @@ -4,6 +4,7 @@ test_description='fetch/receive strict mode' . ./test-lib.sh test_expect_success 'setup and inject "corrupt or missing" object' ' + test_oid_init && echo hello >greetings && git add greetings && git commit -m greetings && @@ -144,11 +145,11 @@ test_expect_success 'fsck with no skipList input' ' test_expect_success 'setup sorted and unsorted skipLists' ' cat >SKIP.unsorted <<-EOF && - 0000000000000000000000000000000000000004 - 0000000000000000000000000000000000000002 + $(test_oid 004) + $(test_oid 002) $commit - 0000000000000000000000000000000000000001 - 0000000000000000000000000000000000000003 + $(test_oid 001) + $(test_oid 003) EOF sort SKIP.unsorted >SKIP.sorted ' @@ -172,14 +173,14 @@ test_expect_success 'fsck with invalid or bogus skipList input' ' test_expect_success 'fsck with other accepted skipList input (comments & empty lines)' ' cat >SKIP.with-comment <<-EOF && # Some bad commit - 0000000000000000000000000000000000000001 + $(test_oid 001) EOF test_must_fail git -c fsck.skipList=SKIP.with-comment fsck 2>err-with-comment && test_i18ngrep "missingEmail" err-with-comment && cat >SKIP.with-empty-line <<-EOF && - 0000000000000000000000000000000000000001 + $(test_oid 001) - 0000000000000000000000000000000000000002 + $(test_oid 002) EOF test_must_fail git -c fsck.skipList=SKIP.with-empty-line fsck 2>err-with-empty-line && test_i18ngrep "missingEmail" err-with-empty-line @@ -204,7 +205,7 @@ test_expect_success 'fsck with exhaustive accepted skipList input (various types echo " # Comment after whitespace" >>SKIP.exhaustive && echo "$commit # Our bad commit (with leading whitespace and trailing comment)" >>SKIP.exhaustive && echo "# Some bad commit (leading whitespace)" >>SKIP.exhaustive && - echo " 0000000000000000000000000000000000000001" >>SKIP.exhaustive && + echo " $(test_oid 001)" >>SKIP.exhaustive && git -c fsck.skipList=SKIP.exhaustive fsck 2>err && test_must_be_empty err ' From patchwork Sat Dec 21 19:49:29 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: 11307173 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6565D159A for ; Sat, 21 Dec 2019 19:50:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44AE6206EC for ; Sat, 21 Dec 2019 19:50:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="WYP/d3Z3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727437AbfLUTuP (ORCPT ); Sat, 21 Dec 2019 14:50:15 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42008 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727395AbfLUTuN (ORCPT ); Sat, 21 Dec 2019 14:50:13 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id B92C1607F3; Sat, 21 Dec 2019 19:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957812; bh=V57brEwgq17IQ/MqeNuAMkk9mMQ5p0CUxAgofrzrDjU=; 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=WYP/d3Z3ciaubR5MgPO1QAN87foJkVOLosnMqIj49Ve1p51ok8KngHnYG0+xwRMsG JdQKlob2D09Pf7/PFcQ8+SqqGnLqDqNRATwGra8VjdHJQ+BHyx2TPShr1mpbjQwtDM cwhn57mZcKbVZbNLMVFbbCegVMNM9LaUMMDsi+ToSKG3NulzWoto/Zr8d/iKa/0lZX PfujKh0OgrU/k0Ecl3EyAcTUiX2Cvr9saSLfRXMwMve2PmgsnrDXUNwBMv5ZM18u6q c7PKSPiWCpBL+dLyQsoGATo/gCyUrRGsJWCZAdIiAMuKrAERAm0WlGdFotiH+xO9vr NSl7J0g3qFKfJE7OEKtKu6exsA+9LkUKeVwLFiA/KYfSzgrDg+LMkMoLxFXDJqaLIs x8BCrHBLatRyJpqM41tG7WlYhQ2VCQhJjxeTC1dyltjHvi6SALXbQF8fGD+TrGQeM0 Vi/o/ZA0kEW8/tTWSg6wBTMjXbizNDwOeAGxZnHZa1+uaKG9VoC From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 13/20] t5510: make hash size independent Date: Sat, 21 Dec 2019 19:49:29 +0000 Message-Id: <20191221194936.1346664-14-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use $OID_REGEX instead of hard-coding 40-based regular expressions. Change invocations of cut with a hard-coded constant to split using a delimiter instead. Signed-off-by: brian m. carlson --- t/t5510-fetch.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 4b60282689..2ceae14164 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -11,7 +11,7 @@ D=$(pwd) test_bundle_object_count () { git verify-pack -v "$1" >verify.out && - test "$2" = $(grep '^[0-9a-f]\{40\} ' verify.out | wc -l) + test "$2" = $(grep "^$OID_REGEX " verify.out | wc -l) } convert_bundle_to_pack () { @@ -261,9 +261,10 @@ test_expect_success 'create bundle 1' ' ' test_expect_success 'header of bundle looks right' ' + head -n 4 "$D"/bundle1 && head -n 1 "$D"/bundle1 | grep "^#" && - head -n 2 "$D"/bundle1 | grep "^-[0-9a-f]\{40\} " && - head -n 3 "$D"/bundle1 | grep "^[0-9a-f]\{40\} " && + head -n 2 "$D"/bundle1 | grep "^-$OID_REGEX " && + head -n 3 "$D"/bundle1 | grep "^$OID_REGEX " && head -n 4 "$D"/bundle1 | grep "^$" ' @@ -289,7 +290,7 @@ test_expect_success 'bundle 1 has only 3 files ' ' test_expect_success 'unbundle 2' ' cd "$D/bundle" && git fetch ../bundle2 master:master && - test "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)" + test "tip" = "$(git log -1 --pretty=oneline master | cut -d" " -f2)" ' test_expect_success 'bundle does not prerequisite objects' ' From patchwork Sat Dec 21 19:49:30 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: 11307175 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1AFB4139A for ; Sat, 21 Dec 2019 19:50:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE14D206EC for ; Sat, 21 Dec 2019 19:50:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="E8myIs2F" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727440AbfLUTuQ (ORCPT ); Sat, 21 Dec 2019 14:50:16 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42024 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727407AbfLUTuN (ORCPT ); Sat, 21 Dec 2019 14:50:13 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 44DF0607F5; Sat, 21 Dec 2019 19:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957812; bh=KzLh50KhxrNY0zRCl+KV38C88B3ae2G6UJUI2kUSEYY=; 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=E8myIs2FKipLa6xQJBE+HmudsRFj+195xaGdkTz+xX6IAzZjmSVE/2NwFXbmM7x2q yx+/qbisj24hSe5oZwkkULVY+AM42I8vY7bF8aErXYu2KGjLu1VIO6Sz5OS7T3k4v6 9d6CTNkAvnlLaqpVyByi4jTPcm7UBe80RtCCcWeSeDyqb+PTQNXMb5UoL3ZOjL5ZaT gkUTl9p7zqC6eD8SkmwxMjtedG7aY2cOIcVJMA6vAo1DVaAkQjQaw0ippFEKylPN6H Cl7fthHKppjbvlXmGQUq/ZivKO7jVV61iCK9f24hrJH2KJ2eN3aqERHMvaDhTNffFX 6aGppPC3d6w1KKAk2g8ACn/LbrC15Xp5REjcU3s07uQ6IFZqSbhnoyfVaZ8HNLyz08 3PT8rMeueONO9NTZZw7BG1rTvyZyzcufQCDsMCuZmt0+8PMH3K7BA/nKJRYK343NxQ m67eQjsZFEN0qfJVaNyekczpc+uzLnfG81sPT9Q86JwHH86iF1Q From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 14/20] t5512: abstract away SHA-1-specific constants Date: Sat, 21 Dec 2019 19:49:30 +0000 Message-Id: <20191221194936.1346664-15-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t5512-ls-remote.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index d7b9f9078f..62152bad1d 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -230,9 +230,10 @@ test_expect_success 'ls-remote --symref' ' ' test_expect_success 'ls-remote with filtered symref (refname)' ' - cat >expect <<-\EOF && + rev=$(git rev-parse HEAD) && + cat >expect <<-EOF && ref: refs/heads/master HEAD - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a HEAD + $rev HEAD EOF # Protocol v2 supports sending symrefs for refs other than HEAD, so use # protocol v0 here. @@ -242,10 +243,10 @@ test_expect_success 'ls-remote with filtered symref (refname)' ' test_expect_failure 'ls-remote with filtered symref (--heads)' ' git symbolic-ref refs/heads/foo refs/tags/mark && - cat >expect <<-\EOF && + cat >expect <<-EOF && ref: refs/tags/mark refs/heads/foo - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master + $rev refs/heads/foo + $rev refs/heads/master EOF # Protocol v2 supports sending symrefs for refs other than HEAD, so use # protocol v0 here. @@ -254,9 +255,9 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' ' ' test_expect_success 'ls-remote --symref omits filtered-out matches' ' - cat >expect <<-\EOF && - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master + cat >expect <<-EOF && + $rev refs/heads/foo + $rev refs/heads/master EOF # Protocol v2 supports sending symrefs for refs other than HEAD, so use # protocol v0 here. From patchwork Sat Dec 21 19:49:31 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: 11307181 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3919C14B7 for ; Sat, 21 Dec 2019 19:50:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18534206EC for ; Sat, 21 Dec 2019 19:50:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="FA4Bp0QY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727454AbfLUTuU (ORCPT ); Sat, 21 Dec 2019 14:50:20 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42028 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727416AbfLUTuP (ORCPT ); Sat, 21 Dec 2019 14:50:15 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id BF5F6607F6; Sat, 21 Dec 2019 19:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957813; bh=Lkm4f1zvcKX1E8taS2hvrebseUA1x4Fu8PyrMGBqHyE=; 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=FA4Bp0QYwxfNF0s/ijcTJNaXQbpHlRJw+vAutU5E8hved3w9lA0bRCknV7NlARk3C 0qG97bZ9X/HrlFijGNBSda1tWAoY8DdPloHb2gCozQ9U3ytW62o7MmggjwuhnETs2L 9iwZfuITdz2j6lX3+3WNJAYWLZIC7NRVKtQdbYBO4RCZUqmuN2zhOZibRAI4JLIs8S U/0U/lS85q45071FQ6BgmUQ3L57Ueti0MHxEmlPiXTXm7QhdZMDY37gENgFQDOKXy5 v9dCc9+AxO6+I4Mmd8Qjrd0DmK7yiRsTYfj0HjiNKkzivC8prDSoRBg82F2ezFqTLE 9y3dQNaOLNnOw1IG4+3FdaF9xJ+4gmpNx5KTN1BHX2TzTu7tylWcnQu2HJo6A/twCR qs8f+c7uFk6+EqWR33MNn+zqs8V3FQsQRCFYITs4KrBkDJmx8APvQejzdsZYI0r3+c DUo+n95ZHXBfg8dtKSyjUjUCRFBsALSXESTsRpNaxOLWGxp7DBn From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 15/20] t5530: compute results based on object length Date: Sat, 21 Dec 2019 19:49:31 +0000 Message-Id: <20191221194936.1346664-16-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Compute the various pkt-line values based on the length of the object IDs in use. Signed-off-by: brian m. carlson --- t/t5530-upload-pack-error.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh index a1d3031d40..4ce9a9f704 100755 --- a/t/t5530-upload-pack-error.sh +++ b/t/t5530-upload-pack-error.sh @@ -14,7 +14,7 @@ corrupt_repo () { } test_expect_success 'setup and corrupt repository' ' - + test_oid_init && echo file >file && git add file && git rev-parse :file && @@ -31,9 +31,10 @@ test_expect_success 'fsck fails' ' ' test_expect_success 'upload-pack fails due to error in pack-objects packing' ' - - printf "0032want %s\n00000009done\n0000" \ - $(git rev-parse HEAD) >input && + head=$(git rev-parse HEAD) && + hexsz=$(test_oid hexsz) && + printf "%04xwant %s\n00000009done\n0000" \ + $(($hexsz + 10)) $head >input && test_must_fail git upload-pack . /dev/null 2>output.err && test_i18ngrep "unable to read" output.err && test_i18ngrep "pack-objects died" output.err @@ -51,16 +52,17 @@ test_expect_success 'fsck fails' ' ' test_expect_success 'upload-pack fails due to error in rev-list' ' - printf "0032want %s\n0034shallow %s00000009done\n0000" \ - $(git rev-parse HEAD) $(git rev-parse HEAD^) >input && + printf "%04xwant %s\n%04xshallow %s00000009done\n0000" \ + $(($hexsz + 10)) $(git rev-parse HEAD) \ + $(($hexsz + 12)) $(git rev-parse HEAD^) >input && test_must_fail git upload-pack . /dev/null 2>output.err && grep "bad tree object" output.err ' test_expect_success 'upload-pack fails due to bad want (no object)' ' - printf "0045want %s multi_ack_detailed\n00000009done\n0000" \ - "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" >input && + printf "%04xwant %s multi_ack_detailed\n00000009done\n0000" \ + $(($hexsz + 29)) $(test_oid deadbeef) >input && test_must_fail git upload-pack . output 2>output.err && grep "not our ref" output.err && grep "ERR" output && @@ -70,8 +72,8 @@ test_expect_success 'upload-pack fails due to bad want (no object)' ' test_expect_success 'upload-pack fails due to bad want (not tip)' ' oid=$(echo an object we have | git hash-object -w --stdin) && - printf "0045want %s multi_ack_detailed\n00000009done\n0000" \ - "$oid" >input && + printf "%04xwant %s multi_ack_detailed\n00000009done\n0000" \ + $(($hexsz + 29)) "$oid" >input && test_must_fail git upload-pack . output 2>output.err && grep "not our ref" output.err && grep "ERR" output && @@ -80,8 +82,8 @@ test_expect_success 'upload-pack fails due to bad want (not tip)' ' test_expect_success 'upload-pack fails due to error in pack-objects enumeration' ' - printf "0032want %s\n00000009done\n0000" \ - $(git rev-parse HEAD) >input && + printf "%04xwant %s\n00000009done\n0000" \ + $((hexsz + 10)) $(git rev-parse HEAD) >input && test_must_fail git upload-pack . /dev/null 2>output.err && grep "bad tree object" output.err && grep "pack-objects died" output.err From patchwork Sat Dec 21 19:49:32 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: 11307189 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BA3B159A for ; Sat, 21 Dec 2019 19:50:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A07B206EC for ; Sat, 21 Dec 2019 19:50:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="cy10K8iA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727474AbfLUTu1 (ORCPT ); Sat, 21 Dec 2019 14:50:27 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42036 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727417AbfLUTuO (ORCPT ); Sat, 21 Dec 2019 14:50:14 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 45CCF60787; Sat, 21 Dec 2019 19:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957813; bh=myXE14f++BnO4FaXiEwV70mCZv/vJ0A2tsrmInH+uYw=; 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=cy10K8iAJ7SuSvjzBwsfu9Bv9XA7RdV3sBGy3l4+A+WQaiJ8Y+8XHVzYGfh8dG/y8 Q1rIeb7Iyi6o8RmXZvUNk0SfMK+6ROnUukXNavkl4h1Hvk5kakRSYG5QpMTvaDVUBw xkGFXFAgfHmq4BuOvxEuJYNgiUDAYN5gGlOihj/yiDnAHxgBeZIDAndiO76WY4eA5j fH7Pn2+f08JXjGGTFbtqTvC2hkuHnR/le+nII4OmORYR9goAefC4YcJB7H4UQPVPpU 5dveWc+LUQUardGzuwBe/Okyv/lFo6xsSma6aEzN/ykX/DYCrV+PYDAWw1U3n/67IQ LUQcd2hb88akuDPOfvpwPgl3Q2F2JejEYo9Z1ORalwaP65lmqdsIHbbVwD9012RKnA Ao9buomjmqho6DCnn9bPXXlnkky6Bm6K10YchkKQH+jDI0Fyg/jbAykFF4s64wEuQk rGYuKWtnuYZeTM8KlkXB2umRobuawd7dbeydhpD0f2uWAIBsi6q From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 16/20] t5537: make hash size independent Date: Sat, 21 Dec 2019 19:49:32 +0000 Message-Id: <20191221194936.1346664-17-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test modifies a pkt-line stream with sed to change a line with "shallow" to "unshallow". However, this modification is dependent on the size of the hash in use; with SHA-256, the pkt-line length is different, leading to the sed command having no effect. Use test_oid_cache to specify the correct values for each hash so that the test continues to work. Signed-off-by: brian m. carlson --- t/t5537-fetch-shallow.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh index 97a67728ca..9e16512fe3 100755 --- a/t/t5537-fetch-shallow.sh +++ b/t/t5537-fetch-shallow.sh @@ -15,7 +15,11 @@ test_expect_success 'setup' ' commit 2 && commit 3 && commit 4 && - git config --global transfer.fsckObjects true + git config --global transfer.fsckObjects true && + test_oid_cache <<-EOF + sed sha1:s/0034shallow %s/0036unshallow %s/ + sed sha256:s/004cshallow %s/004eunshallow %s/ + EOF ' test_expect_success 'setup shallow clone' ' @@ -239,7 +243,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f # with an empty packfile. This is done by refetching with a shorter # depth (to ensure that the packfile is empty), and overwriting the # shallow line in the response with the unshallow line we want. - printf "s/0034shallow %s/0036unshallow %s/" \ + printf "$(test_oid sed)" \ "$(git -C "$REPO" rev-parse HEAD)" \ "$(git -C "$REPO" rev-parse HEAD^)" \ >"$HTTPD_ROOT_PATH/one-time-sed" && From patchwork Sat Dec 21 19:49: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: 11307177 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D144139A for ; Sat, 21 Dec 2019 19:50:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 42500206EC for ; Sat, 21 Dec 2019 19:50:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="g+Kuqt6M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbfLUTuS (ORCPT ); Sat, 21 Dec 2019 14:50:18 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42040 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727419AbfLUTuP (ORCPT ); Sat, 21 Dec 2019 14:50:15 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id C2388607F7; Sat, 21 Dec 2019 19:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957814; bh=CE8W+hbzxW69lNpuuAEEZbZMto24yBepJwkH88NGSiQ=; 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=g+Kuqt6M0/bj2b6hMZAmWkRBVDLg5cT5lFqUirZveybDkh49jnvvIU4d8ZF99qMad /MReUEbFaYQju+Y3ibT3FrR8uErp1QNv/3mBgbHhT7r/97SzuHlTIAMh2I3qaFtL5t y55W9DIhCb3bi75Hy0G21bOnd9tisyRhgm5/PnCriY2gXIMst9L0+X2l7xW4DhE6hY GhXYp4JEgXngPQToc6ngwveFPcRrffW+qVxBLuLyg7BRc1N77PEq364SXV4wXiF/lZ afLXD8vQeN4V43S0dI4cfKE3puLaA9EGZ2/TFuGM+4H34JEiu0t8drpqRH7aUagDII Vr6pddIgAb7/xSNjMOGEDL8Mi6ej4fyrEdn7K/w/yapAI0sD/Cvp7f4uLkPe0j/VUa X3EEPBulWltJaC+CFqSNSrfi3zSSR8PkNfcz7amq4VOlh8x5RN2HVxfOOny1zQyY9j O2JY6EZMVn3b8JLTk4S1FiORuXWJk/zHdowHobl0TfpxlI+5dUK From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 17/20] t5540: make hash size independent Date: Sat, 21 Dec 2019 19:49:33 +0000 Message-Id: <20191221194936.1346664-18-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use regex values based on $OID_REGEX instead of hard-coding them based on expected object ID lengths. Signed-off-by: brian m. carlson --- t/t5540-http-push-webdav.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh index a094fd5e71..d476c33509 100755 --- a/t/t5540-http-push-webdav.sh +++ b/t/t5540-http-push-webdav.sh @@ -134,15 +134,13 @@ test_expect_success 'MKCOL sends directory names with trailing slashes' ' x1="[0-9a-f]" x2="$x1$x1" -x5="$x1$x1$x1$x1$x1" -x38="$x5$x5$x5$x5$x5$x5$x5$x1$x1$x1" -x40="$x38$x2" +xtrunc=$(echo $OID_REGEX | sed -e "s/\[0-9a-f\]\[0-9a-f\]//") test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' ' sed \ -e "s/PUT /OP /" \ -e "s/MOVE /OP /" \ - -e "s|/objects/$x2/${x38}_$x40|WANTED_PATH_REQUEST|" \ + -e "s|/objects/$x2/${xtrunc}_$OID_REGEX|WANTED_PATH_REQUEST|" \ "$HTTPD_ROOT_PATH"/access.log | grep -e "\"OP .*WANTED_PATH_REQUEST HTTP/[.0-9]*\" 20[0-9] " From patchwork Sat Dec 21 19:49: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: 11307185 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E497F139A for ; Sat, 21 Dec 2019 19:50:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B7DB0206D8 for ; Sat, 21 Dec 2019 19:50:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="X3Pk7S2z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727471AbfLUTuY (ORCPT ); Sat, 21 Dec 2019 14:50:24 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42024 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727423AbfLUTuP (ORCPT ); Sat, 21 Dec 2019 14:50:15 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 4A842607F4; Sat, 21 Dec 2019 19:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957814; bh=HgyeaCjz3Dw7PsQtjf2ulgT3KPniZUyIqId4U0cUyf0=; 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=X3Pk7S2zTwzPCk4YuNYalmasqOfqOEvJCH4Ga6f4iQhu9NSXCX2GF92eTdbwwEw5R 5oFJ15ArGmLSTKY6q9S3pxi4/b0yO0RWPa2XLkdf+BJaYMjGJIjZCHtsljOd8UOte0 H1nd3lpcIReaFcnEp36X4Edm3WBL04JU7pQKLuXX54hvrQpdP4Eb+6xPK2heD+36Zd mZMMMsDwRXwFVQRYSBUPusD0c8CJAGyV9ibsG3JGDl0T7uI1vWZMAbS+hnuiW0LU8L e2NusZ6khaEjXqv8UsIkSl5OY2+zyQITTs1zX3KQWfDJRkeBieqUuQMqQ5xlVV21dw CD+KCKFV+BU9EMmgzjJ4F7h1xPYfk502Y0epMv22Fw1s8b3yB8VmZ+NavItAoXbT4B LnFTc935bq0+Ih2BI1i5gE07KXYe54YtA6Cj9Q+W5XRyIksca+xezixNrNClXI/c58 50kH10FWlYdr0XHKPt1zIlG5cNHzl1Bg7Zb+r7POXd6Kxy6DBKW From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 18/20] t5562: use $ZERO_OID Date: Sat, 21 Dec 2019 19:49:34 +0000 Message-Id: <20191221194936.1346664-19-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test uses $_z40 to express an all-zeros object ID, which doesn't work for SHA-256. Use $ZERO_OID instead, which is the right size for all hash values. Signed-off-by: brian m. carlson --- t/t5562-http-backend-content-length.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh index f0f425b2cf..4a110b307e 100755 --- a/t/t5562-http-backend-content-length.sh +++ b/t/t5562-http-backend-content-length.sh @@ -59,7 +59,7 @@ test_expect_success 'setup' ' printf done | packetize >>fetch_body && test_copy_bytes 10 fetch_body.trunc && hash_next=$(git commit-tree -p HEAD -m next HEAD^{tree}) && - printf "%s %s refs/heads/newbranch\\0report-status\\n" "$_z40" "$hash_next" | packetize >push_body && + printf "%s %s refs/heads/newbranch\\0report-status\\n" "$ZERO_OID" "$hash_next" | packetize >push_body && printf 0000 >>push_body && echo "$hash_next" | git pack-objects --stdout >>push_body && test_copy_bytes 10 push_body.trunc && From patchwork Sat Dec 21 19:49: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: 11307183 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AF6E14B7 for ; Sat, 21 Dec 2019 19:50:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FFCD206EC for ; Sat, 21 Dec 2019 19:50:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="kR+Z7rOq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727459AbfLUTuW (ORCPT ); Sat, 21 Dec 2019 14:50:22 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42000 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727428AbfLUTuP (ORCPT ); Sat, 21 Dec 2019 14:50:15 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id C55ED607F3; Sat, 21 Dec 2019 19:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957815; bh=o9qSVhnSJTkcJlYalEm9XG4el8iSPbIeRWtV3YG5L50=; 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=kR+Z7rOqG/duaWaMhJZjU9RFPFE1ABrHACCEI0JwIa/nDoiaspp51BEalcOl/81WJ or4Jv+aX2jc7QixwR6AatXqDnKZZjhyac59mdrINN6FBP2deRmPJscSmWjrjt0CGYj /sgY17oDNtnzVXGKeKgsloEW6xpEpREZveULVk4XpF4TlPBeZLU3jVq3AA47rK9oB8 VsdJ1ZJlo8wGUIh4zLXfEY4F4Qqq7+UhjbW9/cCxUDMqzWnUqMycDOCJYrwIsPmSaV tZmwpF7QhSl0gtAxeuPVUKTY9GxncpnUe1YAknyj5b8eSeoe1sF9dilOqS7GTNXrKI VghvYR+FTtqBaJirl8cv+qViZvZgYrMyALmYFxoNgAi3ggoOwEnVPpLyShFsRI2aHS i3zb253eXkQ1skkHOJz3wyy/JPqfaKy9nwJHJrPidmar2ywUqHOMQL5BpETHMBImp/ p7tXaGJpXYL28Orp4gLgmgu6rtkGSyL+8zILt53SyndHDFJi4uW From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 19/20] t5601: switch into repository to hash object Date: Sat, 21 Dec 2019 19:49:35 +0000 Message-Id: <20191221194936.1346664-20-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test performs a clone from outside any repository. Consequently, the hash algorithm used defaults to SHA-1. When the test is running with SHA-256, this results in an object ID that is not usable by the rest of the test. In order to ensure that we provide a usable value, switch into the source repository before hashing. Signed-off-by: brian m. carlson --- t/t5601-clone.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index ad8c41176e..84ea2a3eb7 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -635,10 +635,10 @@ partial_clone_server () { rm -rf "$SERVER" client && test_create_repo "$SERVER" && test_commit -C "$SERVER" one && - HASH1=$(git hash-object "$SERVER/one.t") && + HASH1=$(git -C "$SERVER" hash-object one.t) && git -C "$SERVER" revert HEAD && test_commit -C "$SERVER" two && - HASH2=$(git hash-object "$SERVER/two.t") && + HASH2=$(git -C "$SERVER" hash-object two.t) && test_config -C "$SERVER" uploadpack.allowfilter 1 && test_config -C "$SERVER" uploadpack.allowanysha1inwant 1 } From patchwork Sat Dec 21 19:49: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: 11307187 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0205139A for ; Sat, 21 Dec 2019 19:50:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B56AF206EC for ; Sat, 21 Dec 2019 19:50:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="Hkg5SEgz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727467AbfLUTuX (ORCPT ); Sat, 21 Dec 2019 14:50:23 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:42008 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727432AbfLUTuQ (ORCPT ); Sat, 21 Dec 2019 14:50:16 -0500 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 4B626607F0; Sat, 21 Dec 2019 19:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1576957815; bh=qY0ZHloioPbDruu92dopk+ecUSiLkjlZdzJYZz37vOc=; 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=Hkg5SEgzfXsp1qegN3/ssmhB6anoHsVfhXjK9SkpAr3J9dyWaeREP6TVAh7IMavFF C94FZkkhuip1pIvqlBJM6OvrDYTUJVZducyJb/NpBMv9Fe/G/5O6iq5Hnrpsx4oMY6 W+ls2jI2wjTMDxHmznp9dPuDDLDPtxheq22nekP5aSAWcvjqAxofLn/5y0C6niecfU 0QMuBTNjwJoSSms2IUMro8Rd+/qb6i/aXS/eU0Ywut+OXzoJppdMhxoG304vKFpEq/ Hc6Ee2x4vQcj5WlTtydCfJz+bi4hcmnudbJFFnvgJkdB+f64VVvqz+aEKsr05LBjwN XkUYfeqB3l5iVCKf7WM8rfEeKVoypsvP3uoYO5Osqk3gLtKO8mdsYNmCcVLhzNul1b t1opc4yaUIaPOecNyHokEpZRta4BK8D+2+arhBEyxC/bPtPRJWvhE7puLK9/RiXNxs G9V79idZMQaHU/GYFNqujiDMQHDt2a7/Fo05GBcUaYPQo/m7F86 From: "brian m. carlson" To: Cc: Derrick Stolee , Junio C Hamano Subject: [PATCH 20/20] t5604: make hash independent Date: Sat, 21 Dec 2019 19:49:36 +0000 Message-Id: <20191221194936.1346664-21-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.24.1.658.g99f4b37f93 In-Reply-To: <20191221194936.1346664-1-sandals@crustytoothpaste.net> References: <20191221194936.1346664-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org To make our values hash independent, we turn the directory of the object into "Y" and the file name into "Z" after having sorted items by their name. However, when using SHA-256, one of our file names begins with an "a" character, which means it sorts into the wrong place in the list, causing the test to fail. Since we don't care about the order of these items, just sort them after stripping actual hash contents, which means they'll work with any hash algorithm. Signed-off-by: brian m. carlson --- t/t5604-clone-reference.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh index 4894237ab8..0c74b4e21a 100755 --- a/t/t5604-clone-reference.sh +++ b/t/t5604-clone-reference.sh @@ -326,15 +326,16 @@ test_expect_success SYMLINKS 'clone repo with symlinked or unknown files at obje for raw in $(ls T*.raw) do sed -e "s!/../!/Y/!; s![0-9a-f]\{38,\}!Z!" -e "/commit-graph/d" \ - -e "/multi-pack-index/d" <$raw >$raw.de-sha || return 1 + -e "/multi-pack-index/d" <$raw >$raw.de-sha-1 && + sort $raw.de-sha-1 >$raw.de-sha || return 1 done && cat >expected-files <<-EOF && ./Y/Z ./Y/Z + ./Y/Z ./a-loose-dir/Z ./an-object - ./Y/Z ./info/packs ./pack/pack-Z.idx ./pack/pack-Z.pack