git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* reflog existence & reftable
@ 2021-04-21 10:02 Han-Wen Nienhuys
  2021-04-21 11:57 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 7+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-21 10:02 UTC (permalink / raw)
  To: git

Hi there,

(splitting off from a code review of my test cleanups.)

Currently, reflogs are stored in .git/log/*. Git adds entries to the
reflog only if the reflog already exists (See the log_ref_setup()
function).

The current iteration of the reftable design has a unified key space
of {refname,index-number} for reflog entries. This causes there to be
no distinction between

  1) reflog is empty (.git/logs/blah is a 0-byte file)
  2) reflog does not exist (.git/logs/blah does not exist)

This trips up some current tests that make assumptions on reflog existence.

I don't know why one can tweak reflog to be written or not, but the
current functionality will cause a change in operation with reftable.
I see two ways forward:

1) Have different functionality in case of reftable: you cannot query
for the existence of reflogs, and writing reflogs doesn't depend on
the existence of a reflog.

2) Add a reflog existence feature to reftable. We could introduce a
magical reflog entry, which indicates that the reflog exists (but
might be empty). This adds some complexity to the C code, but lets us
maintain backward compatibility.

What do you think?


-- 
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-27  6:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 10:02 reflog existence & reftable Han-Wen Nienhuys
2021-04-21 11:57 ` Ævar Arnfjörð Bjarmason
2021-04-21 16:55   ` Junio C Hamano
2021-04-23  9:20     ` Han-Wen Nienhuys
2021-04-23 14:07       ` Jeff King
2021-04-26 17:33         ` Han-Wen Nienhuys
2021-04-27  6:52           ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).