git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Han-Wen Nienhuys <hanwen@google.com>
To: git <git@vger.kernel.org>
Subject: reflog existence & reftable
Date: Wed, 21 Apr 2021 12:02:32 +0200	[thread overview]
Message-ID: <CAFQ2z_Ps3YxycA+NJ9VKt_PEXb+m83JdNB7ujzWw1fTPKyZ=fg@mail.gmail.com> (raw)

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

             reply	other threads:[~2021-04-21 10:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 10:02 Han-Wen Nienhuys [this message]
2021-04-21 11:57 ` reflog existence & reftable Æ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

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFQ2z_Ps3YxycA+NJ9VKt_PEXb+m83JdNB7ujzWw1fTPKyZ=fg@mail.gmail.com' \
    --to=hanwen@google.com \
    --cc=git@vger.kernel.org \
    /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.
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).