From patchwork Thu Mar 31 19:15:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Masum X-Patchwork-Id: 12797615 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 D962FC433EF for ; Thu, 31 Mar 2022 19:15:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239974AbiCaTR2 (ORCPT ); Thu, 31 Mar 2022 15:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239574AbiCaTR1 (ORCPT ); Thu, 31 Mar 2022 15:17:27 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5970F232101 for ; Thu, 31 Mar 2022 12:15:39 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id h1so464731edj.1 for ; Thu, 31 Mar 2022 12:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pFJr7/6eZiD1jqROkOEcrhj1XGgNaE8VQbBdLPtIfCs=; b=p4Idpfa8qusYC2i75+6FR/hyl/byOq0BIjJ4tTqYz8ZybupCtTnbFg/4rAj9ddPpje RjNDgYfyG2MI2UiMbp8MjkdJjtrE88M2fHH/f2ycb5AAReaBUx3Aw7D+S4nFx0JcE407 RNfpo7Wf4kUIKLoqTxfXEcjRbtXZZOBANA/UnoTL4fXqmEvu9lHo2hsXG03NZSHplDEA /yxaftouE3dyxd0cg9Xc9nAFjqS/0ynPj/2PZiADfFudLG6J0HUn73gKlXV7IY51WEhN dniqFhBWy6mOdHGEkbQId4zCWKw4IekXfiqkGf706MS+xxHD+GVHpCaYOSrQgRmxJD0h U0HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pFJr7/6eZiD1jqROkOEcrhj1XGgNaE8VQbBdLPtIfCs=; b=jgaAzg2rYvHDWqZra1zppDxdNNTjeNL4B5muj5X6APnHB+lF230OdjSst11m8crbVP OSJF/0kw8CDkO0x/sHe2tejqJEyOw3RKSVXzDvt5pSPRZ19BT3m8Lix2k0Tzo17vTsJ0 CXABOqKM44Q6SuzWM0HTV3OqF+q8nL3xCymZqCHPA0XHDk+VbPHp3wWQfot06OgoDfeD tSTuOdkaPcmRr7ZWLNbWOQpcKantqW5GPkzHJix7nplMwwJin7UDCfVM7AAzbaGgsyJp 8LDJAlCNfr82WwZmg/fA1K5rj1nP8Y/jCqtdOnhLRggpGRK7LUnVCTaTEOTvuG8JTqkT a/DQ== X-Gm-Message-State: AOAM532TFozFTiXev2C5xJXWoUqrAnxd3qvxXo8y2/2dIX7uda8UjSkO O5b6DMVvC9uO2I26fL29PEzMyGU8B1w4ndHzJ8Q9Ng== X-Google-Smtp-Source: ABdhPJwPlKO85WNFwVfbD/j/IwBOLZcrJUwgM2DfRqYmUlCrT/ACmq82D8KfPVP9eVzZ9kLbMzYWfQ== X-Received: by 2002:aa7:c881:0:b0:419:1a3d:4437 with SMTP id p1-20020aa7c881000000b004191a3d4437mr18071648eds.378.1648754137792; Thu, 31 Mar 2022 12:15:37 -0700 (PDT) Received: from a35b75bc573c.europe-west4-b.c.codatalab-user-runtimes.internal (81.245.204.35.bc.googleusercontent.com. [35.204.245.81]) by smtp.gmail.com with ESMTPSA id hp12-20020a1709073e0c00b006e02924bf20sm106181ejc.117.2022.03.31.12.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 12:15:37 -0700 (PDT) From: Labnann To: avarab@gmail.com Cc: git@vger.kernel.org, gitgitgadget@gmail.com, khalid.masum.92@gmail.com Subject: [PATCH v2 1/3] t3501: use test_path_is_* functions Date: Thu, 31 Mar 2022 19:15:23 +0000 Message-Id: <20220331191525.17927-2-khalid.masum.92@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220331191525.17927-1-khalid.masum.92@gmail.com> References: <220331.86bkxnt77a.gmgdl@evledraar.gmail.com> <20220331191525.17927-1-khalid.masum.92@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Two test -f are present in t3501. They can be replaced with appropriate helper function: test_path_is_file Signed-off-by: Labnann --- t/t3501-revert-cherry-pick.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh index 8617efaaf1..45492a7ed0 100755 --- a/t/t3501-revert-cherry-pick.sh +++ b/t/t3501-revert-cherry-pick.sh @@ -67,7 +67,7 @@ test_expect_success 'cherry-pick after renaming branch' ' git checkout rename2 && git cherry-pick added && test $(git rev-parse HEAD^) = $(git rev-parse rename2) && - test -f opos && + test_path_is_file opos && grep "Add extra line at the end" opos && git reflog -1 | grep cherry-pick @@ -78,7 +78,7 @@ test_expect_success 'revert after renaming branch' ' git checkout rename1 && git revert added && test $(git rev-parse HEAD^) = $(git rev-parse rename1) && - test -f spoo && + test_path_is_file spoo && ! grep "Add extra line at the end" spoo && git reflog -1 | grep revert From patchwork Thu Mar 31 19:15:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Masum X-Patchwork-Id: 12797616 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 242A7C433FE for ; Thu, 31 Mar 2022 19:15:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240475AbiCaTR2 (ORCPT ); Thu, 31 Mar 2022 15:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239667AbiCaTR1 (ORCPT ); Thu, 31 Mar 2022 15:17:27 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC92591550 for ; Thu, 31 Mar 2022 12:15:39 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id y10so426726edv.7 for ; Thu, 31 Mar 2022 12:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fgyNSdmp2yovFrc1IcjJlt2B3WjoN7r4UNujoSxseAc=; b=mMSrcs0pU8ohBilvFQpI6cjQhPLk1LqAUlFdgc8jRYW0kdWv2JKYRM2qYslr1jb5Ud Z2DWpJ2s7ZCc5P2tWmZMins6YV2/1R7MpKYCnieq/rodsO/5xN20EVT6y4lOI1X6fmOD 0KqHB49dPVA4zozGrchEu7ak51UybTh9of2mfsDlQu/XJFS9yuddHc+JuCZRf5zF00vT 9SThZp3x4XtGuyyzp/50xHsqUYtwCX2FbAiwKem6A4BxxHt1KHZ4+uHHBxlNOf+bGcPS 4Gi4tPTDOD7CASt7G/YDycZKL8UAIxoi4ABHaLoHJYVshcBn01T8eLHo9Py5/2vg5ZMe fgjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fgyNSdmp2yovFrc1IcjJlt2B3WjoN7r4UNujoSxseAc=; b=jnWBN4WQCHJuQzDL26XWZlflqAxLYnVK8Vl2NRC7mLJJ+noK6x9mxLg60UZ/MmwZqq EAKAhRkGSUuxBV1hLndSu3QL+H9Z52xNONSIudrIl2MyALVKusY/2YGNVR33eCoaNeXw A7HYlw/ZN6aQZTDBUazdg1lwvezRjnbZj4kMPcCcDnLSuZPGlXrxhqR7kNMQVzsFNlM4 GeiJQ64R4nTDCbpFlo/blirDc1xr3aLmKQVSJB/qlxj5TJ852oYAaDQsFw0aly1EvhTP 0I+xECPtuREJ6ZWGeIvBwDhNtw3C4ksaDWvF6nwmfe/fAWUcLuJNIjM5Nx6VKbDFbxKM QEdw== X-Gm-Message-State: AOAM5317H1o5EvONQjHMJPZ20QIXSjG6TtJ7ye6/BNiS5CbDUnU1hDEb QrFeCRrDLT2x98MvL875k9htIBALyOj/KlE7NsiS1Q== X-Google-Smtp-Source: ABdhPJzrbbw2Ojo8nQe6ps7m6ZkrUmbBRZ2xdqt5PleZDsqErlQGV7dcSUdOVFC1Hi6gFqIgWv0IZg== X-Received: by 2002:a05:6402:34c1:b0:419:585a:f383 with SMTP id w1-20020a05640234c100b00419585af383mr17679447edc.65.1648754138308; Thu, 31 Mar 2022 12:15:38 -0700 (PDT) Received: from a35b75bc573c.europe-west4-b.c.codatalab-user-runtimes.internal (81.245.204.35.bc.googleusercontent.com. [35.204.245.81]) by smtp.gmail.com with ESMTPSA id hp12-20020a1709073e0c00b006e02924bf20sm106181ejc.117.2022.03.31.12.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 12:15:38 -0700 (PDT) From: Labnann To: avarab@gmail.com Cc: git@vger.kernel.org, gitgitgadget@gmail.com, khalid.masum.92@gmail.com Subject: [PATCH v2 2/3] t3501: don't ignore "git " exit code Date: Thu, 31 Mar 2022 19:15:24 +0000 Message-Id: <20220331191525.17927-3-khalid.masum.92@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220331191525.17927-1-khalid.masum.92@gmail.com> References: <220331.86bkxnt77a.gmgdl@evledraar.gmail.com> <20220331191525.17927-1-khalid.masum.92@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org without this change this test will become flaky e.g under SANITIZE=leak if some (but not all) memory leaks revealed by these commands, according to c419562860e Signed-off-by: Labnann --- t/t3501-revert-cherry-pick.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh index 45492a7ed0..bd19c272d6 100755 --- a/t/t3501-revert-cherry-pick.sh +++ b/t/t3501-revert-cherry-pick.sh @@ -44,6 +44,12 @@ test_expect_success setup ' git tag rename2 ' +test_cmp_rev_parse () { + git rev-parse $1 >expect && + git rev-parse $2 >actual && + test_cmp expect actual +} + test_expect_success 'cherry-pick --nonsense' ' pos=$(git rev-parse HEAD) && @@ -66,7 +72,7 @@ test_expect_success 'cherry-pick after renaming branch' ' git checkout rename2 && git cherry-pick added && - test $(git rev-parse HEAD^) = $(git rev-parse rename2) && + test_cmp_rev_parse HEAD^ rename2 && test_path_is_file opos && grep "Add extra line at the end" opos && git reflog -1 | grep cherry-pick @@ -77,7 +83,7 @@ test_expect_success 'revert after renaming branch' ' git checkout rename1 && git revert added && - test $(git rev-parse HEAD^) = $(git rev-parse rename1) && + test_cmp_rev_parse HEAD^ rename1 && test_path_is_file spoo && ! grep "Add extra line at the end" spoo && git reflog -1 | grep revert From patchwork Thu Mar 31 19:15:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Masum X-Patchwork-Id: 12797617 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 6152AC433F5 for ; Thu, 31 Mar 2022 19:15:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240595AbiCaTRa (ORCPT ); Thu, 31 Mar 2022 15:17:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240328AbiCaTR2 (ORCPT ); Thu, 31 Mar 2022 15:17:28 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A5E0235746 for ; Thu, 31 Mar 2022 12:15:40 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id h1so464795edj.1 for ; Thu, 31 Mar 2022 12:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=untBgpF7Mqren7I6pH8aVsNs0+ch0RSlgkQomuNXOzM=; b=LgycVERijefJdqi8E0WjuDBDJdehwkEXdiDP6brJARYOrUxT51nYzu/t4IrLR+HS7C 7vGu5l6pPQiqg+KYiUArQFeBfZyvLIL3DhT3A++UPgGm4PbdimAstLPlWvEt3r9NL2Kt vBYHRb6PSNND395RJqXy4FxZQwlCzPecCGincwJ7vmiaZ13hLtJq68kB1P2tOEKp2FVV i09quAWwvksKDJdCm0NKy3HL3cu4+m3Jm3HwIjKK4BVfKdtBaJxei9Cm2+Cy2P6nYpcV dOrbNySnHt9GJxVLHYc6sgD/D+ZraKaopA/4W1IOyBZlPJg2KHcLlku8S77Ok2iHFAxG REDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=untBgpF7Mqren7I6pH8aVsNs0+ch0RSlgkQomuNXOzM=; b=nhxBD5aCPy7Q5e45c3Ef+q2h/rfoxYejE238djBd0fKuVJE0gMMqxSAxppLSMIUorz Hcu04j3dbPeeCoGAlUIgx+bRQAkHj7L/RAzwuLY3PYAgRshlqzXffZXJYvwos59DUcJW BAfDnyKyH7D2pABPiSP/fMdHseD+QaffiJA2L7eFVqMQq25njUmJIQ35jFcA0LnontXD dLVPJEscXIkQdhnfxicNA0qYj0Tn8/5mL+BDRmn1fl9QjfTo96KpRO5C30+jhEnD3d8M z87GBz08iNH/vp/t4sxnUZDKSJJTtcoR+bPgvx5ky6gYJR+3MNslf3XYLQHTBbU7GmsA eFHA== X-Gm-Message-State: AOAM530/BX1yjsOVCMytakOyCuePrAv3xCyBvO9qiWS0ny063LIKSCyV uhexImkJjxAru5RWQJF/TRZqCWr2VFpEtUX1BoEBnA== X-Google-Smtp-Source: ABdhPJyk5c1Q8xSddaZwLxYpye6IEgz3RHKKYM0gKJZiQYRK4+1Xyx4MG27di4IROyV9upCpGBifaA== X-Received: by 2002:a05:6402:454:b0:416:2db7:685b with SMTP id p20-20020a056402045400b004162db7685bmr17814896edw.43.1648754138926; Thu, 31 Mar 2022 12:15:38 -0700 (PDT) Received: from a35b75bc573c.europe-west4-b.c.codatalab-user-runtimes.internal (81.245.204.35.bc.googleusercontent.com. [35.204.245.81]) by smtp.gmail.com with ESMTPSA id hp12-20020a1709073e0c00b006e02924bf20sm106181ejc.117.2022.03.31.12.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 12:15:38 -0700 (PDT) From: Labnann To: avarab@gmail.com Cc: git@vger.kernel.org, gitgitgadget@gmail.com, khalid.masum.92@gmail.com Subject: [PATCH v2 3/3] t3501: test cherry-pick revert with oids Date: Thu, 31 Mar 2022 19:15:25 +0000 Message-Id: <20220331191525.17927-4-khalid.masum.92@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220331191525.17927-1-khalid.masum.92@gmail.com> References: <220331.86bkxnt77a.gmgdl@evledraar.gmail.com> <20220331191525.17927-1-khalid.masum.92@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org we did a revert of a file we had so that it's the same as in "initial", but now it's at a different path, which we can exhaustively do by checking the blob OIDs Signed-off-by: Labnann --- t/t3501-revert-cherry-pick.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh index bd19c272d6..08103923ab 100755 --- a/t/t3501-revert-cherry-pick.sh +++ b/t/t3501-revert-cherry-pick.sh @@ -72,8 +72,7 @@ test_expect_success 'cherry-pick after renaming branch' ' git checkout rename2 && git cherry-pick added && - test_cmp_rev_parse HEAD^ rename2 && - test_path_is_file opos && + test_cmp_rev_parse rename2 HEAD^ && grep "Add extra line at the end" opos && git reflog -1 | grep cherry-pick @@ -83,9 +82,8 @@ test_expect_success 'revert after renaming branch' ' git checkout rename1 && git revert added && - test_cmp_rev_parse HEAD^ rename1 && - test_path_is_file spoo && - ! grep "Add extra line at the end" spoo && + test_cmp_rev_parse rename1 HEAD^ && + test_cmp_rev_parse initial:oops HEAD:spoo && git reflog -1 | grep revert '