logo       

Re: [issue42] add a global option to start running commands from repo root: msg#00515

Subject: Re: [issue42] add a global option to start running commands from repo root
Of the mail on this topic, I think Jeremy's has addressed most of the
interesting points. So here are my further thoughts:

On Thu, Oct 27, 2005 at 02:22:31PM -0700, Jeremy Fitzhardinge wrote:
> There's a good reason for defaulting to the top of the repo: there's no
> other pathname syntax to refer to it.  If you want to find the status of
> '.', then 'hg status .' is an economical way to get the output you
> want.  But at present, if you want to get the status of the whole repo
> regardless of your cwd, there's no clean way to do it; you have to
> determine the path to the top of the repo, and then do 'hg status' on
> it.  Adding a new piece of pathname syntax for referring to the top of
> the repo doesn't seem like a good idea.

Ok, I like this point. The '.' approach is arguably the cleanest and
most flexible. People who don't like waiting for 'hg status' to stat
their whole tree can quickly learn to use '.'.
 
> Also, there's an inconsistency in hg's behaviour at the moment: 'hg
> commit' will commit everything in the whole repo, regardless of your
> cwd; 'hg commit .' will commit things in the current directory.  I would
> argue that commit is right, and the other commands should operate similarly.

I tend to think commit is right too, mostly because tree-wide atomic
commits are central to what a 'changeset' is: grouping -all- relevant
file-level changes together. The system thus encourages checking in a
complete change. Making the rest of the system consistent with commit
is a decent argument.

> That said, this kind of UI change is annoying to do; changing the
> behaviour will bite people (unless everyone agrees that the change is an
> unalloyed improvement).  I'm not a fan of config or command line
> options, but this seems like the sort of user preference which needs one.

Actually, it's exactly the sort of user preference which causes things
to break unexpectedly. And thus it's best avoided. I'd rather have hg
bite everyone one more time by making the change while we're pre-1.0
than have people get repeatedly bit by a config option going forward.

> CVS always works from '.', but that's because there's no real notion of
> the "top" of a CVS tree; CVS effectively works on a directory by
> directory basis.  SVN copies CVS's behaviour, I think for the same
> reason.  It seems that most of the SCMs which have a notion of a top
> working directory will use that directory as the default.

Also a good argument. Mercurial fundamentally sees everything at a
tree-wide level. Emulating the weaknesses of CVS' recursive repository
scheme doesn't buy us much.

So, if anyone has strong objections to:

hg status -> tree-wide
hg status . -> current directory and below (current hg status)
hg diff -> tree-wide
hg diff . -> current directory and below (current hg status)

..now's a good time to speak up.

In addition to Benoit's patch, we'll probably need to add a test case
and then double-check all the docs.

-- 
Mathematics is the supreme nostalgia of our time.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe