Let "hg add" do nothing

Larry Hastings larry at hastings.org
Mon Aug 20 23:24:45 CDT 2007


Matt Mackall wrote:
> I really don't understand why people are typing "hg add<enter>" and
> being surprised when it adds stuff. Do they also run reboot to get
> help on the various ways of rebooting?
Considering for a moment the Principle Of Least Surprise, "hg add" with 
no arguments meaning "recursively add *" is awful UI design.  Compare it 
with the default for "hg revert", which does nothing; having "hg revert" 
automatically throw away all your work would be terrible.  And yes, "hg 
add" without arguments can also destroy work; it obliterates your 
carefully-created list of files to add.  If you run it by accident, you 
must now manually reconstruct that list.

Also, citing "import this": "Explicit is better than implicit".  And 
"Although practicality beats purity" doesn't count here, as I don't see 
anything particularly practical about its current thermonuclear default.

As far as backwards-compatibility is concerned, you're worried about 
what, breaking automation?  Let all those who /depend/ on the default 
behavior of "hg add" please raise their hands.


/larry/

p.s. "reboot" has a dangerous user interface--that's why it can only be 
run as root.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial/attachments/20070820/ab2663dd/attachment.htm 


More information about the Mercurial mailing list