Thread (129 messages) 129 messages, 6 authors, 2021-06-02

Re: [PATCH v2 12/21] t5304: use "reflog expire --all" to clear the reflog

From: Han-Wen Nienhuys <hidden>
Date: 2021-05-31 15:03:53

On Thu, May 20, 2021 at 5:28 PM Ævar Arnfjörð Bjarmason
[off-list ref] wrote:

On Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:
quoted
From: Han-Wen Nienhuys <redacted>

This is more explicit, and reduces the depency between test functions. It also
is more amenable to use with reftable, which has no concept of (non)existence of
a reflog
Sounds good in principle, but:
quoted
@@ -94,9 +94,7 @@ test_expect_success 'prune: prune unreachable heads' '
 test_expect_success 'prune: do not prune detached HEAD with no reflog' '
      git checkout --detach --quiet &&
      git commit --allow-empty -m "detached commit" &&
-     # verify that there is no reflogs
-     # (should be removed and disabled by previous test)
-     test_path_is_missing .git/logs &&
+     git reflog expire --all &&
      git prune -n >prune_actual &&
      test_must_be_empty prune_actual
 '
Isn't the point of the existing test to check that there isn't an
existing reflog, not to just expire it if we find it, or does expire
--all return non-zero if none was found ?
no. it's verifying that the cross-test behavior is working as
intended. The real objective is to make sure there is no reflog.
Clarified commit msg.
quoted
@@ -104,6 +102,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
 test_expect_success 'prune: prune former HEAD after checking out branch' '
      head_oid=$(git rev-parse HEAD) &&
      git checkout --quiet main &&
+     git reflog expire --all &&
      git prune -v >prune_actual &&
      grep "$head_oid" prune_actual
 '
Just skimming this I'm perplexed why this needs expiring now, as opposed
to being s/file/command/ changes like the rest...
explained in the commit msg.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help