Re: [PATCH 2/2] git-gc: skip stashes when expiring reflogs
- From
- Olivier Marin <dkr+ml.git@free.fr>
- Date
- Jun 13, 2008, 17:03 UTC
- Message-ID
- <4852A85E.6020406@free.fr>
- In-Reply-To
- <7vtzfxwtt0.fsf@gitster.siamese.dyndns.org>
Junio C Hamano a écrit :
>
> * We _did not have to_ make stashes into refs/stash@{$N}. We could have
> implemented them as individual refs under "refs/stash/$N" hierarchy.
> E.g. refs/stashes/1, refs/stash/2, etc.I don't really see what is the need for "global" stashes but why not?
> As a side note, we also could have implemented per-branch stash as
> refs/stashes/master@{$N} or refs/stashes/$branch/$N (and we still can.
> Perhaps we can have "git stash save -B" option that tells the command
> to send the resulting stash to the per-branch namespace).I really like your refs/stashes/$branch/$N idea because it seems easier to list and clean with git stash list/drop/clear. But I think stash should stay a per-branch thing by default. What about a -g (--global) option instead?
> * We later introduced "drop" because even as a volatile and short-lived > collection of local modifications, you can tell that some stashes are > utter crap immediately while deciding that some are worth keeping, even > for a short term.
"drop" is nice, but I think the real improvement was "pop".
> * We could add "keep" which is a complementary operation to "drop". This > would mark a stash as a gem in a more direct way, excempt even from the > usual auto pruning.
I don't like it at all. Why not just have "keep" by default? The users can already use "pop", "drop" and "clear" if they want to trash their stash.
Olivier.