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

Re: reflog existence & reftable

From
Han-Wen Nienhuys <hanwen@google.com>
Date
Apr 26, 2021, 17:33 UTC
Message-ID
<CAFQ2z_OEB_jnL-G=GfypMiLLjE3gwp07ZMo3uF5aGkp3o6Yb9A@mail.gmail.com>
In-Reply-To
<YILUs3T4oM78ZcW2@coredump.intra.peff.net>
On Fri, Apr 23, 2021 at 4:07 PM Jeff King <peff@peff.net> wrote:
>
> On Fri, Apr 23, 2021 at 11:20:52AM +0200, Han-Wen Nienhuys wrote:
>
> > On Wed, Apr 21, 2021 at 6:55 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
> > >  (2) we could declare that there is no way to create an empty reflog
> > >      supported across ref backends, and make the tests that rely on
> > >      the "feature" conditional on REF_FILES prerequisite.
> > >
> > > I have no strong preference.  In the early days I found the ability
> > > to limit which branches get logged convenient, so if reftable
> > > backend can learn the similar trick, we would want to go route (1)
> > > (the convenience largely came from the fact that there was no need
> > > to add one configuration item per branch, so I do not think we would
> > > want to bother with branch.<name>.reflog=bool configuration---that
> > > won't be an easy-to-use substitute).  On the other hand, logs are
> > > useful, and dormant logs are not costing anything (other than holding
> > > onto stale objects we may no longer want), so it could be that it
> > > may not be as convenient as it used to be to be able to turn logs on
> > > only on selected refs, in which case approach (2) is fine.
> >
> > Exactly, these are the two options I outlined in my original message.
> > Both can be made to work. I slightly prefer 2 (empty reflogs don't
> > exist, and make logging a global switch), because it is simpler to
> > understand and document. The divergence with the files backend itself
> > is extra complexity, though. Maybe we could deprecate the behavior and
> > always write reflogs in the  files backend too.
>
> Yeah, I like (2) as well. This "write a reflog if it always exists"
> behavior has always seemed hacky, and like a leftover from early days
> when we didn't just turn reflogs on by default. Given that it was
> documented as "touch the file", I don't see any need to pretend that it
> makes any sense at all in a reftables world.
Thanks. Does that count as consensus? Junio?
-- 
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
Previous: Jeff KingNext: Junio C Hamano
Message 6 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.