[PATCH 3 of 5] shelve: use an --unshelve parameter instead of a command

Matt Mackall mpm at selenic.com
Thu Sep 19 16:41:40 CDT 2013


On Wed, 2013-09-18 at 21:31 -0700, Siddharth Agarwal wrote:
> On 09/18/2013 09:29 PM, David Soria Parra wrote:
> > I used an parameter --unshelve instead of a command due to the previous
> > discussion on the extension. I personally don't have a preference, but
> > it was suggested that we don't use an "unshelve" command. This way all
> > the parameters are defined on the same command. Would you prefer
> > "--apply" maybe?
> >
> > Matt and rest: Any suggestions on the UI bits?
> 
> I'd prefer unshelve too.

Ok, let's look at the precedents.

First, git. We generally don't usually appeal to git for UI inspiration,
but as this particular command is modeled off of git stash, it makes
sense. The git synopsis looks like this:

       git stash list [<options>]
       git stash show [<stash>]
       git stash drop [-q|--quiet] [<stash>]
       git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]
       git stash branch <branchname> [<stash>]
       git stash [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
                    [-u|--include-untracked] [-a|--all] [<message>]]
       git stash clear
       git stash create

Now let's look at 'the other shelve extension':

	hg shelve [--name x] [--append] [--all]
	hg shelve --list
	hg unshelve

We've got a bunch of commands of the form foo/foos to make/list:

	tag/tags
	bookmark/bookmarks
	branch/branches

..but these each have a different way to unmark:

	tag --remove (-r is rev, -d is date)
        bookmark -d/--delete (let's fix this!)
        hg commit --close-branch

We've also got resolve and bisect which have a bunch of "subcommands":

	resolve
	resolve -l
	resolve -m/-u
	bisect -r/-g/-b/-s

And we've got mq, which has _many_ commands, but one each for
create/list/apply.

So I think there are three possibilities which are really consistent
with our existing UI:

a) one command with suboptions (like resolve)

	hg shelve [name]
	hg shelve -l/--list
	hg shelve -u/--unshelve (or -p/--pop) [name]

b) two commands (like tags/bookmarks)

	hg shelve [name]
	hg shelves
	hg shelve --u [name]

c) three commands (like mq)

	hg shelve [name]
	hg shelves
	hg unshelve [name]

My preference is for the first. If a year from now, we discover everyone
wants unshelve and/or shelves, we can add that. But it's bit harder to
take commands away. 

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list