"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: [rfc] stash command in got
To:
Mark Jamsek <mark@jamsek.com>, gameoftrees@openbsd.org
Date:
Thu, 16 Jun 2022 17:43:38 +0200

Download raw body.

Thread
On Thu, Jun 16, 2022 at 09:33:10AM -0600, Tracey Emery wrote:
> On Thu, Jun 16, 2022 at 05:26:33PM +0200, Stefan Sperling wrote:
> > Just to illustrate, in order to create a stash during a quick task context
> > switch, you could do something like this in a script:
> > 
> >  mybranch=$(got br)
> >  got branch mystash
> >  got commit -m stash
> >  got up -b $mybranch
> > 
> > What advantages would a native stash feature offer?
> > 
> 
> Sure, this works in one direction. What's the quick way to pop it back
> to mybranch? A diff has to be created and patched back to mybranch and
> mystash deleted, correct? Or is there a quicker way in a script like
> this?

This should work in many cases: got cherrypick mystash

You can do this on any branch, so just like stash pop you don't
need to first rewind your work tree back to the original state
which the stashed change was based on.