Re: [PATCH 2/2] git-gc: skip stashes when expiring reflogs
- From
- Sverre Rabbelier <alturin@gmail.com>
- Date
- Jun 13, 2008, 08:53 UTC
- Message-ID
- <bd6139dc0806130153u75c53b4do8e7b63f4a7f144e7@mail.gmail.com>
- In-Reply-To
- <CA1D4ABE-0B83-44CC-B582-1E85784330AB@wincent.com>
On Fri, Jun 13, 2008 at 10:41 AM, Wincent Colaiuta <win@wincent.com> wrote:
Show 11 quoted lines
> El 13/6/2008, a las 7:48, Jeff King escribió: >> On Thu, Jun 12, 2008 at 11:46:34AM -0500, Brandon Casey wrote: >>> 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.
An assumption I agree with: Use git-stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
Note the "saves your local modifications", which is, to me, the same as "please do remember this until I tell you to forget it".
Show 7 quoted lines
> For me it is quite clear that stashing something _is_ asking for Git to > remember it. It's an explicit user action. It's a request to remember > something. Whether or not this is actually the best tool for the job of > long-term storage is much less important than the fact that the user > explicitly requested it. IMO this trumps all other factors. Just because > "stash" sounds quicker than "commit" doesn't make it any less of an > instruction to Git to store something.
I agree fully with what Wincent is saying, stashes have an explicit
way of cleaning them up:
Remove all the stashed states. Note that those states will then be
subject to pruning, and may be difficult or impossible to recover.
To me this suggests that otherwise stashes will _not_ be subject to
pruning, which is exactly what this patch does, it makes sure that
stashes are not subject to pruning unless you 'git stash clear' first.-- Cheers, Sverre Rabbelier