hg add default behaviour...

Fred Wulff frew at stanford.edu
Wed Aug 22 23:20:58 CDT 2007


On 8/22/07, Mark A. Flacy <mflacy at verizon.net> wrote:
> On 2007.08.22 15:01, Brian Baker wrote:
> >
> > +tan(90)
> >
> > The way I see it 'hg add' with no arguments doesn't fit the principle
> > of least suprise.
>
> So then "hg commit" with no arguments should also do nothing, right?

hg commit with no arguments doesn't really do anything, though. It
opens an editor, which if you exit without taking further action,
aborts the transaction. Even if someone's heavily-caffeinated
sausage-fingers do manage to change the default commit message, then
"hg rollback" conveniently undoes the transaction. "hg add" is a
destructive change to your changelist with no obvious revert option.

>
> >
> > In fact being a newcomer to Mercurial I'd be very suprised if a bunch
> > of objects and other generated files got added to my repo all of a
> > sudden. If I do a 'hg add' in new directory I'd just made with a couple
> > of source files in, I wouldn't expect stuff from all over the
> > repository to get added.
> >
> > I say hang backwards compatibility, and make the default behaviour
> > sane.Now is the time to do it as Mercurial hasn't got to version 1. I
> > too
> > would like to know who relies on the wacky default behaviour of add.
>
> I'd like to know why I'm getting to read the views of a bunch of idiots
> who can't seem to remember how "hg add" works.

It's because you're using a series of tubes. Upgrade to dump trucks
for a better experience.

But seriously, do you not have the basic empathy for your user
necessary to realize that replicating a command that's works the same
way in every other VCS system they're like to have used, but giving it
different default semantics is a poor choice? If the complaint is the
amount of typing necessary, why not change add to work like every
other VCS ever, and make "hg addall" (with the easily typeable "hg aa"
abbreviation) have the current default behavior. I'll even make the
change myself and submit it if you'd like.

-Fred

>
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>


More information about the Mercurial mailing list