git/list[1] front-page[2] threads[3] people[4] search[5] about
 

reflog existence & reftable

From
Han-Wen Nienhuys <hanwen@google.com>
Date
Apr 21, 2021, 10:02 UTC
Message-ID
<CAFQ2z_Ps3YxycA+NJ9VKt_PEXb+m83JdNB7ujzWw1fTPKyZ=fg@mail.gmail.com>
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
Next: Ævar Arnfjörð Bjarmason
Message 1 of 7 in “reflog existence & reftable”
  1. Han-Wen NienhuysApr 21, 2021
  2. Ævar Arnfjörð BjarmasonApr 21, 2021
  3. Junio C HamanoApr 21, 2021
  4. Han-Wen NienhuysApr 23, 2021
  5. Jeff KingApr 23, 2021
  6. Han-Wen NienhuysApr 26, 2021
  7. Junio C HamanoApr 27, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.