From: Nicolas Pitre <nico@cam.org>
To: Jeff King <peff@peff.net>
Cc: Brian Downing <bdowning@lavos.net>,
Junio C Hamano <gitster@pobox.com>,
David Symonds <dsymonds@gmail.com>, Bill Lear <rael@zopyra.com>,
Jay Soffian <jaysoffian@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: Keeping reflogs on branch deletion
Date: Thu, 14 Feb 2008 12:32:07 -0500 (EST) [thread overview]
Message-ID: <alpine.LFD.1.00.0802141147200.2732@xanadu.home> (raw)
In-Reply-To: <20080214163101.GA24673@coredump.intra.peff.net>
On Thu, 14 Feb 2008, Jeff King wrote:
> On Thu, Feb 14, 2008 at 11:16:20AM -0500, Nicolas Pitre wrote:
>
> > > How is that any different than accumulating old entries in reflog files
> > > for branches that _do_ exist? In both cases, they should be dealt with
> > > via time-based pruning.
> >
> > Branches that do exist are more likely to be interesting to you than
> > branches that, hopefully in 99% of all cases, you willfully deleted.
>
> I agree that they tend to be more interesting, but the point of reflogs
> is to have a log of operations performed for later examination. We
> already have a well-defined boundary for "interesting": things that are
> older than N days. Why introduce another such boundary? Are your reflogs
> for deleted branches so large that you aren't willing to keep them?
I typically have lots of branches. Many of those are fairly dynamic --
they come and go. Keeping reflogs for them would only clutter the
reflog space, especially when the same names are reused. I prefer to
have a clean reflog for the currently alive branch of a given name
rather than having a log of anything that occurred under that name. And
if I really want to find out about that old branch then there is always
the HEAD reflog.
> (There is actually one reason I can think of to get rid of reflogs for
> deleted branches. Branch naming rules depend on which branches exist.
> Thus I can have "foo/bar" only if "foo" does not exist, which means that
> I can only have a reflog for "foo/bar" if the one for "foo" has been
> deleted. But that is a limitation of the current scheme for storing
> reflogs).
Sure, and that limitation is IMHO quite sane. I don't think it is worth
stretching it just for the convenience of having refs for deleted
branches elsewhere than from the HEAD reflog.
> For one thing, just because a modification wasn't _yours_ doesn't mean
> it isn't valuable. It entered your repository, and therefore it may be
> of interest.
And if you delete it then you can retrieve it again from its origin.
If, on the other hand, you _checkout_ that branch (it now entered the
HEAD reflog), and _commit_ to it (which commit would be unreachable
from other sources) then _that_ is a ref worth keeping a log of.
> Secondly, you _can_ change a ref without it being the HEAD. Try
>
> git branch -f foo bar
Sure. And what information would become unreachable if you delete 'foo'
at that point? The 'bar' commit is not lost, and likely to still exist
in some other reflog.
> > > In other words, I don't see "oops, I deleted this branch and its history
> > > is valuable to me" as significantly less likely than "oops, I got rid of
> > > this commit and its history is valuable to me."
> >
> > But you still have it, in the HEAD reflog, at least for your own
> > changes. I therefore don't see the value of having to keep named branch
> > reflogs around just for the small convenience, especially with the
> > semantic issues that comes with it.
>
> My HEAD reflog has almost 1000 items in it. Finding out which commit
> would have been branch@{0} in there is non-trivial.
This is trivial.
$ git log -g HEAD | grep -C2 "^Reflog.*moving from branch to"
If the first hit is HEAD@{x} then your branch@{0} is just HEAD@{x+1}.
> I agree that this information is less likely to be interesting than the
> usual use of reflogs. But I don't agree that the semantics are that
> difficult. What issues are you talking about?
The naming of deleted reflogs when new branches with same name are
created, or the concatenation of entries for unrelated branches that
might happen to have existed under the same name.
And because the relevant entries are already in the HEAD reflog anyway,
and trivially retrieved as demonstrated above, I don't think it is worth
adding any additional complexity for what is only a convenience feature
that is not supposed to be used many times a day after all.
Nicolas
next prev parent reply other threads:[~2008-02-14 17:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-14 1:39 A couple branch questions Jay Soffian
2008-02-14 1:45 ` David Symonds
2008-02-14 2:24 ` Bill Lear
2008-02-14 3:03 ` David Symonds
2008-02-14 3:43 ` Junio C Hamano
2008-02-14 14:01 ` Keeping reflogs on branch deletion Brian Downing
2008-02-14 15:00 ` Nicolas Pitre
2008-02-14 15:08 ` Johannes Schindelin
2008-02-14 15:17 ` Jeff King
2008-02-14 16:16 ` Nicolas Pitre
2008-02-14 16:31 ` Jeff King
2008-02-14 17:32 ` Nicolas Pitre [this message]
2008-02-14 17:57 ` Jeff King
2008-02-14 20:17 ` Wincent Colaiuta
2008-02-14 16:35 ` Jakub Narebski
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.1.00.0802141147200.2732@xanadu.home \
--to=nico@cam.org \
--cc=bdowning@lavos.net \
--cc=dsymonds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jaysoffian@gmail.com \
--cc=peff@peff.net \
--cc=rael@zopyra.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.
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 NNTP newsgroup(s).