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

Re: [PATCH 2/2] git-gc: skip stashes when expiring reflogs

From
Jeff King <peff@peff.net>
Date
Jun 13, 2008, 05:48 UTC
Message-ID
<20080613054840.GA27122@sigill.intra.peff.net>
In-Reply-To
<u5dYyGz0Q8KNQXnvGOEGmG2BTfT-vJCEFeSUa2I_99Q@cipher.nrlssc.navy.mil>
On Thu, Jun 12, 2008 at 11:46:34AM -0500, Brandon Casey wrote:
Show 5 quoted lines
> > stash list" and "git pull"). Not to mention that you actually _care_
> > about the stash 90 days later.
> 
> Wouldn't it usually be 30 days? Wouldn't stash objects generally be
> unreachable?
Yes, sorry, I was looking at the wrong config value.
Show 5 quoted lines
> Also, the sequence above would not have to be performed _exactly_ at the
> expiration date. The listing of the stashes i.e. git-log, does not perform
> reflog expiration AFAIK. So the initial 'stash list' and the 'git pull' do
> not have to straddle the expiration date, they can all be performed any time
> after the expiration point to produce the above behavior.

No, but it would have to be performed _after_ the expiration, but _before_ any auto-gc happened. So it is a smaller window than "anytime after expiration" but not as small as a particular 30-second window.

Show 5 quoted lines
> from reflogs even though stashes are implemented using reflogs. The big
> difference is that reflogs are created automatically and stashes are created
> by explicit user action. Automatically deleting something that git creates
> automatically is ok and desirable, doing so for something the user explicitly
> created is not necessarily so.

Wincent made this same argument. I don't really agree with it. It is predicated on the assumption that stashing something _is_ asking for git to remember it. My mental model of stashing is that it hasn't been saved at all, but is rather a convenient way of naming and storing a set of changes for a second while I do something else. I think of it in the same way as a register in vi: I can yank text into it for pasting after a few commands. But I don't expect yanked text to be stored in the register a month later.

So I think we are disagreeing not on how stashes should expire, but rather on what a stash _is_, and what it is useful for. And I am open to arguments that stashes are useful for longer-term storage. But I also find the expiration behavior useful (I seem to have accumulated some cruft in my stash list, and I expect git to clean it out during a gc, rather than me having to clean it manually). So personally, I would not be in favor of removing the expiration unless I saw evidence that the utility of keeping stashes long-term outweighed the benefit of cleaning.

And that evidence is probably "here is a workflow I find useful, and here is why it is better than any other way of doing it in git" (and maybe the "better" is simply "new users are going to jump on this way of using stash, even though it was not as intended").

-Peff
Previous: Brandon CaseyNext: Wincent Colaiuta
Message 60 of 69 in “git-gc: skip stashes when expiring reflogs”
  1. 2/2 git-gc: skip stashes when expiring reflogsBrandon Casey, Jun 11, 2008
  2. Mike HommeyJun 11, 2008
  3. Johannes SchindelinJun 11, 2008
  4. Jeff KingJun 11, 2008
  5. Nicolas PitreJun 11, 2008
  6. Eric RaibleJun 12, 2008
  7. Wincent ColaiutaJun 12, 2008
  8. Nicolas PitreJun 12, 2008
  9. Junio C HamanoJun 12, 2008
  10. Eric RaibleJun 12, 2008
  11. Junio C HamanoJun 12, 2008
  12. Eric RaibleJun 12, 2008
  13. Johannes SchindelinJun 13, 2008
  14. Wincent ColaiutaJun 13, 2008
  15. Jeff KingJun 13, 2008
  16. Johannes SchindelinJun 13, 2008
  17. Christian JaegerJun 13, 2008
  18. Wincent ColaiutaJun 14, 2008
  19. しらいしななこJun 14, 2008
  20. Junio C HamanoJun 15, 2008
  21. Eric RaibleJun 16, 2008
  22. Junio C HamanoJun 16, 2008
  23. Johannes SchindelinJun 17, 2008
  24. Junio C HamanoJun 17, 2008
  25. Johannes SchindelinJun 18, 2008
  26. Junio C HamanoJun 18, 2008
  27. Brandon CaseyJun 16, 2008
  28. Jakub NarebskiJun 16, 2008
  29. Mikael MagnussonJun 13, 2008
  30. Brandon CaseyJun 12, 2008
  31. Junio C HamanoJun 12, 2008
  32. Brandon CaseyJun 12, 2008
  33. しらいしななこJun 13, 2008
  34. Andreas EricssonJun 13, 2008
  35. Jeff KingJun 13, 2008
  36. Andreas EricssonJun 13, 2008
  37. Jeff KingJun 13, 2008
  38. Andreas EricssonJun 13, 2008
  39. Jakub NarebskiJun 13, 2008
  40. Sverre RabbelierJun 13, 2008
  41. Jeff KingJun 13, 2008
  42. Miles BaderJun 13, 2008
  43. Junio C HamanoJun 13, 2008
  44. Jakub NarebskiJun 13, 2008
  45. Sverre RabbelierJun 13, 2008
  46. Olivier MarinJun 13, 2008
  47. Junio C HamanoJun 13, 2008
  48. Wincent ColaiutaJun 13, 2008
  49. Brandon CaseyJun 13, 2008
  50. Olivier MarinJun 13, 2008
  51. しらいしななこJun 14, 2008
  52. Wincent ColaiutaJun 13, 2008
  53. Jeff KingJun 13, 2008
  54. Olivier MarinJun 13, 2008
  55. Jon LoeligerJun 13, 2008
  56. Brandon CaseyJun 13, 2008
  57. Brandon CaseyJun 11, 2008
  58. Jeff KingJun 12, 2008
  59. Brandon CaseyJun 12, 2008
  60. Jeff KingJun 13, 2008
  61. Wincent ColaiutaJun 13, 2008
  62. Sverre RabbelierJun 13, 2008
  63. Teemu LikonenJun 13, 2008
  64. Jeff KingJun 13, 2008
  65. Miles BaderJun 13, 2008
  66. Brandon CaseyJun 13, 2008
  67. Jeff KingJun 13, 2008
  68. Brandon CaseyJun 11, 2008
  69. Johannes SchindelinJun 15, 2008

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.