git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Jeff King <peff@peff.net>
Cc: Wincent Colaiuta <win@wincent.com>,
	Eric Raible <raible@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Nicolas Pitre <nico@cam.org>
Subject: Re: [PATCH 2/2] git-gc: skip stashes when expiring reflogs
Date: Fri, 13 Jun 2008 09:16:42 +0200	[thread overview]
Message-ID: <48521EDA.5040802@op5.se> (raw)
In-Reply-To: <20080613055800.GA26768@sigill.intra.peff.net>

Jeff King wrote:
> On Fri, Jun 13, 2008 at 06:26:28AM +0200, Andreas Ericsson wrote:
> 
>> Why are branches better and more appropriate?
>> Is it because the developer who first thought of stashes didn't think they'd
>> be used for any halflong period of time?
>> Is it because there are actions you can do on a branch that you can't do on
>> a stash?
>>
>> Who's to say what's appropriate and not? If I explicitly tell a system to
>> save something for me I damn well expect it to be around when I ask that
>> same system to load it for me too.
> 
> I think we are getting into circular reasoning here (on both sides):
> 
> Branches are better, because they don't expire. Stashes expire, because
> branches are a better way to do what you want.
> 
> Stashes shouldn't expire, because the user told the stash to save
> information. The user considers it a "save" because stashes hold things
> forever. Stashes hold things forever because they shouldn't expire.
> 
> In other words, yes, the developer who thought of stashes didn't think
> they'd be used for a long period of time. That's _why_ they were
> designed as they were. The status quo argument says "this is what a
> stash is, because that is how it is implemented."
> 
> So I would expect people in favor of the change to say "here is why
> long-term stashes are useful." And I would expect such an argument to
> address the fact that we don't simply want to recreate branches (badly).
> In other words, what is the compelling use case that makes people want
> to stash for months at a time?
> 

Ah right. Thanks for clarifying and putting me back on a useful track.

To me, long-living stashes are useful because I can all of a sudden be
pulled away from something I'm working on and set to work on something
entirely different for up to 6 months (so far we haven't had a single
emergency project run longer than that). It doesn't happen a lot, but
it *does* happen.

When that happens, I just leave everything as-is, because that's the
most useful state for me to find it in and serves as a nice bump to jog
my memory as to precisely it was I was working on. When I get back it's
possible that someone else has committed design changes or some minor
bugfixes, so naturally I always fetch to make sure I inspect the latest
changes.

I sometimes have stashes around for a day or two if it turns out I
absolutely have to fix some bug or add something to an API before I
can finish the feature I just started working on and the minor change
turns out to be not-so-minor (or if it requires a day or two of testing
to verify).

Sure, I could probably benefit from starting a topic-branch immediately
and then rebase it later, but I also have a git-daemon running so my
co-workers can fetch the latest from me (I work with back-end stuff
usually, and sometimes they need mockups of soon-to-be-real API stuff
which we'd prefer not to get into the central repository), and I don't
want them to get the stuff I *know* is incomplete. It leads to confusion
and unnecessary work. Stashes are handy there.

This workflow works fine for me, but I'd be appalled if I all of a sudden
got back from a period of being away, did a git-fetch and had git-gc
remove my stash(es). I rarely have more than one or two.

Come to think of it, I think it has actually happened once, and I spent
two days trying to find the changes I knew I had made before I gave up
and wrote it down to the changes having been done on a testing system
and overwritten at a later time.

I think these are the options we're faced with:
1. Never expire stashes (don't shoot the user)
2. Don't treat stashes specially (shoot the user)
3. Don't purge stashes when auto-gc-ing (let the users shoot themselves)
4. Make the behaviour configurable (let the users shoot themselves)
5. Double the expiration time on stashes and warn for them when they should
   normally have expired (during gc, that is) (shoot the user, but warn first).

I'm all for #4 and will cook up a patch for that next week when I'm on
vacation unless #1 gets applied before that.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

  reply	other threads:[~2008-06-13  7:17 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OLvkESB0JjBNs9kF8Q2M5UFNBJqq4FjbgGeQVyWstGwcXqCOq16_oomM0y-utOBbV7BnndyrICE@cipher.nrlssc.navy.mil>
2008-06-11 21:29 ` [PATCH 2/2] git-gc: skip stashes when expiring reflogs Brandon Casey
2008-06-11 21:36   ` Mike Hommey
2008-06-11 21:44     ` Johannes Schindelin
2008-06-11 23:03       ` Jeff King
2008-06-11 23:21         ` Nicolas Pitre
2008-06-12  4:32           ` Eric Raible
2008-06-12  5:35             ` Wincent Colaiuta
2008-06-12 14:14               ` Nicolas Pitre
2008-06-12 20:13               ` Junio C Hamano
2008-06-12 20:35                 ` Eric Raible
2008-06-12 20:51                   ` Junio C Hamano
2008-06-12 21:36                     ` Eric Raible
2008-06-13  4:52                       ` Johannes Schindelin
2008-06-13  8:43                         ` Wincent Colaiuta
2008-06-13  9:13                           ` Jeff King
2008-06-13 21:41                           ` Johannes Schindelin
2008-06-13 23:33                             ` Christian Jaeger
2008-06-14  8:58                             ` Wincent Colaiuta
2008-06-14 23:59                             ` しらいしななこ
     [not found]                             ` <200806142359.m5ENxsBL028758@mi0.bluebottle.com>
2008-06-15  4:00                               ` Johannes Schindelin
     [not found]                             ` <200806142359.m5ENxsBI028758 @mi0.bluebottle.com>
2008-06-15  5:07                               ` Junio C Hamano
2008-06-16  3:33                                 ` Eric Raible
2008-06-16  7:21                                 ` Junio C Hamano
2008-06-17  9:05                                   ` Johannes Schindelin
2008-06-17 21:54                                     ` Junio C Hamano
2008-06-18 15:25                                       ` Johannes Schindelin
2008-06-18 18:58                                         ` Junio C Hamano
2008-06-16 16:30                                 ` Brandon Casey
2008-06-16 16:52                                   ` Jakub Narebski
2008-06-13 12:05                         ` Mikael Magnusson
2008-06-12 21:27                 ` Brandon Casey
2008-06-12 21:46                   ` Junio C Hamano
2008-06-12 22:10                     ` Brandon Casey
2008-06-13  3:45                   ` しらいしななこ
2008-06-13  4:26               ` Andreas Ericsson
2008-06-13  5:58                 ` Jeff King
2008-06-13  7:16                   ` Andreas Ericsson [this message]
2008-06-13  7:42                     ` Jeff King
2008-06-13  8:11                       ` Andreas Ericsson
2008-06-13  8:51                       ` Jakub Narebski
2008-06-13  8:56                       ` Sverre Rabbelier
2008-06-13  9:10                         ` Jeff King
2008-06-13 11:14                           ` Miles Bader
2008-06-13  9:47                       ` Junio C Hamano
2008-06-13 10:05                         ` Jakub Narebski
2008-06-13 10:33                         ` Sverre Rabbelier
2008-06-13 17:31                           ` Olivier Marin
2008-06-13 19:21                           ` Junio C Hamano
2008-06-13 19:35                             ` Wincent Colaiuta
2008-06-13 19:42                             ` Brandon Casey
2008-06-13 19:49                             ` Olivier Marin
2008-06-14  1:16                           ` しらいしななこ
2008-06-13 12:40                         ` Wincent Colaiuta
2008-06-13 13:11                           ` Jeff King
2008-06-13 17:03                         ` Olivier Marin
2008-06-13 13:54                     ` Jon Loeliger
2008-06-13 16:54                   ` Brandon Casey
2008-06-11 23:25         ` Brandon Casey
2008-06-12  4:18           ` Jeff King
2008-06-12 16:46             ` Brandon Casey
2008-06-13  5:48               ` Jeff King
2008-06-13  8:41                 ` Wincent Colaiuta
2008-06-13  8:53                   ` Sverre Rabbelier
2008-06-13  9:07                     ` Teemu Likonen
2008-06-13  9:04                   ` Jeff King
2008-06-13 11:22                 ` Miles Bader
2008-06-13 16:43                 ` Brandon Casey
2008-06-13 17:30                   ` Jeff King
2008-06-11 22:35     ` Brandon Casey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48521EDA.5040802@op5.se \
    --to=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=nico@cam.org \
    --cc=peff@peff.net \
    --cc=raible@gmail.com \
    --cc=win@wincent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).