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

Re: dangling blob which is not dangling at all

From
RDRogan Dawes <lists@dawes.za.net>
Date
Aug 1, 2007, 09:13 UTC
Message-ID
<46B04EB7.80006@dawes.za.net>
In-Reply-To
<46B045D3.4070208@midwinter.com>
Steven Grimm wrote:
Show 18 quoted lines
> Domenico Andreoli wrote:
>> What is this reflog thing and why is required?
>>   
> 
> It is a log of where each ref pointed at any given time. Or rather, a 
> log of changes to refs, with timestamps. It is not *required* per se 
> (you can turn it off and almost all of git will continue to work as 
> before) but it's handy in that you can say stuff like
> 
> git checkout -b newbranch master@"{4 days ago}"
> 
> and git will give you a new branch pointing at the rev that master 
> pointed to 4 days ago, even if it's a rev that is no longer reachable 
> from any of the existing heads (e.g., because you did a "git rebase" and 
> the rev in question was replaced by a new one.) Obviously as soon as you 
> do a "git gc" you will lose the ability to go back to unreachable revs 
> using the reflog.
> 

Not strictly true. "git gc" does take the reflogs into account when determining reachability, but it also prunes the reflogs periodically to prevent them from growing without bound (and preventing pruning of otherwise unreachable objects).

 From the git-gc manpage:
CONFIGURATION
  The optional configuration variable gc.reflogExpire can be set to
  indicate how long historical entries within each branch's reflog should
  remain available in this repository. The setting is expressed as a
  length of time, for example 90 days or 3 months. It defaults to 90
  days.
Regards,
Rogan
Previous: Steven GrimmNext: Domenico Andreoli
Message 7 of 8 in “dangling blob which is not dangling at all”
  1. Domenico AndreoliAug 1, 2007
  2. Linus TorvaldsAug 1, 2007
  3. Domenico AndreoliAug 1, 2007
  4. Junio C HamanoAug 1, 2007
  5. Domenico AndreoliAug 1, 2007
  6. Steven GrimmAug 1, 2007
  7. Rogan DawesAug 1, 2007
  8. Domenico AndreoliAug 1, 2007

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.