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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King wrote:
> On Wed, Jun 11, 2008 at 06:25:23PM -0500, Brandon Casey wrote:
> 
>> Yes, I think usually stashes are used for very short term storage. At the
>> same time, I don't expect a stash (however old) to disappear without me
>> explicitly deleting it.
>>
>> In particular, I don't want to experience this:
>>
>> $ git stash list
>> stash@{0}: WIP on master: 8c372fb... git-cvsimport: do not fail when CVS is /
>> $ git pull
>> $ git stash apply
>> fatal: Needed a single revision
>> : no valid stashed state found
> 
> Did that actually happen to you?

It has happened and that is what brought it to my attention. But I don't
remember whether I was testing reflog or gc, or whether they had reached
the expiration date naturally or not. The stashes that were lost were
not important, so the incident was enough to put the idea in the back of
my mind, but not enough for me to yell and scream. Maybe that's proof that
persistent stashes are unnecessary?, I don't know.

> Because it seems kind of unlikely to me
> that you would perform this exact sequence of events, _exactly_ 90 days
> after stashing (i.e., the 90 day period expires sometime between "git
> 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?

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.

> So yes, I would hate for that to happen, too. However, I think there is
> a real benefit to garbage collecting stashes, and the scenario you
> describe seems implausibly unlikely.

I really hate special cases, so special casing stashes is something I was
reluctant to do. At the same time I see stashes as something very different
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.

Now that I have read some of my email, I see that this conversation has been
continued without me and this same point has already been made much more
elikwintlee by Wincent Colaiuta.

-brandon

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux