[PATCH RFC/WIP] introduce stash command

Idan Kamara idankk86 at gmail.com
Mon Jun 4 09:35:17 CDT 2012


On Mon, Jun 4, 2012 at 4:51 PM, Augie Fackler <raf at durin42.com> wrote:
>
>
> On Jun 2, 2012, at 5:00 PM, Matt Mackall wrote:
>
> > Ok. Git does this, and it works pretty well for them. This has the
> > upside of not being lossy like an MQ diff and properly connected to
> > history for future rebasing.
> >
> > - flagged/tracked with bookmarks
> >
> > Hmm. Git does something with refs/stash. I don't know Git internals well
> > enough to tell how this relates to their other ref namespaces or whether
> > stashes are hidden from push/pull, but I assume they are.
>
> AIUI, git has a single 'stash' ref which points to the latest stash (that
> is, they don't support named stashes). They use the reflog (a journal of
> where a ref has pointed over time) to point at older stash elements as you
> pop (apply) stashes. This actually means that if stashes lurk around long
> enough in git, they can expire out of the reflog and get gc'ed.

Interesting. Come to think of it, having both a name and a message
seems redundant.

>
> Idan, one nice feature of 'git stash' is that you don't have to name the
> stashes - is that something your code currently supports?

Yes, they're unnamed by default and ordered by revision:

  Referring to stashes is done either by index (as
  shown in --list) or name (if one was given). If neither
  is specified, the most recent stash is chosen.

>
> > The bookmark namespace pollution here is a bit worrisome. People will be
> > able to see these names remotely, and clone will clone them by default.
>
> Perhaps we should reserve an area in the bookmarks namespace sooner rather
> than later for hacks like this? .hg/?

I moved the stashes to hg/stashes/*, but .hg/ might be more compliant
with other secretive stuff.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120604/4bea8626/attachment.html>


More information about the Mercurial-devel mailing list