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

Re: [PATCH 2/2] reflog: ignore expire-unreachable for "HEAD" reflog

From
Jeff King <peff@peff.net>
Date
Apr 15, 2010, 16:36 UTC
Message-ID
<20100415163607.GA4279@coredump.intra.peff.net>
In-Reply-To
<4BC70D75.70801@viscovery.net>
On Thu, Apr 15, 2010 at 02:58:29PM +0200, Johannes Sixt wrote:
Show 14 quoted lines
> Am 4/15/2010 14:30, schrieb Junio C Hamano:
> > A reflog consists of entries, each of which records how you got to the
> > current history by pointing to different commit objects.  Some entries
> > matter more than others do.  Dead-end experiments stop mattering faster
> > than others.  It is these _entries_ that we expire, because keeping them
> > indefinitely is a wasteful clutter.
> 
> I have no problem with this point of view, i.e., that expiration is merely
> about the entries, and that garbage-collecting objects is just a
> side-effect of removed entries.
> 
> But I don't see yet, why an entry pointing to a dead-end experiment is
> less important when it is an entry in a branch reflog than when it is an
> entry in the HEAD reflog. Care to explain?

I think it is because the reachability test is defined as "from the current ref". So if I am doing a reachability test on next@{20}, I will check whether it is in the current version of next. Unreachable things are therefore dead-end experiments. But on HEAD, if I do:

  $ git checkout topic1
  $ git checkout topic2

Then the entry for HEAD@{1} will be unreachable from the current HEAD, even though it is _not_ a failed experiment. It is just that we are no longer pointing to that branch.

I think another way of addressing the same problem would be to redefine "reachable" in this context as "reachable from any current ref".

-Peff
Previous: Johannes SixtNext: Junio C Hamano
Message 8 of 16 in “Document gc.<pattern>.reflogexpire variables”
  1. 1/2 Document gc.<pattern>.reflogexpire variablesJunio C Hamano, Apr 14, 2010
  2. 2/2 reflog: ignore expire-unreachable for "HEAD" reflogJunio C Hamano, Apr 14, 2010
  3. Johannes SixtApr 15, 2010
  4. Junio C HamanoApr 15, 2010
  5. Johannes SixtApr 15, 2010
  6. Junio C HamanoApr 15, 2010
  7. Johannes SixtApr 15, 2010
  8. Jeff KingApr 15, 2010
  9. Junio C HamanoApr 15, 2010
  10. Nicolas PitreApr 15, 2010
  11. Junio C HamanoApr 15, 2010
  12. Nicolas PitreApr 16, 2010
  13. Junio C HamanoApr 16, 2010
  14. Nicolas PitreApr 16, 2010
  15. Johannes SixtApr 16, 2010
  16. Junio C HamanoApr 15, 2010

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.