Re: [PATCH 2/2] git-gc: skip stashes when expiring reflogs
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Jun 13, 2008, 12:40 UTC
- Message-ID
- <19C06D62-966A-4626-A620-2281A7CAA2B6@wincent.com>
- In-Reply-To
- <7vtzfxwtt0.fsf@gitster.siamese.dyndns.org>
El 13/6/2008, a las 11:47, Junio C Hamano escribió:
Show 15 quoted lines
> If there is a strong correlation between the two, one possible > solution > would be to introduce refs/stashes/$branch/ namespace that holds each > stash as an individual, numbered ref under it. They will live forever > until the user explicitly asks for their removal. If we go this > route, we > would need a few niceties such as a way to move a "quick stash" that > is > represented as a reflog entry into a "longlived stash" that is > represented > as an individual ref under refs/stashes/$branch/. > > But let's not talk nor think about per-branch stash for now. How > does the > "keep" thing sound to people?
Sounds a little bit over-engineered to me.
So, "stash" is intended for short-term storage, but by adding a "keep" option you're officially blessing it for long-term storage as well. And the interface that you propose, explicitly marking stuff as "for keeps" and being able to move stuff from "temp" to "keep" sounds quite complicated.
I honestly think that the simplest solution from both an implementation and a usage perspective is just to keep everything that is stashed until the user clears it out. If you use a push/pop model then your stash will never get cluttered up with garbage, and if you do abuse it for long-term storage you'll start to notice that the stash list is inconveniently large, thus hinting that perhaps you are abusing stash in ways that the designers never intended.
Cheers, Wincent