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

Re: [PATCH] prune: --expire=time

From
Linus Torvalds <torvalds@osdl.org>
Date
Jan 22, 2007, 02:58 UTC
Message-ID
<Pine.LNX.4.64.0701211851310.14248@woody.osdl.org>
In-Reply-To
<7virezwzpz.fsf@assigned-by-dhcp.cox.net>
On Sun, 21 Jan 2007, Junio C Hamano wrote:
Show 7 quoted lines
> >
> > So to recap: "git prune" simply isn't a safe thing to do. Don't do it 
> > without thinking. I'm not at all sure it's a good idea that "git gc" does 
> > it for you, since it just encourages mindless pruning that probably 
> > shouldn't happen in the first place.
> 
> I guess we are in agreement on this.

Well, having complained about "git prune", I at the same time have to admit that I worry about loose objects (and scary messages from git-fsck-objects) potentially confusing new people.

So "git prune" _does_ remove stuff that happens normally. It removes stuff that accumulates (even with reflog) thanks to commands that were interrupted with ^C, and it also removes the auto-merge turds that the recursive merge can create when it does its internal pseudo-commit for more complex merges.

So I don't think running "prune" from within "git gc" is necessarily wrong per se - I just don't think it's a good idea to do so by _default_, exactly because of the issues it can have.

So hiding "git prune" behind "git gc" is probably a good thing (make people learn just one thing they need to interface to), but maybe we need a "--prune" flag to the gc command, and then perhaps just document that you should be careful.

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 22 of 30 in “prune-packed: new option --min-age=N”
  1. prune-packed: new option --min-age=NMatthias Lederhofer, Jan 18, 2007
  2. Shawn O. PearceJan 18, 2007
  3. Matthias LederhoferJan 18, 2007
  4. Shawn O. PearceJan 18, 2007
  5. [RFC] prune: --expire=secondsMatthias Lederhofer, Jan 18, 2007
  6. Junio C HamanoJan 18, 2007
  7. Shawn O. PearceJan 19, 2007
  8. prune: --expire=timeMatthias Lederhofer, Jan 19, 2007
  9. Nicolas PitreJan 19, 2007
  10. Junio C HamanoJan 19, 2007
  11. Matthias LederhoferJan 20, 2007
  12. Junio C HamanoJan 21, 2007
  13. Shawn O. PearceJan 21, 2007
  14. Matthias LederhoferJan 21, 2007
  15. Junio C HamanoJan 21, 2007
  16. Jeff KingJan 21, 2007
  17. Steven GrimmJan 22, 2007
  18. Jeff KingJan 22, 2007
  19. Junio C HamanoJan 22, 2007
  20. Linus TorvaldsJan 22, 2007
  21. Junio C HamanoJan 22, 2007
  22. Linus TorvaldsJan 22, 2007
  23. Junio C HamanoJan 22, 2007
  24. Linus TorvaldsJan 22, 2007
  25. Shawn O. PearceJan 22, 2007
  26. Junio C HamanoJan 22, 2007
  27. Jakub NarebskiJan 22, 2007
  28. v1.5.0.txt: update description of git-gcJeff King, Jan 22, 2007
  29. Junio C HamanoJan 22, 2007
  30. Simon 'corecode' SchubertJan 20, 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.