Suffering from CVS mindset

Masklinn masklinn at masklinn.net
Sun Apr 11 14:08:00 CDT 2010


On 11 Apr 2010, at 20:43 , Harry Putnam wrote:
> 
> Martin Geisler <mg at lazybytes.net> writes:
> 
>>  cd ~/scripts/perl
>>  hg commit -m "Fixed bug."
>>  cd ~/scripts/shell
>>  hg commit -m "Optimized."
>> 
>> The difference is that the Perl scripts and the shell scripts now live
>> in different repositories and have different and independent
>> histories. The units-of-work before more well-defined this way. Like
>> Masklinn said, there is no overhead associated with creating
>> repositories in Mercurial (compare "mkdir foo" with "hg init foo"), so
>> this is the suggested way to do things.
> 
> Hope I'm not sounding like a argumentative dodo, but.....
> 
> First, that is a false premise (I think).  You can't compare mkdir foo
> against  hg init foo) .. (both are needed in either case so you would'nt
> compare one against the other) 
> And especially not to creating one repo for all.
> 
> It would be more like mkdir * 12 hg init * 12
> 

Incorrect:

$ ls
$ hg init foo
$ ls
foo

Furthermore, to put an already existing directory under hg, you only need
to cd within it and `hg init`.

> I think at root, I'm really just not getting why its better to keep
> record of changes in an entire repo with every commit, as apposed to
> keep record of changes to individual files.
Because changes can involve multiple files.

> I guess I can see a big benefit when the entire repo is strongly
> related
Well yeah, that's the point, in a DVCS you create strongly related
repositories because repositories are cheap and easy to create. This
is not CVS or SVN where you avoid creating repository because it takes
a quarter of an hour each time (if not more) and then it's a pain to
manage.

In CVS or SVN, it makes sense to have very few (as few as a single one)
repository and putting all your projects within that, creating complex
arbos within the repo, because you actually need to administer the
aforementioned repositories, creation and maintenance are nontrivial
whereas if all your projects are subdirectories of a "ball of mud" repo
it's far easier to handle.

With a DVCS, it doesn't make sense to do that. Repos are free, it's
trivial to create them, trivial to publish them (even more so with
mercurial & hgwebdir), trivial to delete them, …

> Once again, it could very well be due to being a simpleton or just not
> enough experience with it yet.  I ran cvs for around 12 yrs and never
> went beyond the most basic usage. And was still fumbling around at
> times after all that usage.
I think the issue is mostly a case of "blub", CVS has hammered a
certain way into your synapses and adapting to a different way of
thinking doesn't come naturally.

If you haven't tried it already, you might want to check hginit 
(http://hginit.com/), it aims at teaching a "DVCS mindset" to people
coming from subversion, and subversion is quite close to CVS (though
it has atomic commits and repo-wide revisions), so you probably too
much problems picking up what happens.


More information about the Mercurial mailing list