From patchwork Sat May 20 16:13:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2513C7EE26 for ; Sat, 20 May 2023 16:14:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231846AbjETQOH (ORCPT ); Sat, 20 May 2023 12:14:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjETQOE (ORCPT ); Sat, 20 May 2023 12:14:04 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D238110A for ; Sat, 20 May 2023 09:14:02 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f4249b7badso43995465e9.3 for ; Sat, 20 May 2023 09:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599241; x=1687191241; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=GM0Lv19xyG2XvaaboXrsO7tpXlI7lvy9yt+RUuSpEUA=; b=khVBNt/CaUeISOgjMQqCkvEvoiytUWMZkBltLpYaqWymN0hiSfb6nmjuYvANjo2ClD BUiady6/ywxgJMoQ7dcs4LpsP8FYfkDOv4XeNyx47nLUBXZxe0LbGD27p48ZEPS5a5v9 ooKaLGlp+Chqn97e/yopzD+eF0mK2cgWuZKHpzuWl/B8Psqoma7EgVKCZIsEVoSQKmGG e97wldyR7vO031rBfliEi9SK9kFSgyUC5QmsgY4J1vwmQKRAVj8COwYo5IiP5h4+DNSN Q0pCYd2zdhHen0Bt05ZUZSYIdLS3pSi/ty4Bx7KrLV4dNQ/OECgypkZ7GGsNC7oXexOk DN3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599241; x=1687191241; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GM0Lv19xyG2XvaaboXrsO7tpXlI7lvy9yt+RUuSpEUA=; b=LR9kiEgeQ9+E4n0ffu0gWAQVWo+DQLup/m/mEV6bCtgpLEqFfmgyWl8Gv2AcRfdwQN 1bxMfPMQbCDzHVUF3RvTDketoVhvQogvvfwc5kZuavcx9nH26UYmka9EsoDz7kd7eT5z f7aSlwZ3MAOGn4D8KV3PZiuNCeiHur3JHarc2PnAXYn5fcajd2cY6ni/YomMZ+J/Ndsv YQTZYS6ujeTih/s3mgGqV26lQNVrTCDo7vstay6Vt2jeDOnL7p+OkRdUtqy34S9JTIql MzDHnRFFGqH34qxfW+SQX/w3xPtqdEIlKe+sFjXk6oM08JXyz7Bx0/jXJk3UW1EDZTZ6 MHiQ== X-Gm-Message-State: AC+VfDy93JYgRCZlJtGyPmydV+ADC8fuV5SAk9MLWs1YmC4dtm4uqXLc VuL4scRwgWiHwoCJwCeITi+TmdBDqjQ= X-Google-Smtp-Source: ACHHUZ7ws4HUcz3YyErBkI35jTHDW6pZmQ1EQe4Ijvv8KJAj3eAvJWKxwY6tn/RcJI7cvPlYCTjx/g== X-Received: by 2002:a1c:4c16:0:b0:3f3:2b37:dd34 with SMTP id z22-20020a1c4c16000000b003f32b37dd34mr3567648wmf.9.1684599240767; Sat, 20 May 2023 09:14:00 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o3-20020a1c7503000000b003f09d7b6e20sm2709258wmc.2.2023.05.20.09.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:00 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Sat, 20 May 2023 16:13:49 +0000 Subject: [PATCH 01/10] t7110-reset-merge: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t7110-reset-merge.sh | 314 ++++++++++++++++++++--------------------- 1 file changed, 157 insertions(+), 157 deletions(-) diff --git a/t/t7110-reset-merge.sh b/t/t7110-reset-merge.sh index eb881be95b6..772480a345f 100755 --- a/t/t7110-reset-merge.sh +++ b/t/t7110-reset-merge.sh @@ -9,17 +9,17 @@ TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh test_expect_success setup ' - printf "line %d\n" 1 2 3 >file1 && - cat file1 >file2 && - git add file1 file2 && - test_tick && - git commit -m "Initial commit" && - git tag initial && - echo line 4 >>file1 && - cat file1 >file2 && - test_tick && - git commit -m "add line 4 to file1" file1 && - git tag second + printf "line %d\n" 1 2 3 >file1 && + cat file1 >file2 && + git add file1 file2 && + test_tick && + git commit -m "Initial commit" && + git tag initial && + echo line 4 >>file1 && + cat file1 >file2 && + test_tick && + git commit -m "add line 4 to file1" file1 && + git tag second ' # The next test will test the following: @@ -29,19 +29,19 @@ test_expect_success setup ' # file1: C C C D --merge D D D # file2: C D D D --merge C D D test_expect_success 'reset --merge is ok with changes in file it does not touch' ' - git reset --merge HEAD^ && - ! grep 4 file1 && - grep 4 file2 && - test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && - test -z "$(git diff --cached)" + git reset --merge HEAD^ && + ! grep 4 file1 && + grep 4 file2 && + test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && + test -z "$(git diff --cached)" ' test_expect_success 'reset --merge is ok when switching back' ' - git reset --merge second && - grep 4 file1 && - grep 4 file2 && - test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && - test -z "$(git diff --cached)" + git reset --merge second && + grep 4 file1 && + grep 4 file2 && + test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && + test -z "$(git diff --cached)" ' # The next test will test the following: @@ -51,21 +51,21 @@ test_expect_success 'reset --merge is ok when switching back' ' # file1: C C C D --keep D D D # file2: C D D D --keep C D D test_expect_success 'reset --keep is ok with changes in file it does not touch' ' - git reset --hard second && - cat file1 >file2 && - git reset --keep HEAD^ && - ! grep 4 file1 && - grep 4 file2 && - test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && - test -z "$(git diff --cached)" + git reset --hard second && + cat file1 >file2 && + git reset --keep HEAD^ && + ! grep 4 file1 && + grep 4 file2 && + test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && + test -z "$(git diff --cached)" ' test_expect_success 'reset --keep is ok when switching back' ' - git reset --keep second && - grep 4 file1 && - grep 4 file2 && - test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && - test -z "$(git diff --cached)" + git reset --keep second && + grep 4 file1 && + grep 4 file2 && + test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && + test -z "$(git diff --cached)" ' # The next test will test the following: @@ -75,28 +75,28 @@ test_expect_success 'reset --keep is ok when switching back' ' # file1: B B C D --merge D D D # file2: C D D D --merge C D D test_expect_success 'reset --merge discards changes added to index (1)' ' - git reset --hard second && - cat file1 >file2 && - echo "line 5" >> file1 && - git add file1 && - git reset --merge HEAD^ && - ! grep 4 file1 && - ! grep 5 file1 && - grep 4 file2 && - test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && - test -z "$(git diff --cached)" + git reset --hard second && + cat file1 >file2 && + echo "line 5" >> file1 && + git add file1 && + git reset --merge HEAD^ && + ! grep 4 file1 && + ! grep 5 file1 && + grep 4 file2 && + test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && + test -z "$(git diff --cached)" ' test_expect_success 'reset --merge is ok again when switching back (1)' ' - git reset --hard initial && - echo "line 5" >> file2 && - git add file2 && - git reset --merge second && - ! grep 4 file2 && - ! grep 5 file1 && - grep 4 file1 && - test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && - test -z "$(git diff --cached)" + git reset --hard initial && + echo "line 5" >> file2 && + git add file2 && + git reset --merge second && + ! grep 4 file2 && + ! grep 5 file1 && + grep 4 file1 && + test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && + test -z "$(git diff --cached)" ' # The next test will test the following: @@ -105,10 +105,10 @@ test_expect_success 'reset --merge is ok again when switching back (1)' ' # ---------------------------------------------------- # file1: B B C D --keep (disallowed) test_expect_success 'reset --keep fails with changes in index in files it touches' ' - git reset --hard second && - echo "line 5" >> file1 && - git add file1 && - test_must_fail git reset --keep HEAD^ + git reset --hard second && + echo "line 5" >> file1 && + git add file1 && + test_must_fail git reset --keep HEAD^ ' # The next test will test the following: @@ -118,23 +118,23 @@ test_expect_success 'reset --keep fails with changes in index in files it touche # file1: C C C D --merge D D D # file2: C C D D --merge D D D test_expect_success 'reset --merge discards changes added to index (2)' ' - git reset --hard second && - echo "line 4" >> file2 && - git add file2 && - git reset --merge HEAD^ && - ! grep 4 file2 && - test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && - test -z "$(git diff)" && - test -z "$(git diff --cached)" + git reset --hard second && + echo "line 4" >> file2 && + git add file2 && + git reset --merge HEAD^ && + ! grep 4 file2 && + test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && + test -z "$(git diff)" && + test -z "$(git diff --cached)" ' test_expect_success 'reset --merge is ok again when switching back (2)' ' - git reset --hard initial && - git reset --merge second && - ! grep 4 file2 && - grep 4 file1 && - test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && - test -z "$(git diff --cached)" + git reset --hard initial && + git reset --merge second && + ! grep 4 file2 && + grep 4 file1 && + test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && + test -z "$(git diff --cached)" ' # The next test will test the following: @@ -144,21 +144,21 @@ test_expect_success 'reset --merge is ok again when switching back (2)' ' # file1: C C C D --keep D D D # file2: C C D D --keep C D D test_expect_success 'reset --keep keeps changes it does not touch' ' - git reset --hard second && - echo "line 4" >> file2 && - git add file2 && - git reset --keep HEAD^ && - grep 4 file2 && - test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && - test -z "$(git diff --cached)" + git reset --hard second && + echo "line 4" >> file2 && + git add file2 && + git reset --keep HEAD^ && + grep 4 file2 && + test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" && + test -z "$(git diff --cached)" ' test_expect_success 'reset --keep keeps changes when switching back' ' - git reset --keep second && - grep 4 file2 && - grep 4 file1 && - test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && - test -z "$(git diff --cached)" + git reset --keep second && + grep 4 file2 && + grep 4 file1 && + test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && + test -z "$(git diff --cached)" ' # The next test will test the following: @@ -167,14 +167,14 @@ test_expect_success 'reset --keep keeps changes when switching back' ' # ---------------------------------------------------- # file1: A B B C --merge (disallowed) test_expect_success 'reset --merge fails with changes in file it touches' ' - git reset --hard second && - echo "line 5" >> file1 && - test_tick && - git commit -m "add line 5" file1 && - sed -e "s/line 1/changed line 1/" file3 && - mv file3 file1 && - test_must_fail git reset --merge HEAD^ 2>err.log && - grep file1 err.log | grep "not uptodate" + git reset --hard second && + echo "line 5" >> file1 && + test_tick && + git commit -m "add line 5" file1 && + sed -e "s/line 1/changed line 1/" file3 && + mv file3 file1 && + test_must_fail git reset --merge HEAD^ 2>err.log && + grep file1 err.log | grep "not uptodate" ' # The next test will test the following: @@ -183,36 +183,36 @@ test_expect_success 'reset --merge fails with changes in file it touches' ' # ---------------------------------------------------- # file1: A B B C --keep (disallowed) test_expect_success 'reset --keep fails with changes in file it touches' ' - git reset --hard second && - echo "line 5" >> file1 && - test_tick && - git commit -m "add line 5" file1 && - sed -e "s/line 1/changed line 1/" file3 && - mv file3 file1 && - test_must_fail git reset --keep HEAD^ 2>err.log && - grep file1 err.log | grep "not uptodate" + git reset --hard second && + echo "line 5" >> file1 && + test_tick && + git commit -m "add line 5" file1 && + sed -e "s/line 1/changed line 1/" file3 && + mv file3 file1 && + test_must_fail git reset --keep HEAD^ 2>err.log && + grep file1 err.log | grep "not uptodate" ' test_expect_success 'setup 3 different branches' ' - git reset --hard second && - git branch branch1 && - git branch branch2 && - git branch branch3 && - git checkout branch1 && - echo "line 5 in branch1" >> file1 && - test_tick && - git commit -a -m "change in branch1" && - git checkout branch2 && - echo "line 5 in branch2" >> file1 && - test_tick && - git commit -a -m "change in branch2" && - git tag third && - git checkout branch3 && - echo a new file >file3 && - rm -f file1 && - git add file3 && - test_tick && - git commit -a -m "change in branch3" + git reset --hard second && + git branch branch1 && + git branch branch2 && + git branch branch3 && + git checkout branch1 && + echo "line 5 in branch1" >> file1 && + test_tick && + git commit -a -m "change in branch1" && + git checkout branch2 && + echo "line 5 in branch2" >> file1 && + test_tick && + git commit -a -m "change in branch2" && + git tag third && + git checkout branch3 && + echo a new file >file3 && + rm -f file1 && + git add file3 && + test_tick && + git commit -a -m "change in branch3" ' # The next test will test the following: @@ -221,12 +221,12 @@ test_expect_success 'setup 3 different branches' ' # ---------------------------------------------------- # file1: X U B C --merge C C C test_expect_success '"reset --merge HEAD^" is ok with pending merge' ' - git checkout third && - test_must_fail git merge branch1 && - git reset --merge HEAD^ && - test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && - test -z "$(git diff --cached)" && - test -z "$(git diff)" + git checkout third && + test_must_fail git merge branch1 && + git reset --merge HEAD^ && + test "$(git rev-parse HEAD)" = "$(git rev-parse second)" && + test -z "$(git diff --cached)" && + test -z "$(git diff)" ' # The next test will test the following: @@ -235,10 +235,10 @@ test_expect_success '"reset --merge HEAD^" is ok with pending merge' ' # ---------------------------------------------------- # file1: X U B C --keep (disallowed) test_expect_success '"reset --keep HEAD^" fails with pending merge' ' - git reset --hard third && - test_must_fail git merge branch1 && - test_must_fail git reset --keep HEAD^ 2>err.log && - test_i18ngrep "middle of a merge" err.log + git reset --hard third && + test_must_fail git merge branch1 && + test_must_fail git reset --keep HEAD^ 2>err.log && + test_i18ngrep "middle of a merge" err.log ' # The next test will test the following: @@ -247,12 +247,12 @@ test_expect_success '"reset --keep HEAD^" fails with pending merge' ' # ---------------------------------------------------- # file1: X U B B --merge B B B test_expect_success '"reset --merge HEAD" is ok with pending merge' ' - git reset --hard third && - test_must_fail git merge branch1 && - git reset --merge HEAD && - test "$(git rev-parse HEAD)" = "$(git rev-parse third)" && - test -z "$(git diff --cached)" && - test -z "$(git diff)" + git reset --hard third && + test_must_fail git merge branch1 && + git reset --merge HEAD && + test "$(git rev-parse HEAD)" = "$(git rev-parse third)" && + test -z "$(git diff --cached)" && + test -z "$(git diff)" ' # The next test will test the following: @@ -261,36 +261,36 @@ test_expect_success '"reset --merge HEAD" is ok with pending merge' ' # ---------------------------------------------------- # file1: X U B B --keep (disallowed) test_expect_success '"reset --keep HEAD" fails with pending merge' ' - git reset --hard third && - test_must_fail git merge branch1 && - test_must_fail git reset --keep HEAD 2>err.log && - test_i18ngrep "middle of a merge" err.log + git reset --hard third && + test_must_fail git merge branch1 && + test_must_fail git reset --keep HEAD 2>err.log && + test_i18ngrep "middle of a merge" err.log ' test_expect_success '--merge is ok with added/deleted merge' ' - git reset --hard third && - rm -f file2 && - test_must_fail git merge branch3 && - ! test -f file2 && - test -f file3 && - git diff --exit-code file3 && - git diff --exit-code branch3 file3 && - git reset --merge HEAD && - ! test -f file3 && - ! test -f file2 && - git diff --exit-code --cached + git reset --hard third && + rm -f file2 && + test_must_fail git merge branch3 && + ! test -f file2 && + test -f file3 && + git diff --exit-code file3 && + git diff --exit-code branch3 file3 && + git reset --merge HEAD && + ! test -f file3 && + ! test -f file2 && + git diff --exit-code --cached ' test_expect_success '--keep fails with added/deleted merge' ' - git reset --hard third && - rm -f file2 && - test_must_fail git merge branch3 && - ! test -f file2 && - test -f file3 && - git diff --exit-code file3 && - git diff --exit-code branch3 file3 && - test_must_fail git reset --keep HEAD 2>err.log && - test_i18ngrep "middle of a merge" err.log + git reset --hard third && + rm -f file2 && + test_must_fail git merge branch3 && + ! test -f file2 && + test -f file3 && + git diff --exit-code file3 && + git diff --exit-code branch3 file3 && + test_must_fail git reset --keep HEAD 2>err.log && + test_i18ngrep "middle of a merge" err.log ' test_done From patchwork Sat May 20 16:13:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30A82C7EE2A for ; Sat, 20 May 2023 16:14:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231877AbjETQOK (ORCPT ); Sat, 20 May 2023 12:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231750AbjETQOF (ORCPT ); Sat, 20 May 2023 12:14:05 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69F32121 for ; Sat, 20 May 2023 09:14:03 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-30626f4d74aso2838448f8f.0 for ; Sat, 20 May 2023 09:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599241; x=1687191241; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=SQyibiRXolRpIiLEza94rrYM8pmdRSEh2io/+Cjw4bs=; b=HKYLqD6vcNzVJPNT3lussXES2rg1owQBJcA9nK0mFRhrryewYojZFgDAbU97dtKMtI iXFs7KsoUJkn+XiRD5SDwX6wc//qlOLmBqZdBXDMxDhirip3iJHQRPjI1q0FFwWUY6OT g08uGZrp2KeGKP0M3K4dTOlClxKWEbOY421TTs4ul4T55C883QK1AZ+XjsyG9HrW79Ud 67RSx0LNm1RIdLQSZ9yh7zNy7zPyfMiYB5WCtB/Fv4hxmfQeSK/4Uj61Bu2notDA1a4C 5qj9yawP9bbB5syADyMVDeB549eMqP6kywnshLlpd679sBRiiLObEJCyCEs2wqGrFMW9 04Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599241; x=1687191241; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SQyibiRXolRpIiLEza94rrYM8pmdRSEh2io/+Cjw4bs=; b=TKQRlTo6PUSG4KIrlAQxvWbankiKECAETwQnYyJ3eFLjmC5c3R4Tu8JF8Oz/C3E8UO f/UKOAi9oQIeyCqK7gQuKohbfOvWnhUgyX9+ciHeN0fu3lgoU7553s7RAa2YY+8euZGb YEhLaTZcABoGq78CnAUwoAedd1Od0twnvm8HpiHDiFQ6NIcu0osWj5kou8T3LLz3BvYR 1rAlZl7Kkgra4C3SHZWrlbDtFJYjGU+QeK2U9YjBBsDVqdrnaEcpXpjwsy1UumorytXF MRdyyvo7CxyQ5xcF3uo5geJ6PTI3OPSYyUSn8UuIm6u8mz/2XdKmNamTwPVRhdLmFToI jWcQ== X-Gm-Message-State: AC+VfDwEs+iraE/RvTaoMYRoYxRNJtYL9hqPxEHUewQ4UqUd+yDaq86s voDddCcHl+u54legvZ4t3rYNPy+gvOw= X-Google-Smtp-Source: ACHHUZ7Lr3hY/2BM7LRE+tLf0AeJ3MU6nePCkI1KTBICDx03I40KERI81YSkfHUtho9ogqyjXlL1wA== X-Received: by 2002:adf:e945:0:b0:306:2e48:6ded with SMTP id m5-20020adfe945000000b003062e486dedmr4677889wrn.13.1684599241572; Sat, 20 May 2023 09:14:01 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f12-20020a5d58ec000000b00309257ad16csm2349469wrd.29.2023.05.20.09.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:01 -0700 (PDT) Message-Id: <9ed2127a2595b42f45450358aecd2090d9cfea4c.1684599239.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 20 May 2023 16:13:50 +0000 Subject: [PATCH 02/10] t7111-reset-table: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t7111-reset-table.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/t/t7111-reset-table.sh b/t/t7111-reset-table.sh index 78f25c1c7ea..01b7c3503ca 100755 --- a/t/t7111-reset-table.sh +++ b/t/t7111-reset-table.sh @@ -10,9 +10,9 @@ TEST_PASSES_SANITIZE_LEAK=true test_expect_success 'creating initial commits' ' - test_commit E file1 && - test_commit D file1 && - test_commit C file1 + test_commit E file1 && + test_commit D file1 && + test_commit C file1 ' while read W1 I1 H1 T opt W2 I2 H2 @@ -74,13 +74,13 @@ B C C C keep B C C EOF test_expect_success 'setting up branches to test with unmerged entries' ' - git reset --hard C && - git branch branch1 && - git branch branch2 && - git checkout branch1 && - test_commit B1 file1 && - git checkout branch2 && - test_commit B file1 + git reset --hard C && + git branch branch1 && + git branch branch2 && + git checkout branch1 && + test_commit B1 file1 && + git checkout branch2 && + test_commit B file1 ' while read W1 I1 H1 T opt W2 I2 H2 From patchwork Sat May 20 16:13:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249240 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1782C77B7F for ; Sat, 20 May 2023 16:14:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231883AbjETQOM (ORCPT ); Sat, 20 May 2023 12:14:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231795AbjETQOF (ORCPT ); Sat, 20 May 2023 12:14:05 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 223AFDB for ; Sat, 20 May 2023 09:14:04 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3090d3e9c92so4269401f8f.2 for ; Sat, 20 May 2023 09:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599242; x=1687191242; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=m2I5OY4gELOsNNU0vWUKnuRuEft5GyjuwAOvKTI6JI8=; b=Hgz1akIAYiSCgTfC2IKeJAR2O+xbVt+Kj6pqRNRpYFUJGg+BNVioBj1xQzbQDOU0mo 2NMJKMTot5QvmXquxqbA8MVrXBxw+SeG61pKuflLt4phoKK+Aerr/pkd8MboQhE0jsz/ CePjJCkdzD+8uDPVMTouZ8sY4KZNe+4kAkOWyFMTl7dlkbySX2sigd9mi792lrmkRQ/h +sFOi9G7eYZgJEh9jzl5NLnVczXbq+621yysYxZ+4fofWV9Bm2WrkuK66+EJQfsnm0fc BUA7GAx6yOsBD37l9UCaxXM3bkLJ+7pQsNeHlYVhLQNEnIAEIqS1JpVtO2YcaOoxMdGU fV8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599242; x=1687191242; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m2I5OY4gELOsNNU0vWUKnuRuEft5GyjuwAOvKTI6JI8=; b=A1RONM5Lj7pLCThIUKzqonHOh9Ez3kvjuIfINrByI2QzwNgH5GLvzYy3Sz6WqzeTMC FVS7x0mWsYPgikrbI3KgFhEGsYlmvcw311arTIO3hTdZsGImHvU+JNqbhhYjqH70j1kL JmL9CVB9rAp2QZKOYvOpIf37mbs5g7BgoGAlQF+rIyA/lUgUgkHeFjsJ8x35g4qsAbhu MzmtOxWMck7iFySyXFSJIKdPkRLxqaqCHM2Ldjbu2/qZetpLg+DbVCUP0ZvJmDScp6jK TY3i9aD70eTuDpQHeUE2EU+/T1Qyt/ND9s2pV2olPGwGwofvwL/Xbo3eEl3QaDxkm7ev /KKg== X-Gm-Message-State: AC+VfDwlIa5Dc66h/pI2EZkoDje4oTdDr0wC8gA50QKS44yvpdZj0yDq W8OQeBewyYMcsRulFPwMKzQ2yRYvEZs= X-Google-Smtp-Source: ACHHUZ5vcny57DBuhiGJCUfVFtlQwCI1mNWCBIcci7OQ37Hpw4upvyOah/TIo8kOQoFnGbmZNg76UQ== X-Received: by 2002:adf:e912:0:b0:307:7e64:4b52 with SMTP id f18-20020adfe912000000b003077e644b52mr4572479wrm.36.1684599242287; Sat, 20 May 2023 09:14:02 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r14-20020adfce8e000000b00306c5900c10sm2369247wrn.9.2023.05.20.09.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:01 -0700 (PDT) Message-Id: <34a3b63f05245bda86abaec4bb04b3d06d995c38.1684599239.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 20 May 2023 16:13:51 +0000 Subject: [PATCH 03/10] t7201-co: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t7201-co.sh | 92 +++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 61ad47b0c18..35b9e6ed6b5 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -372,75 +372,75 @@ test_expect_success 'checkout specific path while in subdirectory' ' ' test_expect_success 'checkout w/--track sets up tracking' ' - git config branch.autosetupmerge false && - git checkout main && - git checkout --track -b track1 && - test "$(git config branch.track1.remote)" && - test "$(git config branch.track1.merge)" + git config branch.autosetupmerge false && + git checkout main && + git checkout --track -b track1 && + test "$(git config branch.track1.remote)" && + test "$(git config branch.track1.merge)" ' test_expect_success 'checkout w/autosetupmerge=always sets up tracking' ' - test_when_finished git config branch.autosetupmerge false && - git config branch.autosetupmerge always && - git checkout main && - git checkout -b track2 && - test "$(git config branch.track2.remote)" && - test "$(git config branch.track2.merge)" + test_when_finished git config branch.autosetupmerge false && + git config branch.autosetupmerge always && + git checkout main && + git checkout -b track2 && + test "$(git config branch.track2.remote)" && + test "$(git config branch.track2.merge)" ' test_expect_success 'checkout w/--track from non-branch HEAD fails' ' - git checkout main^0 && - test_must_fail git symbolic-ref HEAD && - test_must_fail git checkout --track -b track && - test_must_fail git rev-parse --verify track && - test_must_fail git symbolic-ref HEAD && - test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)" + git checkout main^0 && + test_must_fail git symbolic-ref HEAD && + test_must_fail git checkout --track -b track && + test_must_fail git rev-parse --verify track && + test_must_fail git symbolic-ref HEAD && + test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)" ' test_expect_success 'checkout w/--track from tag fails' ' - git checkout main^0 && - test_must_fail git symbolic-ref HEAD && - test_must_fail git checkout --track -b track frotz && - test_must_fail git rev-parse --verify track && - test_must_fail git symbolic-ref HEAD && - test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)" + git checkout main^0 && + test_must_fail git symbolic-ref HEAD && + test_must_fail git checkout --track -b track frotz && + test_must_fail git rev-parse --verify track && + test_must_fail git symbolic-ref HEAD && + test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)" ' test_expect_success 'detach a symbolic link HEAD' ' - git checkout main && - git config --bool core.prefersymlinkrefs yes && - git checkout side && - git checkout main && - it=$(git symbolic-ref HEAD) && - test "z$it" = zrefs/heads/main && - here=$(git rev-parse --verify refs/heads/main) && - git checkout side^ && - test "z$(git rev-parse --verify refs/heads/main)" = "z$here" + git checkout main && + git config --bool core.prefersymlinkrefs yes && + git checkout side && + git checkout main && + it=$(git symbolic-ref HEAD) && + test "z$it" = zrefs/heads/main && + here=$(git rev-parse --verify refs/heads/main) && + git checkout side^ && + test "z$(git rev-parse --verify refs/heads/main)" = "z$here" ' test_expect_success 'checkout with --track fakes a sensible -b ' ' - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" && - git update-ref refs/remotes/origin/koala/bear renamer && + git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" && + git update-ref refs/remotes/origin/koala/bear renamer && - git checkout --track origin/koala/bear && - test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" && - test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" && + git checkout --track origin/koala/bear && + test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" && + test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" && - git checkout main && git branch -D koala/bear && + git checkout main && git branch -D koala/bear && - git checkout --track refs/remotes/origin/koala/bear && - test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" && - test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" && + git checkout --track refs/remotes/origin/koala/bear && + test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" && + test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" && - git checkout main && git branch -D koala/bear && + git checkout main && git branch -D koala/bear && - git checkout --track remotes/origin/koala/bear && - test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" && - test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" + git checkout --track remotes/origin/koala/bear && + test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" && + test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" ' test_expect_success 'checkout with --track, but without -b, fails with too short tracked name' ' - test_must_fail git checkout --track renamer + test_must_fail git checkout --track renamer ' setup_conflicting_index () { From patchwork Sat May 20 16:13:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249238 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD3BBC77B7A for ; Sat, 20 May 2023 16:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231866AbjETQOI (ORCPT ); Sat, 20 May 2023 12:14:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbjETQOF (ORCPT ); Sat, 20 May 2023 12:14:05 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABDB3124 for ; Sat, 20 May 2023 09:14:04 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-309550d4f73so1188736f8f.1 for ; Sat, 20 May 2023 09:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599243; x=1687191243; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=v1nYytEFp0cKqGOQAO2UhL2U1e5wHcXRkcg3rOj1KQk=; b=l5mFP01Pk9s6/SaEnTLeCPMyK8HsDzPDKYMQIRYySM6UB3o2UPlpZ2nw1nzaBOVviY 91Y0UMlKdk04bWZXAE2Ip1u0BsRTNXqOTSBcQ20V3xyhXA6PA9+onnmGRwzdYr5sSdzK iUYmlw9C614GXPgum9B3QImdfdNJGXCN2mORNowvWwQDEfma8iOwHWpcEaQSxtMeMPk4 8AG0zHQ4Cptm5l1Fx+XtrwQaErIViVQaWAXVvw1d+t0Sz+Zir3kjptCot/sVrrDEcjPn hvv7vvAz1x1YJky9IP1VTfYg5+IrkldB4uMSaN+6WBcCL+L9inn4R/5q4ddBrzuCNWuo nJGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599243; x=1687191243; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v1nYytEFp0cKqGOQAO2UhL2U1e5wHcXRkcg3rOj1KQk=; b=On5n2TcdSrH0lQ42Gow07lXavVoA04GeICO0s5+VvjdelXN8Z1er3P0T0qYUQkSRAS lNAx1C1yR+j2yBgPrPuXpkLMX/zpHvbRQv4P6WF/nkZUJm55RkqRWBWOThlTPIHKgdJO QbsxzeGv1A5cPeqlfzIssKiBRbXvBEaXc1GRTgF6NhQT69S/DcP8CZOooymNXubo0kV4 24/5ODEldHbS5kfcpJjwNfolPNIS2LiKYUi6d3k3bGzIklNBSkNK0f4jQvYdriHyiOqe j+vmq601axkRMXyZ+7C/ttfOXaEdG/xOGPtMdEHpS/d9vcBWHNnHpgCfItk/5etyq3xD UguA== X-Gm-Message-State: AC+VfDz9nJT+eayagGGTFdR/Lq4FI/eIiPfNByYu+kZdklaOD5JvjKLR T2XXEUNqcYhA2GL1jyUmEeFpXQ6YSXs= X-Google-Smtp-Source: ACHHUZ6HaoZ3zenRfn2xsJk0WjCGYjK3UbbTCYumYIsGJ2u2lL1W06QmkLfe9i+7F4D0+FEwjKuUZg== X-Received: by 2002:a5d:63c2:0:b0:306:2d81:341d with SMTP id c2-20020a5d63c2000000b003062d81341dmr6026233wrw.24.1684599243034; Sat, 20 May 2023 09:14:03 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id w16-20020a5d5450000000b00306415ac69asm2362763wrv.15.2023.05.20.09.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:02 -0700 (PDT) Message-Id: <5c953b3d1055522e29ac40dfffe21a48dbaa1900.1684599239.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 20 May 2023 16:13:52 +0000 Subject: [PATCH 04/10] t7508-status: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t7508-status.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t7508-status.sh b/t/t7508-status.sh index aed07c5b622..a3050adfd07 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -1519,8 +1519,8 @@ test_expect_success '"status.branch=true" weaker than "--no-branch"' ' ' test_expect_success '"status.branch=true" weaker than "--porcelain"' ' - git -c status.branch=true status --porcelain >actual && - test_cmp expected_nobranch actual + git -c status.branch=true status --porcelain >actual && + test_cmp expected_nobranch actual ' test_expect_success '"status.branch=false" same as "--no-branch"' ' From patchwork Sat May 20 16:13:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EF69C77B7A for ; Sat, 20 May 2023 16:14:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231890AbjETQON (ORCPT ); Sat, 20 May 2023 12:14:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231838AbjETQOG (ORCPT ); Sat, 20 May 2023 12:14:06 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82435125 for ; Sat, 20 May 2023 09:14:05 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-30644c18072so2787600f8f.2 for ; Sat, 20 May 2023 09:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599244; x=1687191244; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=sHwtL0xYMkRMvlNmjMvdbIByoM2zyOmpjE1feWKhVTo=; b=HUspz8pQKCPLgOpcyPS+4U396MyIpfLUamCfbMntmDOCIll412i5E+8W3CYpgs8cOE bmsX1PAra+N6aLkldIoMfZLoshy8idlwVNGPmNnnyfArHEiDz5uMTDnYsSm5zG/3l4fB T2EdmpjvMUYhIYF1YnsMqf2LvKsI0nxGxxzXvMjxVEMZ8ytpS/aW0W3qJ7mfGVnIBja1 Zul+Or+TLM59FDxPcLhs6SFT8bSJ8DXJB98kyTi23wZytLYcnbc6dsFKOY7yDj/UTWPS yxEbqtknHHY2o5qhl1PUS8Ui1C0Ee5wY3pmDR06d37bLZnT+iNp/cjn0Js41uturAqDY xayA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599244; x=1687191244; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sHwtL0xYMkRMvlNmjMvdbIByoM2zyOmpjE1feWKhVTo=; b=IQcnLu2HTrKzLibsJxhR0U3Y6ysz748jjXA1PgcWaFZghnpvXrU30UcaKeFDaoU94b kIwrpoJ4CB5o2Zk+Cq8EcK/zuAjqGgLRxKjw8uIwh09bnCBgfofLBhni+wmrUMj+qfAv m9RE0m4H0dBPazM40Km5E/mjCbVpJHwPv1dnqV6gSrsxm5HxBQpZfMXcOdm+rO1eOFV+ y6tGNaWG04CxREwRx/j3zC43fEzJ/P+4077X0HR6qgF0kgQAY+Q/Za3jNV6tUOsTsoBl DiwUQN2UGCSyq+3b6E2dkJsmBQHFcW6biU1/hnXC1abLU2b0e1j7NhXoKdNl0oqBCucL 0VRw== X-Gm-Message-State: AC+VfDxxpEf4z48YQd/jQdVpe5eT5TY3Amq60epfuQjZ5rk6k2OA9WuY l002MkX+p0whWllCH4UxPlu6PK2jGiA= X-Google-Smtp-Source: ACHHUZ7+VK9H7HfmMw9zkXTDfIhkxo92Sucd/fUalUm7WZrmTH9zyOOwu0vt4y7VeNlfwJZek9wQGQ== X-Received: by 2002:adf:cc87:0:b0:30a:37aa:1fab with SMTP id p7-20020adfcc87000000b0030a37aa1fabmr1244271wrj.6.1684599243760; Sat, 20 May 2023 09:14:03 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l17-20020adfe591000000b003079c402762sm2338576wrm.19.2023.05.20.09.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:03 -0700 (PDT) Message-Id: <4774e05d099234887acb210af86a7ce484b6def9.1684599239.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 20 May 2023 16:13:53 +0000 Subject: [PATCH 05/10] t7600-merge: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t7600-merge.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh index 060e145957f..fdc607277c2 100755 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@ -639,41 +639,41 @@ test_expect_success 'merge log message' ' test_debug 'git log --graph --decorate --oneline --all' test_expect_success 'merge c1 with c0, c2, c0, and c1' ' - git reset --hard c1 && - test_tick && - git merge c0 c2 c0 c1 && - verify_merge file result.1-5 && - verify_parents $c1 $c2 + git reset --hard c1 && + test_tick && + git merge c0 c2 c0 c1 && + verify_merge file result.1-5 && + verify_parents $c1 $c2 ' test_debug 'git log --graph --decorate --oneline --all' test_expect_success 'merge c1 with c0, c2, c0, and c1' ' - git reset --hard c1 && - test_tick && - git merge c0 c2 c0 c1 && - verify_merge file result.1-5 && - verify_parents $c1 $c2 + git reset --hard c1 && + test_tick && + git merge c0 c2 c0 c1 && + verify_merge file result.1-5 && + verify_parents $c1 $c2 ' test_debug 'git log --graph --decorate --oneline --all' test_expect_success 'merge c1 with c1 and c2' ' - git reset --hard c1 && - test_tick && - git merge c1 c2 && - verify_merge file result.1-5 && - verify_parents $c1 $c2 + git reset --hard c1 && + test_tick && + git merge c1 c2 && + verify_merge file result.1-5 && + verify_parents $c1 $c2 ' test_debug 'git log --graph --decorate --oneline --all' test_expect_success 'merge fast-forward in a dirty tree' ' - git reset --hard c0 && - mv file file1 && - cat file1 >file && - rm -f file1 && - git merge c2 + git reset --hard c0 && + mv file file1 && + cat file1 >file && + rm -f file1 && + git merge c2 ' test_debug 'git log --graph --decorate --oneline --all' From patchwork Sat May 20 16:13:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249242 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4366AC7EE26 for ; Sat, 20 May 2023 16:14:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231896AbjETQOO (ORCPT ); Sat, 20 May 2023 12:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231862AbjETQOH (ORCPT ); Sat, 20 May 2023 12:14:07 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 537C810A for ; Sat, 20 May 2023 09:14:06 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f420618d5bso27517455e9.1 for ; Sat, 20 May 2023 09:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599244; x=1687191244; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=10zWt/GB2YlEdRKE9G/e9Jlyd+WQNy3R5+Sx8mZ8ePg=; b=GtxgB0Cf2hSk5AoWn0SmMxV9MtAM1K2HPtHnKjKXmTyxmxwHN+QJlvPmg+ZeAjbLvk nhbEQfaU69z+yRiAkKV7T4YdVJCxlP+VQW0JRQ1+ZfeaOze5Lat9rbhtqa2dP4VLYUmX YTn+dc1vT0Y3tmPxaiSgG9xvuGG37hcL/hamMAGJLhGMSSJvtXvuv5DgSHEdvX7HCK0z /tme6mjhnkiYeb/k3RNQdb66HS/51TXUYLG1pWtTzcjDbtBMdHQO5hedoO56v7yhfAsl B3dmm5ln3X4lzgIikFoWxzpGmypa1CoqYlCY5CWXlkYvprDhoMjihlSMzc36DtZbFTI0 uZ8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599244; x=1687191244; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=10zWt/GB2YlEdRKE9G/e9Jlyd+WQNy3R5+Sx8mZ8ePg=; b=kEgwp4pgC+k20Fw9ikS3XxhtSUEjXeE/TeoAh7cls6f5O2LViHJ4uOxw7CfAXSAWeC FrYkAtUpJFE7yfvwp5PYPYpXy5f7l/D737qV/JcyE2OVdqXgxfzIcrbzfp8cOlK+s07C o59CepFFozGXJ40vUnoUh8xNg5WQkwzBgMtvozgqqKty9cyKMo1TGdS2ht1F0u9uVjKP XCpg4WkxpZVs9NPiaM0zO5wl4H/a4uwPxIi8YYallfKBqWcRDYL54ZgXjymV+szxs7YC oPmGv1KPK9gBbMo8v33R8RnUkGGXDYK756AQd45j8CglzFR/eoy4VfkQm7ttq50L+giz 4hmw== X-Gm-Message-State: AC+VfDyk+CVALBD0+7OtjV0K+7stlVPGpkFwitADO2IAI7u1LtxE/t6K LTZrLb+zwVDzESbwjUP3LM1JXt9BBB0= X-Google-Smtp-Source: ACHHUZ6MHB/guLCQeamB3o/upP+b2xD1hxNx+hBaBEUUtFPSGpk+lUnCAVNebNYueAw2JldC23QbQA== X-Received: by 2002:a05:600c:2116:b0:3f4:298f:4cf2 with SMTP id u22-20020a05600c211600b003f4298f4cf2mr3918860wml.24.1684599244402; Sat, 20 May 2023 09:14:04 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q10-20020a1cf30a000000b003f423508c6bsm2602363wmq.44.2023.05.20.09.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:04 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Sat, 20 May 2023 16:13:54 +0000 Subject: [PATCH 06/10] t7700-repack: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t7700-repack.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh index faa739eeb91..3f930fa4762 100755 --- a/t/t7700-repack.sh +++ b/t/t7700-repack.sh @@ -460,10 +460,10 @@ test_expect_success '--write-midx -b packs non-kept objects' ' ' test_expect_success '--write-midx removes stale pack-based bitmaps' ' - rm -fr repo && - git init repo && - test_when_finished "rm -fr repo" && - ( + rm -fr repo && + git init repo && + test_when_finished "rm -fr repo" && + ( cd repo && test_commit base && GIT_TEST_MULTI_PACK_INDEX=0 git repack -Ab && @@ -477,7 +477,7 @@ test_expect_success '--write-midx removes stale pack-based bitmaps' ' test_path_is_file $midx && test_path_is_file $midx-$(midx_checksum $objdir).bitmap && test_path_is_missing $pack_bitmap - ) + ) ' test_expect_success '--write-midx with --pack-kept-objects' ' From patchwork Sat May 20 16:13:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9053BC77B7A for ; Sat, 20 May 2023 16:14:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231898AbjETQOQ (ORCPT ); Sat, 20 May 2023 12:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231865AbjETQOH (ORCPT ); Sat, 20 May 2023 12:14:07 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAF64DB for ; Sat, 20 May 2023 09:14:06 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-30a4ebbda56so375650f8f.1 for ; Sat, 20 May 2023 09:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599245; x=1687191245; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=jzsGqgsevrUhodzdFAxQK9whsckAIVJLXwzvdwvULrk=; b=D7tnqNWGWiffWmYmoitRWGUf2vNY1WaPBj7moCcc33f8jAnens0dRI9s2h6P9G+yLc E5BIo0W3KT2an+5HwZ5jPJUwKD0zk3+fzduo2dvO5X9eazUOfcYV/GNfITUq/PH7qruy VbZ63tK0TONLZpPxtv5oreYjYKGQE/uYgDY9JmP+VfZSCkSfdH7WROFW/VXizT9gUKnK dy5H+YJB5J7nYY5Q2+GwiC2RC0R9q+VdBq1JDivw8XSk7nv30iPQ54BbzB0e8HmA+NkI gNb/DcTE1iNDl3rMXh79lvpmSm4DSsFiagZCin4MPeESrrqzSe/X0Fr4oV9AI3sd2zzP /ctA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599245; x=1687191245; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jzsGqgsevrUhodzdFAxQK9whsckAIVJLXwzvdwvULrk=; b=JrodFxu3irlqcpwQGE/ri2slHQJXYt0Tk23o/apQ5eH0A5bwPGes4rx2L7x0U+rHH9 XBVTtX5rw6MG+OZB4AFXsc8Ii9wn/XHgH4+EMs9ROu/3QWjdVcOB45hNkLXcrXFld6AS 9DV+gjzcrpH0Gn0jK1KrGZYekzgM8xprUetiaIVNRpqiHZJPevgXNrR/UNNcPfkw3eAE K8ZwgcdWZmCZ/g9RkH6cS1wv9OBaO3R2U+gfGwDvZgCB6PVLk/JQDngq2FYI2edYjoPt CB+K4QY6pKDtpwrc3AQ1quCeIqnw3YVZzg10IcizIMVe2qeiCaXoVMQqqA0gsBwD2rgc 0w7w== X-Gm-Message-State: AC+VfDyLdjpxKjnvEgYzGVTKGTssMOwsmgzU/zKVerVq+iwGObQIyiKL XKbXk35/blJqU+6MjAnCC6BDueCKyZk= X-Google-Smtp-Source: ACHHUZ78Pg3BkGzGPmSYHX4p0o8GsvauVawqnM2MvLYVMlbjfMHzff/M0dLbGy3T6UMVvwPsFR+XUA== X-Received: by 2002:a05:6000:1052:b0:301:2452:e4d with SMTP id c18-20020a056000105200b0030124520e4dmr4112978wrx.46.1684599244918; Sat, 20 May 2023 09:14:04 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o5-20020a5d62c5000000b003068f5cca8csm2307573wrv.94.2023.05.20.09.14.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:04 -0700 (PDT) Message-Id: <86b3b91d94ec7bb8f296d69ee226cc8bb37c9300.1684599239.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 20 May 2023 16:13:55 +0000 Subject: [PATCH 07/10] t9100-git-svn-basic: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t9100-git-svn-basic.sh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh index fea41b3c360..af28b01fefa 100755 --- a/t/t9100-git-svn-basic.sh +++ b/t/t9100-git-svn-basic.sh @@ -21,7 +21,7 @@ test_expect_success 'git svn help works anywhere' ' ' test_expect_success \ - 'initialize git svn' ' + 'initialize git svn' ' mkdir import && ( cd import && @@ -38,9 +38,9 @@ test_expect_success \ rm -rf import && git svn init "$svnrepo"' -test_expect_success \ - 'import an SVN revision into git' \ - 'git svn fetch' +test_expect_success 'import an SVN revision into git' ' + git svn fetch +' test_expect_success "checkout from svn" 'svn co "$svnrepo" "$SVN_TREE"' @@ -233,27 +233,26 @@ test_expect_success POSIXPERM,SYMLINKS "$name" ' ' test_expect_success 'exit if remote refs are ambigious' ' - git config --add svn-remote.svn.fetch \ + git config --add svn-remote.svn.fetch \ bar:refs/remotes/git-svn && test_must_fail git svn migrate ' test_expect_success 'exit if init-ing a would clobber a URL' ' - svnadmin create "${PWD}/svnrepo2" && - svn mkdir -m "mkdir bar" "${svnrepo}2/bar" && - git config --unset svn-remote.svn.fetch \ + svnadmin create "${PWD}/svnrepo2" && + svn mkdir -m "mkdir bar" "${svnrepo}2/bar" && + git config --unset svn-remote.svn.fetch \ "^bar:refs/remotes/git-svn$" && test_must_fail git svn init "${svnrepo}2/bar" ' -test_expect_success \ - 'init allows us to connect to another directory in the same repo' ' - git svn init --minimize-url -i bar "$svnrepo/bar" && - git config --get svn-remote.svn.fetch \ - "^bar:refs/remotes/bar$" && - git config --get svn-remote.svn.fetch \ - "^:refs/remotes/git-svn$" - ' +test_expect_success 'init allows us to connect to another directory in the same repo' ' + git svn init --minimize-url -i bar "$svnrepo/bar" && + git config --get svn-remote.svn.fetch \ + "^bar:refs/remotes/bar$" && + git config --get svn-remote.svn.fetch \ + "^:refs/remotes/git-svn$" +' test_expect_success 'dcommit $rev does not clobber current branch' ' git svn fetch -i bar && From patchwork Sat May 20 16:13:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249244 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AA54C77B7A for ; Sat, 20 May 2023 16:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231910AbjETQOT (ORCPT ); Sat, 20 May 2023 12:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231871AbjETQOJ (ORCPT ); Sat, 20 May 2023 12:14:09 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B6DC125 for ; Sat, 20 May 2023 09:14:07 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3078a3f3b5fso4283131f8f.0 for ; Sat, 20 May 2023 09:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599245; x=1687191245; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Gp2FfDi4NI533e1tiQOcF3r2CbgruwrIgxMPr/37MLw=; b=BNoAlcTHP0lkcmua1wKu/czFO0NnJvVXw3FBrbFb99XL2Tqoj/ZLbb5fVJib8pMlub bQyI+EptJEiD9eZmdiuuz1rwqnRcuYKhyo20AWkPHtSSSBreJYqTllE5hHr7alVyh8/3 7tU9F9XNRi9VOKDwf8o4+iXySf55PNDMUk6fJytH8gAnyWnvf+kurHJ6hUmdKnER2H5+ JrXcmtU+YwmfAWONKgAUYGf1DdJmRXY92ktJ2lzGIkwddVVEPUfnHay4iUS4vcGo4+9h sM2RopsGQZUTmb8utDRauQ68ebKISXcKRyTuN4pMo1GK8emViR1hNrjLWHdbDwAWCzOL 0qtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599245; x=1687191245; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gp2FfDi4NI533e1tiQOcF3r2CbgruwrIgxMPr/37MLw=; b=mE3sP7/NKogWWMJa8Vi1wfHhScxfkiD3byexFk+YXBNF8J5Jxvr4ecQIxihSfhqVGN eap3g/WA86yIamynaxLBoWCq2fO0xbmAvCM338hHSByfHWmoza+dY+GslFfv7O3uFAW/ LHdJkC/xGufpk+/PvHMsgayrMx8vy1xnSAivoNR12/AEYsDhnjIjupltusxrQrtMofRD mSrQQAvLDybHsj36cAtpsHXYxd9SLWIVwYW/OeTwxGfMEdXLA5fem6vJW633FoEUg99R IWUxtYxp7Ri6q1NnYgCWmprtCWOiudsIJg104JtsegZH0GnFlfo0qXS87hrKbNpnLF9G /S1Q== X-Gm-Message-State: AC+VfDxo7XozEt6KFO2PdCzv+FsPMhPhwgemyQizKyhOeBAN4h95sjQH keWPq90zCbdIKgSoJpgieDrTS1ZGa18= X-Google-Smtp-Source: ACHHUZ4aLfniEy0RD64OSLveXYjC/vXcHpgRgtxlONzFLsOAofMiKZ35Ek8UclYrsIhVOx1UKY0iTw== X-Received: by 2002:adf:fe89:0:b0:309:45cc:577a with SMTP id l9-20020adffe89000000b0030945cc577amr4221572wrr.13.1684599245640; Sat, 20 May 2023 09:14:05 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id d25-20020a1c7319000000b003f4ddde398csm2709477wmb.21.2023.05.20.09.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:05 -0700 (PDT) Message-Id: <5a767913a569ade7b2596e89cae887c878447a72.1684599239.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 20 May 2023 16:13:56 +0000 Subject: [PATCH 08/10] t9104-git-svn-follow-parent: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t9104-git-svn-follow-parent.sh | 62 ++++++++++++++++---------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh index 85d735861fc..b5845e28fee 100755 --- a/t/t9104-git-svn-follow-parent.sh +++ b/t/t9104-git-svn-follow-parent.sh @@ -41,51 +41,51 @@ test_expect_success 'init and fetch a moved directory' ' ' test_expect_success 'init and fetch from one svn-remote' ' - git config svn-remote.svn.url "$svnrepo" && - git config --add svn-remote.svn.fetch \ - trunk:refs/remotes/svn/trunk && - git config --add svn-remote.svn.fetch \ - thunk:refs/remotes/svn/thunk && - git svn fetch -i svn/thunk && + git config svn-remote.svn.url "$svnrepo" && + git config --add svn-remote.svn.fetch \ + trunk:refs/remotes/svn/trunk && + git config --add svn-remote.svn.fetch \ + thunk:refs/remotes/svn/thunk && + git svn fetch -i svn/thunk && test "$(git rev-parse --verify refs/remotes/svn/trunk)" \ - = "$(git rev-parse --verify refs/remotes/svn/thunk~1)" && + = "$(git rev-parse --verify refs/remotes/svn/thunk~1)" && git cat-file blob refs/remotes/svn/thunk:readme >actual && test "$(sed -n -e "3p" actual)" = goodbye - ' +' test_expect_success 'follow deleted parent' ' - (svn_cmd cp -m "resurrecting trunk as junk" \ - "$svnrepo"/trunk@2 "$svnrepo"/junk || - svn cp -m "resurrecting trunk as junk" \ - -r2 "$svnrepo"/trunk "$svnrepo"/junk) && - git config --add svn-remote.svn.fetch \ - junk:refs/remotes/svn/junk && - git svn fetch -i svn/thunk && - git svn fetch -i svn/junk && + (svn_cmd cp -m "resurrecting trunk as junk" \ + "$svnrepo"/trunk@2 "$svnrepo"/junk || + svn cp -m "resurrecting trunk as junk" \ + -r2 "$svnrepo"/trunk "$svnrepo"/junk) && + git config --add svn-remote.svn.fetch \ + junk:refs/remotes/svn/junk && + git svn fetch -i svn/thunk && + git svn fetch -i svn/junk && test -z "$(git diff svn/junk svn/trunk)" && test "$(git merge-base svn/junk svn/trunk)" \ - = "$(git rev-parse svn/trunk)" - ' + = "$(git rev-parse svn/trunk)" +' test_expect_success 'follow larger parent' ' - mkdir -p import/trunk/thunk/bump/thud && - echo hi > import/trunk/thunk/bump/thud/file && - svn import -m "import a larger parent" import "$svnrepo"/larger-parent && - svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger && - git svn init --minimize-url -i larger \ - "$svnrepo"/larger-parent/trunk/thunk/bump/thud && - git svn fetch -i larger && + mkdir -p import/trunk/thunk/bump/thud && + echo hi > import/trunk/thunk/bump/thud/file && + svn import -m "import a larger parent" import "$svnrepo"/larger-parent && + svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger && + git svn init --minimize-url -i larger \ + "$svnrepo"/larger-parent/trunk/thunk/bump/thud && + git svn fetch -i larger && git svn init --minimize-url -i larger-parent \ - "$svnrepo"/another-larger/trunk/thunk/bump/thud && + "$svnrepo"/another-larger/trunk/thunk/bump/thud && git svn fetch -i larger-parent && - git rev-parse --verify refs/remotes/larger && - git rev-parse --verify \ - refs/remotes/larger-parent && + git rev-parse --verify refs/remotes/larger && + git rev-parse --verify \ + refs/remotes/larger-parent && test "$(git merge-base \ refs/remotes/larger-parent \ refs/remotes/larger)" = \ - "$(git rev-parse refs/remotes/larger)" - ' + "$(git rev-parse refs/remotes/larger)" +' test_expect_success 'follow higher-level parent' ' svn mkdir -m "follow higher-level parent" "$svnrepo"/blob && From patchwork Sat May 20 16:13:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D20FDC77B7A for ; Sat, 20 May 2023 16:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231945AbjETQO1 (ORCPT ); Sat, 20 May 2023 12:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231868AbjETQOR (ORCPT ); Sat, 20 May 2023 12:14:17 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E21310A for ; Sat, 20 May 2023 09:14:08 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f41d087a84so13022975e9.1 for ; Sat, 20 May 2023 09:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599246; x=1687191246; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=d1TGazJy898k5wxyTYl93NPRr+S0GZ3T/j5KJOKpJ/o=; b=E1tYhNvlz6fzxeSlw/g6Bjh8fu/dcOgaVTIjQqn6JErg/S18fJo04NEcBkrob8yJho N+gzFdSGQdn95xrwDUPDx3GJejNouX2vWru25VgW9se/o/qjaeqH7/V6vuIYdjjEPxOf WazFqUauZMc1cbvfs8uUgtS/kORjhvhq3PeoDf0dTXGDt1Z+Xf1khu8V0yCRKOPJuXVh xhcH0XDw19hQVcKjp3nT5hrxTu7cSAJh8pz5MVOggsX4eZy7CQa48HVolSBHAuVxhFma uOxVfdy/Hq/TuGvVAZL6arvAKjJ/U8Yp/Sz2RLqfU/oTbjYwhG3/+bRRxKbkXj6qcjgu cUdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599246; x=1687191246; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d1TGazJy898k5wxyTYl93NPRr+S0GZ3T/j5KJOKpJ/o=; b=XU3kFcruHB6YBZTfwQbRHM50YdoepHb5+4NsH/NX6/X+umqMniXJ4UxPTIdL3EQYdY GLmgIQUN/LWihWsfTqlS1LvsRI8CysbXc6Lg0/AyQ0QC56QHE8W/T6xa4iAYKr+XgvrF idc5IFnfPV5vRbcK6jopIlCS//ab+sfEiGkQC0DiAFcl5PxGy/FUkdKv3gHOpf8XAD0k SnueCYDjuobv/D4r+XP1sXzjMd0kyrk8o/eiCTFJ+TCFyv6w7KEQRN0wjD7UAjcHC5wD mqfPkSRJyskTM5R3djpXxQONSgYCiR3YXEvDc5b+XKoy8/cHbR4RBsjFf6iY7PRrvx1T KVcg== X-Gm-Message-State: AC+VfDw0/oT0aCemGDCvMPsr//VHirRfxW0Yr8WqmJrkITyr932vQl+z 3THgBia1Jx42JLJ1vXBgwzzupNb+2Nc= X-Google-Smtp-Source: ACHHUZ5ak9l1dw0skxND5MNS2zcgH6XOtcXaYnjoyy3VgA2yspCFIhtdpYhqgr3YH+lZVpgg4Tk9IA== X-Received: by 2002:a1c:7503:0:b0:3f5:e29:bcde with SMTP id o3-20020a1c7503000000b003f50e29bcdemr4208545wmc.17.1684599246417; Sat, 20 May 2023 09:14:06 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id g3-20020a7bc4c3000000b003f427687ba7sm2631108wmk.41.2023.05.20.09.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:05 -0700 (PDT) Message-Id: <01f752d38c6fe38351410540514c1408948fe65e.1684599239.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 20 May 2023 16:13:57 +0000 Subject: [PATCH 09/10] t9200-git-cvsexportcommit: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t9200-git-cvsexportcommit.sh | 351 ++++++++++++++++----------------- 1 file changed, 175 insertions(+), 176 deletions(-) diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh index c5946cb0b8a..a44eabf0d80 100755 --- a/t/t9200-git-cvsexportcommit.sh +++ b/t/t9200-git-cvsexportcommit.sh @@ -50,56 +50,56 @@ check_entries () { fi } -test_expect_success \ - 'New file' \ - 'mkdir A B C D E F && - echo hello1 >A/newfile1.txt && - echo hello2 >B/newfile2.txt && - cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png && - cp "$TEST_DIRECTORY"/test-binary-1.png D/newfile4.png && - git add A/newfile1.txt && - git add B/newfile2.txt && - git add C/newfile3.png && - git add D/newfile4.png && - git commit -a -m "Test: New file" && - id=$(git rev-list --max-count=1 HEAD) && - (cd "$CVSWORK" && - git cvsexportcommit -c $id && - check_entries A "newfile1.txt/1.1/" && - check_entries B "newfile2.txt/1.1/" && - check_entries C "newfile3.png/1.1/-kb" && - check_entries D "newfile4.png/1.1/-kb" && - test_cmp A/newfile1.txt ../A/newfile1.txt && - test_cmp B/newfile2.txt ../B/newfile2.txt && - test_cmp C/newfile3.png ../C/newfile3.png && - test_cmp D/newfile4.png ../D/newfile4.png - )' +test_expect_success 'New file' ' + mkdir A B C D E F && + echo hello1 >A/newfile1.txt && + echo hello2 >B/newfile2.txt && + cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png && + cp "$TEST_DIRECTORY"/test-binary-1.png D/newfile4.png && + git add A/newfile1.txt && + git add B/newfile2.txt && + git add C/newfile3.png && + git add D/newfile4.png && + git commit -a -m "Test: New file" && + id=$(git rev-list --max-count=1 HEAD) && + (cd "$CVSWORK" && + git cvsexportcommit -c $id && + check_entries A "newfile1.txt/1.1/" && + check_entries B "newfile2.txt/1.1/" && + check_entries C "newfile3.png/1.1/-kb" && + check_entries D "newfile4.png/1.1/-kb" && + test_cmp A/newfile1.txt ../A/newfile1.txt && + test_cmp B/newfile2.txt ../B/newfile2.txt && + test_cmp C/newfile3.png ../C/newfile3.png && + test_cmp D/newfile4.png ../D/newfile4.png + ) +' -test_expect_success \ - 'Remove two files, add two and update two' \ - 'echo Hello1 >>A/newfile1.txt && - rm -f B/newfile2.txt && - rm -f C/newfile3.png && - echo Hello5 >E/newfile5.txt && - cp "$TEST_DIRECTORY"/test-binary-2.png D/newfile4.png && - cp "$TEST_DIRECTORY"/test-binary-1.png F/newfile6.png && - git add E/newfile5.txt && - git add F/newfile6.png && - git commit -a -m "Test: Remove, add and update" && - id=$(git rev-list --max-count=1 HEAD) && - (cd "$CVSWORK" && - git cvsexportcommit -c $id && - check_entries A "newfile1.txt/1.2/" && - check_entries B "" && - check_entries C "" && - check_entries D "newfile4.png/1.2/-kb" && - check_entries E "newfile5.txt/1.1/" && - check_entries F "newfile6.png/1.1/-kb" && - test_cmp A/newfile1.txt ../A/newfile1.txt && - test_cmp D/newfile4.png ../D/newfile4.png && - test_cmp E/newfile5.txt ../E/newfile5.txt && - test_cmp F/newfile6.png ../F/newfile6.png - )' +test_expect_success 'Remove two files, add two and update two' ' + echo Hello1 >>A/newfile1.txt && + rm -f B/newfile2.txt && + rm -f C/newfile3.png && + echo Hello5 >E/newfile5.txt && + cp "$TEST_DIRECTORY"/test-binary-2.png D/newfile4.png && + cp "$TEST_DIRECTORY"/test-binary-1.png F/newfile6.png && + git add E/newfile5.txt && + git add F/newfile6.png && + git commit -a -m "Test: Remove, add and update" && + id=$(git rev-list --max-count=1 HEAD) && + (cd "$CVSWORK" && + git cvsexportcommit -c $id && + check_entries A "newfile1.txt/1.2/" && + check_entries B "" && + check_entries C "" && + check_entries D "newfile4.png/1.2/-kb" && + check_entries E "newfile5.txt/1.1/" && + check_entries F "newfile6.png/1.1/-kb" && + test_cmp A/newfile1.txt ../A/newfile1.txt && + test_cmp D/newfile4.png ../D/newfile4.png && + test_cmp E/newfile5.txt ../E/newfile5.txt && + test_cmp F/newfile6.png ../F/newfile6.png + ) +' # Should fail (but only on the git cvsexportcommit stage) test_expect_success \ @@ -129,67 +129,67 @@ test_expect_success \ # This test is here because a patch for only binary files will # fail with gnu patch, so cvsexportcommit must handle that. -test_expect_success \ - 'Remove only binary files' \ - 'git reset --hard HEAD^^ && - rm -f D/newfile4.png && - git commit -a -m "test: remove only a binary file" && - id=$(git rev-list --max-count=1 HEAD) && - (cd "$CVSWORK" && - git cvsexportcommit -c $id && - check_entries A "newfile1.txt/1.2/" && - check_entries B "" && - check_entries C "" && - check_entries D "" && - check_entries E "newfile5.txt/1.1/" && - check_entries F "newfile6.png/1.1/-kb" && - test_cmp A/newfile1.txt ../A/newfile1.txt && - test_cmp E/newfile5.txt ../E/newfile5.txt && - test_cmp F/newfile6.png ../F/newfile6.png - )' +test_expect_success 'Remove only binary files' ' + git reset --hard HEAD^^ && + rm -f D/newfile4.png && + git commit -a -m "test: remove only a binary file" && + id=$(git rev-list --max-count=1 HEAD) && + (cd "$CVSWORK" && + git cvsexportcommit -c $id && + check_entries A "newfile1.txt/1.2/" && + check_entries B "" && + check_entries C "" && + check_entries D "" && + check_entries E "newfile5.txt/1.1/" && + check_entries F "newfile6.png/1.1/-kb" && + test_cmp A/newfile1.txt ../A/newfile1.txt && + test_cmp E/newfile5.txt ../E/newfile5.txt && + test_cmp F/newfile6.png ../F/newfile6.png + ) +' -test_expect_success \ - 'Remove only a text file' \ - 'rm -f A/newfile1.txt && - git commit -a -m "test: remove only a binary file" && - id=$(git rev-list --max-count=1 HEAD) && - (cd "$CVSWORK" && - git cvsexportcommit -c $id && - check_entries A "" && - check_entries B "" && - check_entries C "" && - check_entries D "" && - check_entries E "newfile5.txt/1.1/" && - check_entries F "newfile6.png/1.1/-kb" && - test_cmp E/newfile5.txt ../E/newfile5.txt && - test_cmp F/newfile6.png ../F/newfile6.png - )' +test_expect_success 'Remove only a text file' ' + rm -f A/newfile1.txt && + git commit -a -m "test: remove only a binary file" && + id=$(git rev-list --max-count=1 HEAD) && + (cd "$CVSWORK" && + git cvsexportcommit -c $id && + check_entries A "" && + check_entries B "" && + check_entries C "" && + check_entries D "" && + check_entries E "newfile5.txt/1.1/" && + check_entries F "newfile6.png/1.1/-kb" && + test_cmp E/newfile5.txt ../E/newfile5.txt && + test_cmp F/newfile6.png ../F/newfile6.png + ) +' -test_expect_success \ - 'New file with spaces in file name' \ - 'mkdir "G g" && - echo ok then >"G g/with spaces.txt" && - git add "G g/with spaces.txt" && \ - cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \ - git add "G g/with spaces.png" && - git commit -a -m "With spaces" && - id=$(git rev-list --max-count=1 HEAD) && - (cd "$CVSWORK" && - git cvsexportcommit -c $id && - check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/" - )' +test_expect_success 'New file with spaces in file name' ' + mkdir "G g" && + echo ok then >"G g/with spaces.txt" && + git add "G g/with spaces.txt" && \ + cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \ + git add "G g/with spaces.png" && + git commit -a -m "With spaces" && + id=$(git rev-list --max-count=1 HEAD) && + (cd "$CVSWORK" && + git cvsexportcommit -c $id && + check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/" + ) +' -test_expect_success \ - 'Update file with spaces in file name' \ - 'echo Ok then >>"G g/with spaces.txt" && - cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \ - git add "G g/with spaces.png" && - git commit -a -m "Update with spaces" && - id=$(git rev-list --max-count=1 HEAD) && - (cd "$CVSWORK" && - git cvsexportcommit -c $id && - check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/" - )' +test_expect_success 'Update file with spaces in file name' ' + echo Ok then >>"G g/with spaces.txt" && + cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \ + git add "G g/with spaces.png" && + git commit -a -m "Update with spaces" && + id=$(git rev-list --max-count=1 HEAD) && + (cd "$CVSWORK" && + git cvsexportcommit -c $id && + check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/" + ) +' # Some filesystems mangle pathnames with UTF-8 characters -- # check and skip @@ -202,68 +202,68 @@ if p="Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" && then # This test contains UTF-8 characters -test_expect_success !MINGW \ - 'File with non-ascii file name' \ - 'mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö && - echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt && - git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt && - cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png && - git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png && - git commit -a -m "Går det så går det" && \ - id=$(git rev-list --max-count=1 HEAD) && - (cd "$CVSWORK" && - git cvsexportcommit -v -c $id && - check_entries \ - "Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" \ - "gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/" - )' +test_expect_success !MINGW 'File with non-ascii file name' ' + mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö && + echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt && + git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt && + cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png && + git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png && + git commit -a -m "Går det så går det" && \ + id=$(git rev-list --max-count=1 HEAD) && + (cd "$CVSWORK" && + git cvsexportcommit -v -c $id && + check_entries \ + "Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" \ + "gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/" + ) +' fi rm -fr tst -test_expect_success \ - 'Mismatching patch should fail' \ - 'date >>"E/newfile5.txt" && - git add "E/newfile5.txt" && - git commit -a -m "Update one" && - date >>"E/newfile5.txt" && - git add "E/newfile5.txt" && - git commit -a -m "Update two" && - id=$(git rev-list --max-count=1 HEAD) && - (cd "$CVSWORK" && - test_must_fail git cvsexportcommit -c $id - )' - -test_expect_success FILEMODE \ - 'Retain execute bit' \ - 'mkdir G && - echo executeon >G/on && - chmod +x G/on && - echo executeoff >G/off && - git add G/on && - git add G/off && - git commit -a -m "Execute test" && - (cd "$CVSWORK" && - git cvsexportcommit -c HEAD && - test -x G/on && - ! test -x G/off - )' +test_expect_success 'Mismatching patch should fail' ' + date >>"E/newfile5.txt" && + git add "E/newfile5.txt" && + git commit -a -m "Update one" && + date >>"E/newfile5.txt" && + git add "E/newfile5.txt" && + git commit -a -m "Update two" && + id=$(git rev-list --max-count=1 HEAD) && + (cd "$CVSWORK" && + test_must_fail git cvsexportcommit -c $id + ) +' + +test_expect_success FILEMODE 'Retain execute bit' ' + mkdir G && + echo executeon >G/on && + chmod +x G/on && + echo executeoff >G/off && + git add G/on && + git add G/off && + git commit -a -m "Execute test" && + (cd "$CVSWORK" && + git cvsexportcommit -c HEAD && + test -x G/on && + ! test -x G/off + ) +' test_expect_success '-w option should work with relative GIT_DIR' ' - mkdir W && - echo foobar >W/file1.txt && - echo bazzle >W/file2.txt && - git add W/file1.txt && - git add W/file2.txt && - git commit -m "More updates" && - id=$(git rev-list --max-count=1 HEAD) && - (cd "$GIT_DIR" && - GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id && - check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" && - test_cmp "$CVSWORK/W/file1.txt" ../W/file1.txt && - test_cmp "$CVSWORK/W/file2.txt" ../W/file2.txt - ) + mkdir W && + echo foobar >W/file1.txt && + echo bazzle >W/file2.txt && + git add W/file1.txt && + git add W/file2.txt && + git commit -m "More updates" && + id=$(git rev-list --max-count=1 HEAD) && + (cd "$GIT_DIR" && + GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id && + check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" && + test_cmp "$CVSWORK/W/file1.txt" ../W/file1.txt && + test_cmp "$CVSWORK/W/file2.txt" ../W/file2.txt + ) ' test_expect_success 'check files before directories' ' @@ -290,21 +290,20 @@ test_expect_success 'check files before directories' ' ' test_expect_success 're-commit a removed filename which remains in CVS attic' ' - - (cd "$CVSWORK" && - echo >attic_gremlin && - cvs -Q add attic_gremlin && - cvs -Q ci -m "added attic_gremlin" && - rm attic_gremlin && - cvs -Q rm attic_gremlin && - cvs -Q ci -m "removed attic_gremlin") && - - echo > attic_gremlin && - git add attic_gremlin && - git commit -m "Added attic_gremlin" && + (cd "$CVSWORK" && + echo >attic_gremlin && + cvs -Q add attic_gremlin && + cvs -Q ci -m "added attic_gremlin" && + rm attic_gremlin && + cvs -Q rm attic_gremlin && + cvs -Q ci -m "removed attic_gremlin") && + + echo > attic_gremlin && + git add attic_gremlin && + git commit -m "Added attic_gremlin" && git cvsexportcommit -w "$CVSWORK" -c HEAD && - (cd "$CVSWORK" && cvs -Q update -d) && - test -f "$CVSWORK/attic_gremlin" + (cd "$CVSWORK" && cvs -Q update -d) && + test -f "$CVSWORK/attic_gremlin" ' # the state of the CVS sandbox may be indeterminate for ' space' From patchwork Sat May 20 16:13:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13249246 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CDE9C77B7F for ; Sat, 20 May 2023 16:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231922AbjETQO3 (ORCPT ); Sat, 20 May 2023 12:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231873AbjETQOZ (ORCPT ); Sat, 20 May 2023 12:14:25 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC9D3134 for ; Sat, 20 May 2023 09:14:08 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-306dbad5182so2828004f8f.1 for ; Sat, 20 May 2023 09:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684599247; x=1687191247; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=J3ApEPrKyxK3yGm9+ENIqBlijwSY/g5JuPIFy5wRFBc=; b=ABh/4zPyxx9zEQpiwZbJ7quTPzkQJrqMicELQCPwIbM+NVVURNaRFAtEUlvpH27x3b 4bodEY18T8CgtAMe11SPHbsxdd3pg5WjQCeFeBvz4m9rTH6Mo4WTR1k7gLgIXin8m5pZ clmYYdVHf1ThRp8YizxV9eHShqFe9MsjTIAAOtTz66WX6YU8CVvVueQj6dLx5l9FsnKT Ii/5C+aee9w2A/jkWxvCQzz6zXOQlwBGLO5Ecs42RC8GJYPGtNv1Yl0KJNnXZIsY9+nK atQVW/z1Vl5C34gKOY6moz38c9IDVPNRaMEUzgYzewiN90iY/hQ8FqWQwUeEue1J+oBC J4QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599247; x=1687191247; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J3ApEPrKyxK3yGm9+ENIqBlijwSY/g5JuPIFy5wRFBc=; b=cW/Qtp83TLkLd/lIvY1X82E6FzV6ZcxBlYagAqfLoKBOhrsl7aG92YOiIekPKXqSZ5 GafST6gwLM+3riJzfF7HbIyxIxO2WrTws5VZDUm6pYLCkFpmIojVlKwMMkQnmORo19x5 +zwSrdflLtgSkPBxp09YXLeO41WS5oocNbJp5QwaDP4cAVPtrTnPkN/wkbORMRD+80kC LyWnWGpZjRaXXJOmgR185epB34STKK9n0G32F0mcc7XcIs10ZWPHqAUJZUWbuwf3ZQ7V bOwNiSJ4mFZ1I1mv5GHXgREuKmAx4+sDxuC1VspUVlRo0Gqj6gz3PgPkzZPMh0/fjkq6 0hhw== X-Gm-Message-State: AC+VfDwLqTXr1c90n9iVCF8c64pMHLKi0un2zABF889xO2Ngt6Uciie1 Ntavq2zcSwWggMm8K97sNTH1Qr8eoZ0= X-Google-Smtp-Source: ACHHUZ7Jfdpp6L+Z8cONfbPijpQpknJ9x3xagotsvph9fdx71LNpVWkrbf/fBRz92qCGPlr6vAfhGA== X-Received: by 2002:adf:e60b:0:b0:309:a4e:52d3 with SMTP id p11-20020adfe60b000000b003090a4e52d3mr4814348wrm.5.1684599246901; Sat, 20 May 2023 09:14:06 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z12-20020a5d640c000000b00307c8d6b4a0sm2344428wru.26.2023.05.20.09.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:14:06 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Sat, 20 May 2023 16:13:58 +0000 Subject: [PATCH 10/10] t9400-git-cvsserver-server: modernize test format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai --- t/t9400-git-cvsserver-server.sh | 530 +++++++++++++++++--------------- 1 file changed, 278 insertions(+), 252 deletions(-) diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh index 379b19f2f85..003c0b61d0f 100755 --- a/t/t9400-git-cvsserver-server.sh +++ b/t/t9400-git-cvsserver-server.sh @@ -66,10 +66,11 @@ test_expect_success 'setup' ' # note that cvs doesn't accept absolute pathnames # as argument to co -d -test_expect_success 'basic checkout' \ - 'GIT_CONFIG="$git_config" cvs -Q co -d cvswork main && - test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" && - test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"' +test_expect_success 'basic checkout' ' + GIT_CONFIG="$git_config" cvs -Q co -d cvswork main && + test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" && + test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/" +' #------------------------ # PSERVER AUTHENTICATION @@ -115,35 +116,40 @@ Ahlog 2>&1 && - sed -ne \$p log | grep "^I LOVE YOU\$"' +test_expect_success 'pserver authentication' ' + cat request-anonymous | git-cvsserver pserver >log 2>&1 && + sed -ne \$p log | grep "^I LOVE YOU\$" +' -test_expect_success 'pserver authentication failure (non-anonymous user)' \ - 'if cat request-git | git-cvsserver pserver >log 2>&1 - then - false - else - true - fi && - sed -ne \$p log | grep "^I HATE YOU\$"' +test_expect_success 'pserver authentication failure (non-anonymous user)' ' + if cat request-git | git-cvsserver pserver >log 2>&1 + then + false + else + true + fi && + sed -ne \$p log | grep "^I HATE YOU\$" +' -test_expect_success 'pserver authentication success (non-anonymous user with password)' \ - 'cat login-git-ok | git-cvsserver pserver >log 2>&1 && - sed -ne \$p log | grep "^I LOVE YOU\$"' +test_expect_success 'pserver authentication success (non-anonymous user with password)' ' + cat login-git-ok | git-cvsserver pserver >log 2>&1 && + sed -ne \$p log | grep "^I LOVE YOU\$" +' -test_expect_success 'pserver authentication (login)' \ - 'cat login-anonymous | git-cvsserver pserver >log 2>&1 && - sed -ne \$p log | grep "^I LOVE YOU\$"' +test_expect_success 'pserver authentication (login)' ' + cat login-anonymous | git-cvsserver pserver >log 2>&1 && + sed -ne \$p log | grep "^I LOVE YOU\$" +' -test_expect_success 'pserver authentication failure (login/non-anonymous user)' \ - 'if cat login-git | git-cvsserver pserver >log 2>&1 - then - false - else - true - fi && - sed -ne \$p log | grep "^I HATE YOU\$"' +test_expect_success 'pserver authentication failure (login/non-anonymous user)' ' + if cat login-git | git-cvsserver pserver >log 2>&1 + then + false + else + true + fi && + sed -ne \$p log | grep "^I HATE YOU\$" +' # misuse pserver authentication for testing of req_Root @@ -165,36 +171,40 @@ END AUTH REQUEST Root $WORKDIR EOF -test_expect_success 'req_Root failure (relative pathname)' \ - 'if cat request-relative | git-cvsserver pserver >log 2>&1 - then - echo unexpected success - false - else - true - fi && - tail log | grep "^error 1 Root must be an absolute pathname$"' +test_expect_success 'req_Root failure (relative pathname)' ' + if cat request-relative | git-cvsserver pserver >log 2>&1 + then + echo unexpected success + false + else + true + fi && + tail log | grep "^error 1 Root must be an absolute pathname$" +' -test_expect_success 'req_Root failure (conflicting roots)' \ - 'cat request-conflict | git-cvsserver pserver >log 2>&1 && - tail log | grep "^error 1 Conflicting roots specified$"' +test_expect_success 'req_Root failure (conflicting roots)' ' + cat request-conflict | git-cvsserver pserver >log 2>&1 && + tail log | grep "^error 1 Conflicting roots specified$" +' -test_expect_success 'req_Root (strict paths)' \ - 'cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 && - sed -ne \$p log | grep "^I LOVE YOU\$"' +test_expect_success 'req_Root (strict paths)' ' + cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 && + sed -ne \$p log | grep "^I LOVE YOU\$" +' test_expect_success 'req_Root failure (strict-paths)' ' - ! cat request-anonymous | - git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1 + ! cat request-anonymous | + git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1 ' -test_expect_success 'req_Root (w/o strict-paths)' \ - 'cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 && - sed -ne \$p log | grep "^I LOVE YOU\$"' +test_expect_success 'req_Root (w/o strict-paths)' ' + cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 && + sed -ne \$p log | grep "^I LOVE YOU\$" +' test_expect_success 'req_Root failure (w/o strict-paths)' ' - ! cat request-anonymous | - git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1 + ! cat request-anonymous | + git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1 ' cat >request-base <log 2>&1 && - sed -ne \$p log | grep "^I LOVE YOU\$"' +test_expect_success 'req_Root (base-path)' ' + cat request-base | git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 && + sed -ne \$p log | grep "^I LOVE YOU\$" +' test_expect_success 'req_Root failure (base-path)' ' - ! cat request-anonymous | - git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1 + ! cat request-anonymous | + git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1 ' GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false || exit 1 -test_expect_success 'req_Root (export-all)' \ - 'cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 && - sed -ne \$p log | grep "^I LOVE YOU\$"' +test_expect_success 'req_Root (export-all)' ' + cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 && + sed -ne \$p log | grep "^I LOVE YOU\$" +' -test_expect_success 'req_Root failure (export-all w/o directory list)' \ - '! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)' +test_expect_success 'req_Root failure (export-all w/o directory list)' ' + ! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)' -test_expect_success 'req_Root (everything together)' \ - 'cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 && - sed -ne \$p log | grep "^I LOVE YOU\$"' +test_expect_success 'req_Root (everything together)' ' + cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 && + sed -ne \$p log | grep "^I LOVE YOU\$" +' GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1 @@ -247,45 +260,49 @@ test_expect_success 'gitcvs.enabled = false' \ test ! -d cvswork2' rm -fr cvswork2 -test_expect_success 'gitcvs.ext.enabled = true' \ - 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true && - GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && - test_cmp cvswork cvswork2' +test_expect_success 'gitcvs.ext.enabled = true' ' + GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true && + GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && + test_cmp cvswork cvswork2 +' rm -fr cvswork2 -test_expect_success 'gitcvs.ext.enabled = false' \ - 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false && - GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true && - if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 - then - echo unexpected cvs success - false - else - true - fi && - grep "GITCVS emulation disabled" cvs.log && - test ! -d cvswork2' +test_expect_success 'gitcvs.ext.enabled = false' ' + GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false && + GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true && + if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 + then + echo unexpected cvs success + false + else + true + fi && + grep "GITCVS emulation disabled" cvs.log && + test ! -d cvswork2 +' rm -fr cvswork2 -test_expect_success 'gitcvs.dbname' \ - 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true && - GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && - test_cmp cvswork cvswork2 && - test -f "$SERVERDIR/gitcvs.ext.main.sqlite" && - cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"' +test_expect_success 'gitcvs.dbname' ' + GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true && + GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && + test_cmp cvswork cvswork2 && + test -f "$SERVERDIR/gitcvs.ext.main.sqlite" && + cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite" +' rm -fr cvswork2 -test_expect_success 'gitcvs.ext.dbname' \ - 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true && - GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite && - GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && - test_cmp cvswork cvswork2 && - test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" && - test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" && - cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"' +test_expect_success 'gitcvs.ext.dbname' ' + GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true && + GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite && + GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && + test_cmp cvswork cvswork2 && + test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" && + test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" && + cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite" +' #------------ @@ -299,109 +316,115 @@ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true && GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" || exit 1 -test_expect_success 'cvs update (create new file)' \ - 'echo testfile1 >testfile1 && - git add testfile1 && - git commit -q -m "Add testfile1" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update && - test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" && - test_cmp testfile1 ../testfile1' +test_expect_success 'cvs update (create new file)' ' + echo testfile1 >testfile1 && + git add testfile1 && + git commit -q -m "Add testfile1" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" && + test_cmp testfile1 ../testfile1 +' cd "$WORKDIR" -test_expect_success 'cvs update (update existing file)' \ - 'echo line 2 >>testfile1 && - git add testfile1 && - git commit -q -m "Append to testfile1" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update && - test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" && - test_cmp testfile1 ../testfile1' +test_expect_success 'cvs update (update existing file)' ' + echo line 2 >>testfile1 && + git add testfile1 && + git commit -q -m "Append to testfile1" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" && + test_cmp testfile1 ../testfile1 +' cd "$WORKDIR" #TODO: cvsserver doesn't support update w/o -d test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" ' - mkdir test && - echo >test/empty && - git add test && - git commit -q -m "Single Subdirectory" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update && - test ! -d test + mkdir test && + echo >test/empty && + git add test && + git commit -q -m "Single Subdirectory" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + test ! -d test ' cd "$WORKDIR" -test_expect_success 'cvs update (subdirectories)' \ - '(for dir in A A/B A/B/C A/D E; do - mkdir $dir && - echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" && - git add $dir || exit 1 - done) && - git commit -q -m "deep sub directory structure" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update -d && - (for dir in A A/B A/B/C A/D E; do - filename="file_in_$(echo $dir|sed -e "s#/# #g")" && - if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" && - test_cmp "$dir/$filename" "../$dir/$filename"; then - : - else - exit 1 - fi - done)' +test_expect_success 'cvs update (subdirectories)' ' + (for dir in A A/B A/B/C A/D E; do + mkdir $dir && + echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" && + git add $dir || exit 1 + done) && + git commit -q -m "deep sub directory structure" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update -d && + (for dir in A A/B A/B/C A/D E; do + filename="file_in_$(echo $dir|sed -e "s#/# #g")" && + if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" && + test_cmp "$dir/$filename" "../$dir/$filename"; then + : + else + exit 1 + fi + done) +' cd "$WORKDIR" -test_expect_success 'cvs update (delete file)' \ - 'git rm testfile1 && - git commit -q -m "Remove testfile1" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update && - test -z "$(grep testfile1 CVS/Entries)" && - test ! -f testfile1' +test_expect_success 'cvs update (delete file)' ' + git rm testfile1 && + git commit -q -m "Remove testfile1" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + test -z "$(grep testfile1 CVS/Entries)" && + test ! -f testfile1 +' cd "$WORKDIR" -test_expect_success 'cvs update (re-add deleted file)' \ - 'echo readded testfile >testfile1 && - git add testfile1 && - git commit -q -m "Re-Add testfile1" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update && - test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" && - test_cmp testfile1 ../testfile1' +test_expect_success 'cvs update (re-add deleted file)' ' + echo readded testfile >testfile1 && + git add testfile1 && + git commit -q -m "Re-Add testfile1" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" && + test_cmp testfile1 ../testfile1 +' cd "$WORKDIR" -test_expect_success 'cvs update (merge)' \ - 'echo Line 0 >expected && - for i in 1 2 3 4 5 6 7 - do - echo Line $i >>merge && - echo Line $i >>expected || return 1 - done && - echo Line 8 >>expected && - git add merge && - git commit -q -m "Merge test (pre-merge)" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update && - test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" && - test_cmp merge ../merge && - ( echo Line 0 && cat merge ) >merge.tmp && - mv merge.tmp merge && - cd "$WORKDIR" && - echo Line 8 >>merge && - git add merge && - git commit -q -m "Merge test (merge)" && - git push gitcvs.git >/dev/null && - cd cvswork && - sleep 1 && touch merge && - GIT_CONFIG="$git_config" cvs -Q update && - test_cmp merge ../expected' +test_expect_success 'cvs update (merge)' ' + echo Line 0 >expected && + for i in 1 2 3 4 5 6 7 + do + echo Line $i >>merge && + echo Line $i >>expected || return 1 + done && + echo Line 8 >>expected && + git add merge && + git commit -q -m "Merge test (pre-merge)" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" && + test_cmp merge ../merge && + ( echo Line 0 && cat merge ) >merge.tmp && + mv merge.tmp merge && + cd "$WORKDIR" && + echo Line 8 >>merge && + git add merge && + git commit -q -m "Merge test (merge)" && + git push gitcvs.git >/dev/null && + cd cvswork && + sleep 1 && touch merge && + GIT_CONFIG="$git_config" cvs -Q update && + test_cmp merge ../expected +' cd "$WORKDIR" @@ -418,55 +441,58 @@ do echo Line $i >>expected.C done -test_expect_success 'cvs update (conflict merge)' \ - '( echo LINE 0 && cat merge ) >merge.tmp && - mv merge.tmp merge && - git add merge && - git commit -q -m "Merge test (conflict)" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update && - test_cmp merge ../expected.C' +test_expect_success 'cvs update (conflict merge)' ' + ( echo LINE 0 && cat merge ) >merge.tmp && + mv merge.tmp merge && + git add merge && + git commit -q -m "Merge test (conflict)" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update && + test_cmp merge ../expected.C +' cd "$WORKDIR" -test_expect_success 'cvs update (-C)' \ - 'cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update -C && - test_cmp merge ../merge' +test_expect_success 'cvs update (-C)' ' + cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update -C && + test_cmp merge ../merge +' cd "$WORKDIR" -test_expect_success 'cvs update (merge no-op)' \ - 'echo Line 9 >>merge && - cp merge cvswork/merge && - git add merge && - git commit -q -m "Merge test (no-op)" && - git push gitcvs.git >/dev/null && - cd cvswork && - sleep 1 && touch merge && - GIT_CONFIG="$git_config" cvs -Q update && - test_cmp merge ../merge' +test_expect_success 'cvs update (merge no-op)' ' + echo Line 9 >>merge && + cp merge cvswork/merge && + git add merge && + git commit -q -m "Merge test (no-op)" && + git push gitcvs.git >/dev/null && + cd cvswork && + sleep 1 && touch merge && + GIT_CONFIG="$git_config" cvs -Q update && + test_cmp merge ../merge +' cd "$WORKDIR" test_expect_success 'cvs update (-p)' ' - touch really-empty && - echo Line 1 > no-lf && - printf "Line 2" >> no-lf && - git add really-empty no-lf && - git commit -q -m "Update -p test" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs update && - for i in merge no-lf empty really-empty; do - GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out && - test_cmp $i.out ../$i || return 1 - done + touch really-empty && + echo Line 1 > no-lf && + printf "Line 2" >> no-lf && + git add really-empty no-lf && + git commit -q -m "Update -p test" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs update && + for i in merge no-lf empty really-empty; do + GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out && + test_cmp $i.out ../$i || return 1 + done ' cd "$WORKDIR" test_expect_success 'cvs update (module list supports packed refs)' ' - GIT_DIR="$SERVERDIR" git pack-refs --all && - GIT_CONFIG="$git_config" cvs -n up -d 2> out && - grep "cvs update: New directory \`main'\''" < out + GIT_DIR="$SERVERDIR" git pack-refs --all && + GIT_CONFIG="$git_config" cvs -n up -d 2> out && + grep "cvs update: New directory \`main'\''" < out ' #------------ @@ -475,30 +501,30 @@ test_expect_success 'cvs update (module list supports packed refs)' ' cd "$WORKDIR" test_expect_success 'cvs status' ' - mkdir status.dir && - echo Line > status.dir/status.file && - echo Line > status.file && - git add status.dir status.file && - git commit -q -m "Status test" && - git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs update && - GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out && - test_line_count = 2 ../out + mkdir status.dir && + echo Line > status.dir/status.file && + echo Line > status.file && + git add status.dir status.file && + git commit -q -m "Status test" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs update && + GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out && + test_line_count = 2 ../out ' cd "$WORKDIR" test_expect_success 'cvs status (nonrecursive)' ' - cd cvswork && - GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out && - test_line_count = 1 ../out + cd cvswork && + GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out && + test_line_count = 1 ../out ' cd "$WORKDIR" test_expect_success 'cvs status (no subdirs in header)' ' - cd cvswork && - GIT_CONFIG="$git_config" cvs status | grep ^File: >../out && - ! grep / <../out + cd cvswork && + GIT_CONFIG="$git_config" cvs status | grep ^File: >../out && + ! grep / <../out ' #------------ @@ -507,9 +533,9 @@ test_expect_success 'cvs status (no subdirs in header)' ' cd "$WORKDIR" test_expect_success 'cvs co -c (shows module database)' ' - GIT_CONFIG="$git_config" cvs co -c > out && - grep "^main[ ][ ]*main$" out && + grep "^main[ ][ ]*main$" ../out && - sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual && - test_cmp ../expect ../actual + cd cvswork && + test x"$expectStat" = x"0" && + GIT_CONFIG="$git_config" cvs log merge >../out && +sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual && + test_cmp ../expect ../actual ' #------------ @@ -588,11 +614,11 @@ test_expect_success 'cvs log' ' cd "$WORKDIR" test_expect_success 'cvs annotate' ' - cd cvswork && - GIT_CONFIG="$git_config" cvs annotate merge >../out && - sed -e "s/ .*//" ../out >../actual && - printf "1.%d\n" 3 1 1 1 1 1 1 1 2 4 >../expect && - test_cmp ../expect ../actual + cd cvswork && + GIT_CONFIG="$git_config" cvs annotate merge >../out && + sed -e "s/ .*//" ../out >../actual && + printf "1.%d\n" 3 1 1 1 1 1 1 1 2 4 >../expect && + test_cmp ../expect ../actual ' #------------