From patchwork Mon Jan 31 17:50:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han-Wen Nienhuys X-Patchwork-Id: 12730964 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 E3DA5C433F5 for ; Mon, 31 Jan 2022 17:50:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381120AbiAaRu0 (ORCPT ); Mon, 31 Jan 2022 12:50:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377817AbiAaRuY (ORCPT ); Mon, 31 Jan 2022 12:50:24 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3C75C061714 for ; Mon, 31 Jan 2022 09:50:23 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id e8so27035786wrc.0 for ; Mon, 31 Jan 2022 09:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=q3CjFNDis9kqpZX++fMcdB4cW0iE2eypUt2qAg30AU4=; b=nW77tueZTDfFSuiOg/XcPVf6sAUUJugRZmRbmCNIAbDgimGyXn+xRNWe7m8gCVay+s lWzbi7x830DJIwjtzl1jrM6LY2dQYPM5GuhHhh2qYRIeWm/G78M/zMXa5N4ZFT+nfAhL c3jTava8WzXW91dDXw6sNa4E01s1J/vUdRCry1+Fu1VtX7mYnkrt7AbmaE2EyL13a4v9 A/2Y0+WhkbyZT2qyRZ2Y+R/uHs4Wv4Jd5GdklYegjBJX0eKXNm31+sn+OuKfEFTzgr3s i9g5rS4JXSf1JJlqAHDHn/Uzv/PaeDOrneIzyJ/aytvlk4ZLaMTme/yKLrqy7TsuU9+x PTZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=q3CjFNDis9kqpZX++fMcdB4cW0iE2eypUt2qAg30AU4=; b=xymlhDSBOSyF9P5VM9lRh+qiWggleP6BmrcGyM+wcw6NVcY6jYA3PdN8ZFHrPZ2+Gr F08HyNS2hGvYLeAownb/P/1f7WuNrVRAZzkaONBmtSEaFu+6SY9rbLg5TN2vZBfxL2aO m0xORZaIi0y2vfAEP9pcyb9tgxGn3bQpENagjcY+adoL+kr43JZa3uNQAiFxW33nmXjm 7y/bDqP4Uq+IpWkBETDEUvG1NK6HdW+oiYr364o6OgP0zo7ebHDKOnDFbha0r/OtgJcs ePSdKJwH/bexfPAzA14hrCxmy5a+PZbAZjceLchM0PPB1kwN7G4z79yRUQ0xrgokRFsL aqtQ== X-Gm-Message-State: AOAM5331cgT7k0OdgaWwMkyDD8i0zN42MqwaANRTULr5KIPXqY97gdk+ bRC1D8nudLMgqyRXWVmNAcBU9DNOhS4= X-Google-Smtp-Source: ABdhPJwPdlIKBX8wzotMxWD8GPEEI4rnX/CBb2cb6+bO1SILEP58GFAopX5akB4YvpVWHk6YjcVFbw== X-Received: by 2002:adf:e2c5:: with SMTP id d5mr18919248wrj.32.1643651422240; Mon, 31 Jan 2022 09:50:22 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id i9sm14825272wry.32.2022.01.31.09.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 09:50:21 -0800 (PST) Message-Id: <299451d317f83b908ee4ba750405302238209103.1643651420.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 31 Jan 2022 17:50:18 +0000 Subject: [PATCH 1/3] t1405: explictly delete reflogs for reftable Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Han-Wen Nienhuys , Han-Wen Nienhuys Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Han-Wen Nienhuys From: Han-Wen Nienhuys Deleting a ref in reftable just records a (ObjectID => ZeroID) transaction in the reflog. To ensure 'for_each_reflog()' test below works, explictly delete reflogs for deleted refs. Signed-off-by: Han-Wen Nienhuys --- t/t1405-main-ref-store.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh index 1a3ee8845d6..62e5e9d1b0a 100755 --- a/t/t1405-main-ref-store.sh +++ b/t/t1405-main-ref-store.sh @@ -40,6 +40,12 @@ test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' ' test_must_fail git rev-parse refs/tags/new-tag -- ' +# In reftable, we keep the reflogs around for deleted refs. +test_expect_success !REFFILES 'delete-reflog(FOO, refs/tags/new-tag)' ' + $RUN delete-reflog FOO && + $RUN delete-reflog refs/tags/new-tag +' + test_expect_success 'rename_refs(main, new-main)' ' git rev-parse main >expected && $RUN rename-ref refs/heads/main refs/heads/new-main && From patchwork Mon Jan 31 17:50:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han-Wen Nienhuys X-Patchwork-Id: 12730965 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 B5935C433F5 for ; Mon, 31 Jan 2022 17:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381117AbiAaRuc (ORCPT ); Mon, 31 Jan 2022 12:50:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381116AbiAaRuZ (ORCPT ); Mon, 31 Jan 2022 12:50:25 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C7AC061714 for ; Mon, 31 Jan 2022 09:50:24 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id f17so27002581wrx.1 for ; Mon, 31 Jan 2022 09:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=JPToaO8woy9eeopM2Q06w8ZhVENg4clLhoYaQM8lIPM=; b=PI/8EVpylYi1gHzxa109iP3LZC/bLv6QlsSLbwr3BsgD7UIpDVotcqCbyRI3ZMBD9m iF+8CqTgQr3pZqJ/vYsumOVi6K6mgIeI/HhBxZnhjGYEQ6y3lCfxPHlu22PPUN6lolRu LfWuv4FZgGSdk2/hZT+iVVsus7/QNTPBhW1573BQbyqrNa2iyaisklcTaTbRlQiiCkge 2GvwzartVYSdf3wbmHl7PBSAjk9DN+kn/OTz9XlhxPJQQsH65CoCBlMAI4eBba9c9kbF iG8PMAwdx4evY80/Hckjh4Z+/XEqiRhP8aQ+Ae+lMcYeFVPq6z1jS5EgbwPhgx5lvs2R 4DHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=JPToaO8woy9eeopM2Q06w8ZhVENg4clLhoYaQM8lIPM=; b=ZexFn46QDaSGvxyyAADVb+Uk2fzGDp8wKgoAe9rUx6mzcSivVqwaL1PQUhM0NCQvP0 TdYJNSVc3ZjnAyqUrnRioIsyrMtYCLcc6JRzvcbhnGzxyyLH7ZXGVoWw4ppc1oTTs0An FtCxWxN8IzTrzo70sh7KDx2doX5Z4M9jr6CfYWGTku0BUH52wMiAvzQ2hTr4fSYyKGUF +1IsMYywQtjJ9AjSKWbB9vSobWKOeTZetpXwdbbYJHPBcCE5gVs3nfCC9hgha6FDeiSU +sY3ntKZ8dPZYAbz6j/eBcScvgGm1bOR4bAQ8CvfGGW5SVGRbUAC6FSg8evBPT5n4iQ7 gIVg== X-Gm-Message-State: AOAM532zuXtcjpPJu8YaKsVWkuJUuMsvfjUdB+d5xzzemMhnIGcd+w+r 1rgYz98WMjJhd3MPYsYnwv7mL44oMmg= X-Google-Smtp-Source: ABdhPJy/EJj1twP+klVYX/DwG9fUcovfoEI+VOQ5qSnqQaR/KIGC5JielHSvd/CO1/q7RVHOQwAJVA== X-Received: by 2002:a5d:554b:: with SMTP id g11mr18112911wrw.168.1643651423219; Mon, 31 Jan 2022 09:50:23 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z13sm14456819wrm.90.2022.01.31.09.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 09:50:22 -0800 (PST) Message-Id: <1ded69d89709d23147b29f67122b659293414405.1643651420.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 31 Jan 2022 17:50:19 +0000 Subject: [PATCH 2/3] t1405: mark test that checks existence as REFFILES Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Han-Wen Nienhuys , Han-Wen Nienhuys Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Han-Wen Nienhuys From: Han-Wen Nienhuys The reftable backend doesn't support mere existence of reflogs. Signed-off-by: Han-Wen Nienhuys --- t/t1405-main-ref-store.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh index 62e5e9d1b0a..51f82916281 100755 --- a/t/t1405-main-ref-store.sh +++ b/t/t1405-main-ref-store.sh @@ -111,7 +111,7 @@ test_expect_success 'delete_reflog(HEAD)' ' test_must_fail git reflog exists HEAD ' -test_expect_success 'create-reflog(HEAD)' ' +test_expect_success REFFILES 'create-reflog(HEAD)' ' $RUN create-reflog HEAD && git reflog exists HEAD ' From patchwork Mon Jan 31 17:50:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han-Wen Nienhuys X-Patchwork-Id: 12730966 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 802A7C433F5 for ; Mon, 31 Jan 2022 17:50:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381137AbiAaRui (ORCPT ); Mon, 31 Jan 2022 12:50:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381118AbiAaRuZ (ORCPT ); Mon, 31 Jan 2022 12:50:25 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C831C06173B for ; Mon, 31 Jan 2022 09:50:25 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id u15so26992843wrt.3 for ; Mon, 31 Jan 2022 09:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=xcVKRXO2RduFL+LG5Q8A57H9kDYp/jw3gnCqAMX3VRM=; b=K9gpMuNsroe22Tz2qAEfpdS0omEZNFqUmOj8LPuMk1k/y8QcErCZQvk0BNwbJrguSF Z9/DI1L3HtduxFSM8XoAd5DdKPAJNpB/SQSkx597SDy/DrsKunPwTWqPUfIkysAkjYBC GmvckVzfcRJlyLV0Cl1Opvd4vw8VqdYJ21wEXaiF2mCDX4ntGloA76jJF8x34+AR03dt x/1irXkeg/PaRDuDYLL4EGXyHGi1BUmc+Hq2gGwpBw7MK5S8VEJSdyfWNPK0Z7/mBUhp 0MjSnSfNts/mB2mg0AFIwWKbA/t4yiqcp43QC8/QSGUZJULthm+SdesptIN+mOVlaAcK 9g/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=xcVKRXO2RduFL+LG5Q8A57H9kDYp/jw3gnCqAMX3VRM=; b=JJlMbcQbJniBzcu607d1Ew/X3nMCGmvFQiFEemgdT9Ca09qvNcdgKr80YpL0TdAkJL iAq48X917W5J3kzYrtZe3D10BKs6BulRO/4ZXD57aSR/i6uKsw4zKXBZjVavC73V/oxN SSKV2Dqhde5Ss8dq5+ggy/8oLdqtB/syLeTNUCY2+A8mASkoapNL4HG9F3CvKlXKt+pl t8Woa8s0ufLdvnU3Yos6ky56O2g+Ofy0lT7xTqqNb/ZUnDXeMjszCM75COr3fCb2V0AT xM6YqhA8l2EXj9Ws8m0hgIbVFyRgHyBjwBEzGzgNDCIYfENR55PTKE2BWldX0vgZ53GT 16oQ== X-Gm-Message-State: AOAM530PLg+HX98qNDVtPSGphBWiMchN8c0op9uchJ38StYrOpTjG97M RYNtSRarbWuCPaBRqtqw+ckWdYzAA+c= X-Google-Smtp-Source: ABdhPJyFBm0xxnXToeQNsQhOoMeEDikY4VUt/NRNLLJTwJ8EYobvyDcVq0T7LfmoVESgokXO92cdbg== X-Received: by 2002:adf:e44d:: with SMTP id t13mr9496429wrm.248.1643651424056; Mon, 31 Jan 2022 09:50:24 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q2sm6549890wrw.14.2022.01.31.09.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 09:50:23 -0800 (PST) Message-Id: In-Reply-To: References: Date: Mon, 31 Jan 2022 17:50:20 +0000 Subject: [PATCH 3/3] t5312: prepare for reftable Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Han-Wen Nienhuys , Han-Wen Nienhuys Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Han-Wen Nienhuys From: Han-Wen Nienhuys Mark some tests as REFFILES if they rely on packed refs. Use ref-store helper to create bogus refs. Signed-off-by: Han-Wen Nienhuys --- t/t5312-prune-corruption.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh index ea889c088a5..9d8e249ae8b 100755 --- a/t/t5312-prune-corruption.sh +++ b/t/t5312-prune-corruption.sh @@ -22,8 +22,8 @@ test_expect_success 'disable reflogs' ' ' create_bogus_ref () { - test_when_finished 'rm -f .git/refs/heads/bogus..name' && - echo $bogus >.git/refs/heads/bogus..name + test-tool ref-store main update-ref msg "refs/heads/bogus..name" $bogus $ZERO_OID REF_SKIP_REFNAME_VERIFICATION && + test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/bogus..name" } test_expect_success 'create history reachable only from a bogus-named ref' ' @@ -113,7 +113,7 @@ test_expect_success 'pack-refs does not silently delete broken loose ref' ' # we do not want to count on running pack-refs to # actually pack it, as it is perfectly reasonable to # skip processing a broken ref -test_expect_success 'create packed-refs file with broken ref' ' +test_expect_success REFFILES 'create packed-refs file with broken ref' ' rm -f .git/refs/heads/main && cat >.git/packed-refs <<-EOF && $missing refs/heads/main @@ -124,13 +124,13 @@ test_expect_success 'create packed-refs file with broken ref' ' test_cmp expect actual ' -test_expect_success 'pack-refs does not silently delete broken packed ref' ' +test_expect_success REFFILES 'pack-refs does not silently delete broken packed ref' ' git pack-refs --all --prune && git rev-parse refs/heads/main >actual && test_cmp expect actual ' -test_expect_success 'pack-refs does not drop broken refs during deletion' ' +test_expect_success REFFILES 'pack-refs does not drop broken refs during deletion' ' git update-ref -d refs/heads/other && git rev-parse refs/heads/main >actual && test_cmp expect actual