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
Wincent Colaiuta <win@wincent.com>
Date
Jun 14, 2008, 08:58 UTC
Message-ID
<612BAE20-8DF3-4323-8AEF-527B92122A7A@wincent.com>
In-Reply-To
<alpine.DEB.1.00.0806132239490.6439@racer>
El 13/6/2008, a las 23:41, Johannes Schindelin escribió:
Show 30 quoted lines
> Hi,
>
> On Fri, 13 Jun 2008, Wincent Colaiuta wrote:
>
>> El 13/6/2008, a las 6:52, Johannes Schindelin escribió:
>>
>>> If you need something from the stash a day after stashing it, you  
>>> have
>>> a serious problem with understanding what branches are for.
>>
>> While this may be true for codebases which move forward quickly, what
>> about one which is basically finished and tends not to get touched  
>> in a
>> long time. A situation arises, you stash something, the phone  
>> rings, and
>> for whatever reason the stash gets forgotten and you don't revisit  
>> the
>> project at all for days, weeks, months. It wouldn't be nice to
>> eventually come back and discover that your in-progress work had been
>> "garbage" collected for you.
>
> You cannot be serious about not wanting to lose the changes when you  
> keep
> them in _one_ _single_ repository anyway.
>
> And you cannot be serious about not wanting to lose the changes when  
> you
> forget about them, for months, even.
>
> So you are making my point for me.
Your arguments are _totally_ spurious.

With respect to your first point, I didn't even mention repository duplication and backups so I don't know why you tried to inject it into the discussion. I am _completely_ serious about preserving my data in the repos I work on, and that's why I do automated backups of the home directory which contains all of my local working repos every two hours (ie 12 times per day), plus an automated whole-disk backup once every 24 hours. However, my point about "git stash" is completely independent of my backup regimen; the backup regimen exists to protect me against disk and system failures, not to protect me from my SCM.

And on your second point, you are arguing that anything you can't remember isn't worth keeping, which just isn't a sustainable argument. Can you remember the thousands of commits in Git's complete history? Would it be okay to just throw away the changes you've forgotten about?

So I don't think I've made your point for you at all; it remains for you to make it for yourself. But it seems to me that you are arguing against the sizeable majority of participants on this thread which has already dragged on too long.

So, let's recap:

(1) It is reasonable to expect, and in fact it is clear that most users _do_ expect, that Git should indefinitely remember changes that they told it to remember with "git stash save"

(2) The people largely responsible for the implementation of "git stash" never envisaged its use for long term storage (either intentional abuse of "stash", or inadvertent misuse) and architected it in such a way that it can "forget" stashes after a period of time

So far you've only attacked the first point, and your defense of the second point has consisted of nothing more than an affirmation that the status quo should remain in place because that's the way it's always been. I haven't yet heard any explanation of _why_ it's such a big deal to adjust the behaviour of the tool to match user expectations, expectations created partly by poor documentation but mostly by an unfortunate choice of name for the "stash" command.

We have a choice: re-educate users or modify the tool, and re- education seems of questionable value (for what?) and much more difficult than the latter, which has next to no cost at all. Modify the tool and we won't have to re-educate users: those who abuse "git stash" for long term storage will soon figure out that they're not using it in the best possible way when their stash list gets out of hand, and as an added bonus nobody will ever get burnt by Git throwing away something that they thought it should have kept.

An auto-expiration config variable should be enough to keep people like you happy, as you'll get to keep your auto-garbage-collected stash list, but the auto-expiration should be _off_ by default because it's best to err on the conservative side about throwing out data. Especially in a case like this one where it is clearly demonstrated that most people are surprised to learn that Git garbage collects old stashes.

Anyway, I've now stated and restated these arguments enough times and I don't think I have anything to add.

Wincent
Previous: Christian JaegerNext: しらいしななこ
Message 18 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.