[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: A rational svn shelve/checkpoint CLI

From: Julian Foad <julianfoad_at_apache.org>
Date: Mon, 8 Jan 2018 14:34:31 +0000

Branko Čibej wrote:
> On 08.01.2018 14:31, Julian Foad wrote:
>> Towards a more rational shelving-with-checkpoints CLI.
>>
>>   svn shelf-{save,shelve,unshelve,shelves,log,drop,diff}
>>     [SHELF_SPEC...] [PATH...]
>>
>> SHELF_SPEC:
>>
>>   --shelf=[SHELF][.VERSION]
>>   @[SHELF][.VERSION]
>>
>>     Specify shelf SHELF (name, 'all', 'newest'), version VERSION
>>     (number, date, 'all', 'newest'). Defaults are per command.
>>
>>   --version=VERSION
>>
>>     Specify the default version for shelf specs in the command.
>>
>> Aliases:
>>
>>   svn save            -> svn shelf-save
>>   svn shelve          -> svn shelf-shelve
>>   svn unshelve        -> svn shelf-unshelve
>>   svn shelves         -> svn shelf-shelves
>
>
> This naming doesn't make any sense to me. Using a word root in the same
> command as both a noun and a verb runs counter to my notions of proper
> grammar. It doesn't look right. The following would be better:
>
>     shelf-save, shelf-restore, shelf-list, shelf-log, shelf-drop,
> shelf-diff.[*]

Thanks for your thoughts.

You missed out the 'shelve' command (which is like 'save' but reverts
the modifications) which is probably the most difficult one to
accommodate. What do you propose for that? If you intend 'save' to
include the revert then what do propose for the form that doesn't revert
(that is, form that creates another save-point/check-point)?

I considered using the word 'restore'. It is fine in the context of
'shelf-restore' but because of considering aliases I went for 'unshelve'
as the better one-word name, and let the two-word construction be ugly.
I also considered 'svn unshelve' as an alias with 'svn shelf-restore' as
the two-word form.

Similarly for 'shelves' vs. 'list', with an additional consideration
here that 'svn list' is already a command with a different meaning, a
meaning that could also usefully be applied to a shelf.

> Adding a common prefix to existing commands without renaming the
> commands doesn't always make sense.

Totally agree.

> [*] It would be even better without the dash: 'shelf save', 'shelf
> restore', and so on; but I realise that would involve either custom
> command interpretation or some deep surgery in our command-line parser.

I already have an implementation without the dash ('shelf save', etc.)
working on the 'shelve-checkpoint' branch. It suffers from the problems
I mentioned towards the end of my mail. I agree it would be better from
a human perspective. The problems of parsing and 'help' display could be
overcome, but I don't think the work to do so is justified at present.

- Julian
Received on 2018-01-08 15:34:35 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.