[darcs-users] [issue1891] darcs stash

Eric Kow kowey at darcs.net
Thu Jul 15 12:08:07 UTC 2010

Hi all,

Jason posted an idea to the issue tracker which merits some discussion.

Warning, this is a longish mail as I'm selectively quoting from 4 messages
and adding a reply of my own.  See http://bugs.darcs.net/issue1891 and
http://bugs.darcs.net/patch303 for more details.

On Tue, Jul 13, 2010 at 23:20:13 +0000, Jason Dagit first suggested:
dagit> git provides a 'stash' as a place to push unfinished work so that it is 
dagit> no longer in your working directory.  This is really handy when merging 
dagit> changes that will clobber your unfinished work.
dagit> In the darcs folklore, this is simply a:
dagit> darcs record -m "hey, I'm not done yet"
dagit> darcs pull
dagit> darcs amend-record --edit-description
dagit> Except, that the merge done by pull might still clobber your work.  In 
dagit> that case, you would do a 'darcs send -O' to yourself, unpull the patch, 
dagit> etc.
dagit> It would be really nice, especially for git converts, if we simply 
dagit> offered these workflows in a nice package.  Say, darcs stash/unstash.

Eric tried to frame the discussion:
kowey> [N]ote that whoever implements this should be aware of our conscious 
kowey> effort to resist new features.  See the Grumpy Old Man process described 
kowey> in http://wiki.darcs.net/Ideas.  It's fine for us to implement new 
kowey> features and change the UI, but we should make sure we've made a best 
kowey> effort to take a global and long-term view of Darcs to ensure that the 
kowey> whole user interface fits together harmoniously (rah rah, conceptual 
kowey> integrity).  Sometimes we even change the UI just so to achieve greater 
kowey> harmony.  In the long term, I want Darcs to have a reputation as being 
kowey> incredibly easy to learn and easy to use effectively.  Paying careful 
kowey> attention to conceptual integrity is a big part of this.

Eric commented:
kowey> You may also want to be aware of darcs obliterate -O, which I think 
kowey> would provide a sort of stash operation when combined with record 
kowey> (unstash would then be apply + unrecord).

Kevin suggested:
quick> Also note that the stash concept can be accomplished by simply using 
quick> another darcs repo.
quick> workdir$ darcs get . ../stash
quick> ... do some work in workdir...
quick> workdir$ darcs record -m ":INPROG: "hey, I'm not done yet"
quick> workdir$ darcs push --no-set-default -p :INPROG ../stash
quick> workdir$ darcs unpull -p :INPROG
quick> workdir$ darcs pull
quick> workdir$ darcs pull --no-set-default ../stash

Petr suggested another alternative (patch303 - DRAFT)
mornfall> I reckon that revert -o/-O would work as good, without introducing any extra
mornfall> complexity. Sure, stash is just one little pair of commands (stash/unstash) and
mornfall> some little bit of extra logic to keep the bundles hidden somewhere under
mornfall> _darcs, and some little bit of extra logic to list/remove/etc. those bundles.
mornfall> All tasks that are more adequately served by the familiar filesystem
mornfall> commands...

Jason (replying to Kevin and me):
kowey>> "In the long term, I want Darcs to have a reputation as being 
kowey>> incredibly easy to learn and easy to use effectively.  Paying careful 
kowey>> attention to conceptual integrity is a big part of this."

quick>> "Also note that the stash concept can be accomplished by simply using 
quick>> another darcs repo.
quick>> workdir$ darcs get . ../stash
quick>> ... do some work in workdir...
quick>> workdir$ darcs record -m ":INPROG: "hey, I'm not done yet"
quick>> workdir$ darcs push --no-set-default -p :INPROG ../stash
quick>> workdir$ darcs unpull -p :INPROG
quick>> workdir$ darcs pull
quick>> workdir$ darcs pull --no-set-default ../stash"

dagit> As far as I'm concerned, those two quotes are compelling reasons to want a 
dagit> stash.  That list of commands is really obnoxious compared to simply, 
dagit> "darcs stash".

Emphasis on the conceptual integrity, mind you.
My implicit claim is that ease of use stems from conceptual integrity.
Convenience is important but secondary.

dagit> I need no further convincing nor do I care to convince others.
dagit> If the grumpy old man really dislikes this feature then so be it and close 
dagit> the ticket.

Well hang on, that's a little hasty.  No need to worry about the spending
or not spending effort to convince others, because we're not even at that
stage of the discussion yet.

Look, the Grumpy Old Man (whoever so sticks their neck out) isn't so much
trying to be Mr No but a Mr How-Can-We-Fit-Everything-Together-Nicely?

It's tough.

The reason I much such a big show of banging on the Conceptual Integrity drum
(eg. by creating the Grumpy Old Man institution) is that (i) I certainly don't
trust myself to make the right UI decisions alone and (ii) if we make decisions
as team, we're bound to have different ways of looking at things, which runs
the risk of building a lumpy incoherent UI (Frankenstein's monster).  Insisting
on Conceptual Integrity (bang!) is an attempt at having our cake (group
planning) and eating it too (unified vision).

Anyway, we have at least three options to work with now.

 - a workflow based on pushing to another repository
 - revert -o/-O (stash) and unrevert (unstash)
 - and a proper darcs stash command

But maybe something new will come up?  Maybe the best way to achieve this sort
of Conceptual Integrity (bang!) really is to implement some sort of darcs
stash/unstash command.  Or perhaps instead such a command would be obviated by
in-repo branching.  Or maybe something completely different, some completely
brilliant and laterally thought approach to the Work in Progress problem.



PS. I'm sorry of this super-deliberative, institutions-based, slowly-slowly
approach is a turn-off.  I hope it gets us the right result!  I kinda worry
about it because the success of Darcs UI came from a much different seemingly
more centralised style of development

Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, please try +44 (0)1273 64 2905.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100715/bbc998c5/attachment.pgp>

More information about the darcs-users mailing list