From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Han-Wen Nienhuys <hanwen@google.com>,
Taylor Blau <me@ttaylorr.com>,
Han-Wen Nienhuys via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Han-Wen Nienhuys <hanwenn@gmail.com>
Subject: Re: [PATCH 2/3] t1405: mark test that checks existence as REFFILES
Date: Tue, 01 Feb 2022 22:22:00 +0100 [thread overview]
Message-ID: <220201.861r0m9t8n.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqa6facn9i.fsf@gitster.g>
On Tue, Feb 01 2022, Junio C Hamano wrote:
> Han-Wen Nienhuys <hanwen@google.com> writes:
>
>>> Because there is no generic reflog API that says "enable log for
>>> this ref", a test that checks this feature with files backend would
>>> do "touch .git/refs/heads/frotz".
>>
>> There is refs_create_reflog(), so the generic reflog API exists. The
>> problem is that there is no sensible way to implement it in reftable.
>
> Ah, yes, that's correct.
>
>> One option is (reflog exists == there exists at least one reflog entry
>> for the ref).
>
> Because the current callers of refs_create_reflog() does want a
> reflog created that does not give any entry when iterated, I agree
> with you that adding a "fake" reflog entry alone is not a sufficient
> emulation of the API. I think these are all ...
>
>> This messes up the test from this patch, because it
>> creates a reflog, but because it doesn't populate the reflog, so we
>> return false for git-reflog-exists.
>>
>> It also turns out to mess up the tests in t3420, as follows:
>>
>> ++ git stash show -p
>> error: refs/stash@{0} is not a valid reference
>>
>> I get
>>
>> reflog_exists: refs/stash: 0
>>
>> and "git stash show -p" aborts with "error: refs/stash@{0} is not a
>> valid reference".
>
> ... indications of hat.
>
> I wonder if it is simple and easy to add a new reflog entry type
> used as an implementation detail of the reftable. If we can do so,
> then, the reftable backend integrated to the ref API can do these
> things:
>
> - reflog_exists() can say yes when one reflog entry of any type
> (internal to the reftable implementation) exists for the ref;
>
> - create_reflog() can add a reflog entry of the "fake" type
> (internal to the reftable implementation);
>
> - for_each_reflog_ent() and its reverse can learn to skip such a
> fake reflog entry.
>
> As there is no way to ask, via the API, the number of the existing
> reflog entries, the ref API callers would not be able to tell such
> an implementation detail that with reftable backend, create_reflog()
> does not create an empty reflog. To them, a reflog created with the
> API call would truly be empty as iterators will not return anything.
We could surely add magic record types, but how would such a dance be
performed while keeping compatibility with existing JGit clients?
next prev parent reply other threads:[~2022-02-01 21:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-31 17:50 [PATCH 0/3] reftable related test tweaks Han-Wen Nienhuys via GitGitGadget
2022-01-31 17:50 ` [PATCH 1/3] t1405: explictly delete reflogs for reftable Han-Wen Nienhuys via GitGitGadget
2022-01-31 17:50 ` [PATCH 2/3] t1405: mark test that checks existence as REFFILES Han-Wen Nienhuys via GitGitGadget
2022-01-31 21:26 ` Taylor Blau
2022-01-31 22:15 ` Junio C Hamano
2022-02-01 20:06 ` Han-Wen Nienhuys
2022-02-01 21:03 ` Junio C Hamano
2022-02-01 21:22 ` Ævar Arnfjörð Bjarmason [this message]
2022-02-01 22:11 ` Junio C Hamano
2022-02-03 16:02 ` Han-Wen Nienhuys
2022-02-03 17:39 ` Ævar Arnfjörð Bjarmason
2022-02-03 18:10 ` Han-Wen Nienhuys
2022-02-03 23:06 ` Junio C Hamano
2022-02-07 9:48 ` Han-Wen Nienhuys
2022-02-07 16:52 ` Han-Wen Nienhuys
2022-02-07 23:40 ` Junio C Hamano
2022-02-08 14:58 ` Han-Wen Nienhuys
2022-01-31 17:50 ` [PATCH 3/3] t5312: prepare for reftable Han-Wen Nienhuys via GitGitGadget
2022-02-01 21:17 ` Ævar Arnfjörð Bjarmason
2022-02-03 14:24 ` Han-Wen Nienhuys
2022-02-03 18:31 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=220201.861r0m9t8n.gmgdl@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=hanwen@google.com \
--cc=hanwenn@gmail.com \
--cc=me@ttaylorr.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).