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

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

 



On Thu, Jun 12, 2008 at 11:46:34AM -0500, Brandon Casey wrote:

> > 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.

> 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.

> 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
--
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