monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Command aliases and removing command expansion from mon


From: Matthew Gregan
Subject: [Monotone-devel] Command aliases and removing command expansion from monotone
Date: Wed, 14 Dec 2005 15:31:39 +1300
User-agent: Mutt/1.5.11

Hi list,

While discussing the current behaviour of 'monotone revert' (see Alex's
email about the possibility of losing work too easily) on #monotone, the
idea of removing the automatic command expansion from monotone was
discussed.


monotone currently accepts commands in three ways:

1. Explicitly
   % monotone commit
   monotone: beginning commit on branch 'net.venge.monotone'


2. By specific aliases (many aliases are based on CVS or Subversion)
   % monotone ci
   monotone: beginning commit on branch 'net.venge.monotone'


3. By guessing what the user wanted (command expansion)
   % monotone com
   monotone: warning: command 'com' has multiple ambiguous expansions:
   monotone: comment
   monotone: commit
   monotone: complete
   monotone: unknown command 'com'

   % monotone commi
   monotone: beginning commit on branch 'net.venge.monotone'


Note that the command expansion does not work for second level commands, so
"monotone db inf" is not expanded to "monotone db info", and will error out
by displaying the usage for the db command.

While convenient, command expansion does not lead to a stable UI that is
safe for users to rely on (in fact, we have a bug[0] about this).  For
example, while "commi" will expand to "commit" today, it will fail to do so
tomorrow when we add the much requested "commissar" appointment feature to
monotone.  The specific example given on IRC was that "monotone rev" is
sufficient to expand to "monotone revert" and is potentially rather
surprising to users.

Aliases, on the other hand, are explicitly defined.  This means that they're
less likely to change tomorrow, and that any change that affected them is
much more likely to be reflected in the documentation and the monotone
release notes.

Given this, I suggest that we remove automatic command expansion behaviour
from monotone, and ensure that any commonly used commands have sane and
consistent aliases.

Opinions?

Are there any command expansion you rely on today for which we should look
at adding a static alias?

[0] http://savannah.nongnu.org/bugs/?func=detailitem&item_id=12907

Thanks,
-mjg
-- 
Matthew Gregan                     |/
                                  /|                address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]