From: Tracey Emery Subject: Re: [rfc] stash command in got To: Mark Jamsek , gameoftrees@openbsd.org Date: Thu, 16 Jun 2022 10:23:52 -0600 On Thu, Jun 16, 2022 at 05:43:38PM +0200, Stefan Sperling wrote: > 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. > And now a quick unpop script and I'm good. if [[ $# -eq 0 ]];then print "Something to cherrypick is required" exit fi mybranch=$(got br) got cherrypick $1 got br -d mystash -- Tracey Emery