"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>
Cc:
gameoftrees@openbsd.org
Date:
Thu, 16 Jun 2022 17:26:33 +0200

Download raw body.

Thread
On Fri, Jun 17, 2022 at 12:57:27AM +1000, Mark Jamsek wrote:
> I posed the question offlist to Stefan who suggested it should be
> discussed on the list.
> 
> I want to add horizontal splitscreen mode to tog next, but after this
> I thought I'd try to implement stash. I use it a _lot_ in Fossil, and
> it's something I'd like to have in Got.
> 
> Are there any objections? If not, what are some things that should be
> considered?

What do you use the stash feature for?

I have rarely used stash in Git. When I used it was mostly to undo
local changes quickly to test something, as a kind of temporary revert.

A major use case of stash, at least as I understand it, is to quickly
save local changes away before switching to a different task. It seems
creating a new branch and comitting to this branch already covers this
use case, and saves us from implementing a lot of functionality which
essentially duplicates branching (create stash), committing (stash changes),
viewing history (list stashed changes), and merging/rebasing/cherrypick
(retrieve a change from the stash).

So the feature seems to introduce a lot of redundancy.
For this reason I am not a huge fan of stash as an extra feature.

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?