git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Tao Klerks <tao@klerks.biz>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Han-Wen Nienhuys <hanwen@google.com>, git <git@vger.kernel.org>
Subject: Re: Keep reflogs for deleted (remote tracking) branches?
Date: Mon, 14 Mar 2022 13:10:01 +0100	[thread overview]
Message-ID: <CAPMMpohNi4LhyQm+WYfmRRVZ_B2YfoqeRzWRusza6VUwkJUOWg@mail.gmail.com> (raw)
In-Reply-To: <220314.86y21cerhe.gmgdl@evledraar.gmail.com>

On Mon, Mar 14, 2022 at 11:52 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
> I think you might find it interesting to have pre-receive hooks
> e.g. reject pushes if you're deleting a topic whose commits aren't
> entirely <your author> i.e. just something like:
>
>     git push -o ireallymeanit=1 --delete topic
>
> I.e. it's an easy to implement extra safety check that people can always
> opt-out of, print a scary message and most people will think twice :)

That is indeed very interesting, thanks! I need to think about exactly
when this is the right thing to do, but it's a tool in the box that I
was not aware of!


> > My question is specifically about the, in my opinion, very surprising
> > behavior of deleting reflogs along with deleted branches - I mainly
> > provided the example use-case for context.
>
> Yes it's quite a mess, e.g. if you follow the rabit hole at the
> recent[1].
>
> One fundimental problem (discussed in various places around the reftable
> backend) is that we carry N meanings for an empty reflog:
>
> A. "This is an active branch, but we have expired the entries".
>
> B. "I manually created this, knowing that the various core.* configs
>    around reflog will say "oh, a reflog exists, let's log to it" (in
>    some cases).
>
> C. Another is: This is "stale" log, i.e. no branch exists, but the log
>    is there.
>
> Which is one reason[2] we'd delete them on branch deletion, because
> otherwise we'd start logging again when a branch is re-created, which
> possibly isn't what we wanted.
>
> 1. https://lore.kernel.org/git/de5e2b0e290791d0a4f58a893d8571b5fc8c4f1a.1646952843.git.avarab@gmail.com
> 2. I'm not saying this was intended, and haven't looked into this case,
>    just that's it it's an emergent effect of how these files are treated
>    now.

Very interesting, thx. Fwiw I would argue that resuming full logging
when a new branch appears with the same name (within the period of
time where the reflog is not empty yet) is a very reasonable thing to
end up doing, but I guess Han-Wen's note about potential path
conflicts on branches *after* a deletion make this a hard thing to
change, even if "accidental logging resuming" were accepted as a
sensible outcome here.

  reply	other threads:[~2022-03-14 12:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 11:27 Keep reflogs for deleted (remote tracking) branches? Tao Klerks
2022-03-08 11:54 ` Han-Wen Nienhuys
2022-03-08 12:59   ` Ævar Arnfjörð Bjarmason
2022-03-14  8:25     ` Tao Klerks
2022-03-14 10:44       ` Ævar Arnfjörð Bjarmason
2022-03-14 12:10         ` Tao Klerks [this message]
2022-03-08 14:57 ` Jeff Hostetler
2022-03-14  8:09   ` Tao Klerks

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=CAPMMpohNi4LhyQm+WYfmRRVZ_B2YfoqeRzWRusza6VUwkJUOWg@mail.gmail.com \
    --to=tao@klerks.biz \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hanwen@google.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.
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).