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

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

 



"Sverre Rabbelier" <alturin@xxxxxxxxx> writes:

> On Fri, Jun 13, 2008 at 11:47 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> <big snip>
>
>> But let's not talk nor think about per-branch stash for now.  How does the
>> "keep" thing sound to people?
>
> I'm divided on this:
>  OOH: I like the idea of having a keep command to mark stashes as
> valuable, making them not expire until dropped explicitly. Such a
> feature would also encourage user to go through their stashes every
> now and then and decide which ones are valuable, and which ones were
> indeed not that valuable and may be dropped.
>
>  OTOH: I dislike the idea of 'forcing' the users to go through their
> stashes lest they lose their work.

The latter argument is somewhat misguided.

To stash is like putting something in /tmp on a system that runs a cron
job to clean out cruft from there once in a while.  Another analogy is to
spitting an information out to syslog, so that it is kept until logs are
rotated.

If you want permanent storage, you do not store it in somewhere that is
designed to have automated rotation or pruning.  Instead, you would create
a file somewhere in your $HOME or use a branch.  It is natural that you do
not have perfect foresight --- so after putting something in /tmp, you may
wish that you can somehow say retroactively that some things you placed
earlier in /tmp are more valuable than others.  "keep" was an example of
how you _could_ express that wish.  In other words, you are not _forced_
to, but you are merely given an opportunity to do so.

I do not personally care too deeply about the "keep" approach.  An easier
to explain (and perhaps easier to implement, too) alternative would be to
have a per-ref configuration variable that specifies the reflog retention
period per ref, e.g. "git config reflog.refs/stash.expire never".

I however mildly suspect that the stash configured as such would end up to
be a lot worse than the current behaviour in practice.  It would make
crufts easily accumulate in the stash, making it harder to find gems, and
as a consequence of that, encouraging you to say "stash clean" or "stash
drop" more often, risking accidental removal of what you did not intend
to (for this exact reason I earlier  -- much earlier than the current
thread -- even thought about suggesting to make the reflog expiry period
much shorter than the usual ref).

But at that point it is user shooting his foot off ;-)
--
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