<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://community.moertel.com/ss/rdf'>
    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#start/2005-02-12/1'
         s:name='start/2005-02-12/1'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:content>1 Source code management with darcs: a first look {anchor:Source code management with darcs: a first look}&#xA;I have been managing the [LectroTest] project with the&#xA;{link:monotone|http://www.venge.net/monotone/} revision control&#xA;system.  For the last few months, monotone has been undergoing some&#xA;growing pains that have made it less stable than I would like for everyday&#xA;use.  Thus I thought that I would give [darcs] a try.&#xA;&#xA;I have been following the progress of darcs since it was first&#xA;announced on the Haskell-Cafe mailing list on 9 April 2003.  Darcs is&#xA;written in [Haskell], one of my favorite programming languages, and&#xA;that was my initial draw.  Still, until yesterday I had never&#xA;used it for any of my projects because I felt it was immature and&#xA;needed some more real-world testing before I committed work to it.&#xA;&#xA;In the last three months, Darcs has gained mainstream attention&#xA;(triggered by a {link:favorable write-up in Linux Weekly News|http://lwn.net/Articles/110516/}) and a growing user base.  Under&#xA;the gaze of these new eyeballs, darcs has matured much.  I thought it&#xA;was time for another look.&#xA;&#xA;Darcs has a small, easy-to-understand command set and yet offers&#xA;&quot;modern&quot; source-code management features such as distributed&#xA;development (via HTTP, ssh, and email), change sets, and cherry&#xA;picking.  Want to start an experimental branch of your project?  Just&#xA;check out another copy and use it for the branch.  Each working copy&#xA;is a complete, independent repo. Want to publish a project repository&#xA;to the world?  Just copy it to a public web server.  Want to start&#xA;working on someone else&apos;s project?  A single &quot;darcs get&#xA;http:\/\/other.project.com/project&quot; gives you a complete, stand-alone&#xA;copy.  Your own personal branch.  Start hacking.&#xA;&#xA;To try darcs on something I was familiar with, I decided manage my&#xA;[LectroTest] development with it.  The first thing I did was change to&#xA;the LT working directory and use &quot;darcs init&quot; to create a darcs&#xA;repository there.&#xA;&#xA;{code:none}&#xA;\[tom@bifur Flippi]$ __cd ~/work/research/perl/qc/  __~~# LT root dir~~&#xA;\[tom@bifur qc]$ __darcs init__&#xA;\[tom@bifur qc]$ __l__&#xA;blib/                       mt.db&#xA;_build/                     mtdb.dump&#xA;Build\*                      perl-Test-LectroTest-0.2007-1.src.rpm&#xA;Build.PL                    pod2htmd.tmp&#xA;Build.PL~                   pod2htmi.tmp&#xA;buildrpm\*                   posts/&#xA;buildrpm~                   prop2.pl&#xA;Changes                     prop2.pl~&#xA;Changes~                    README&#xA;checkpods\*                  t/&#xA;checkpods~                  Test-LectroTest-0.2001.tar.gz&#xA;ctime.pl                    Test-LectroTest-0.2002.tar.gz&#xA;ctime.pl~                   Test-LectroTest-0.2003.tar.gz&#xA;CVS/                        Test-LectroTest-0.2004.tar&#xA;_darcs/                     Test-LectroTest-0.2004.tar.gz&#xA;Example1.pl~                Test-LectroTest-0.2005.tar.gz&#xA;lib/                        Test-LectroTest-0.2006.tar.gz&#xA;Makefile.PL                 Test-LectroTest-0.2007.tar.gz&#xA;MANIFEST                    Test-LectroTest-0.2008.tar.gz&#xA;MANIFEST~                   Test-LectroTest-0.2009.tar.gz&#xA;MANIFEST.bak                Test-LectroTest-0.201.tar.gz&#xA;MANIFEST.SKIP               tex/&#xA;MANIFEST.SKIP~              THANKS&#xA;META.yml                    THANKS~&#xA;monotone.db                 TODO&#xA;monotone.db.bak             TODO~&#xA;monotone.db.pre-changesets  toms-notes.txt&#xA;monotone.db-pre-sql3        toms-notes.txt~&#xA;MT/&#xA;{code}&#xA;&#xA;You can see that there is a lot of accumulated cruft&#xA;in my working directory, including CVS, monotone, and&#xA;now darcs revision-control artifacts.  To prevent&#xA;Perl&apos;s Module::Build from thinking the ~~_darcs~~&#xA;directory is meaningful, I added it to the manifest-skip file.&#xA;&#xA;{code:none}&#xA;\[tom@bifur qc]$ __echo &apos;\\\b_darcs\\\b&apos; &gt;&gt; MANIFEST.SKIP__&#xA;{code}&#xA;&#xA;Next I added my LectroTest sources, docs, and related files&#xA;to the darcs repo.&#xA;&#xA;{code:none}&#xA;\[tom@bifur qc]$ __darcs add Build.PL buildrpm Changes__ \\\&#xA;    __checkpods MANIFEST MANIFEST.SKIP tex THANKS TODO__ \\\&#xA;    __toms-notes.txt tex/Makefile tex/titlepage.ltx__&#xA;{code}&#xA;&#xA;The &quot;darcs whatsnew&quot; command asks darcs to tell me what is&#xA;changed in the working directory with respect to the repository&#xA;state.&#xA;&#xA;{code:none}&#xA;\[tom@bifur qc]$ __darcs whatsnew -s__&#xA;A ./Build.PL&#xA;A ./Changes&#xA;A ./MANIFEST&#xA;A ./MANIFEST.SKIP&#xA;A ./THANKS&#xA;A ./TODO&#xA;A ./buildrpm&#xA;A ./checkpods&#xA;A ./tex/&#xA;A ./tex/Makefile&#xA;A ./tex/titlepage.ltx&#xA;A ./toms-notes.txt&#xA;{code}&#xA;&#xA;The files that I added are new because I had not yet recorded&#xA;them to the repository.  Before I did that, I added the&#xA;remaining LT assets.&#xA;&#xA;{code:none}&#xA;\[tom@bifur qc]$ __darcs add t  __~~# add the tests dir~~&#xA;\[tom@bifur qc]$ __darcs add t/\*.t__&#xA;\[tom@bifur qc]$ __darcs add lib__&#xA;\[tom@bifur qc]$ __cd lib__&#xA;\[tom@bifur lib]$ __l__&#xA;Test/&#xA;\[tom@bifur lib]$ __darcs add Test__&#xA;\[tom@bifur lib]$ __cd Test__&#xA;\[tom@bifur Test]$ __l__&#xA;LectroTest/    LectroTest.pm~     LectroTest::Tutorial.pod~&#xA;LectroTest.pm  LectroTest.pm.bak&#xA;\[tom@bifur Test]$ __darcs add LectroTest LectroTest.pm__&#xA;\[tom@bifur Test]$ __cd LectroTest__&#xA;\[tom@bifur LectroTest]$ __l__&#xA;Compat.pm      Generator.pm~     Simple.pm~         Tutorial.pod&#xA;Compat.pm~     Generator.pm.bak  Test.pm~           Tutorial.pod~&#xA;Compat.pm.bak  Property.pm       TestRunner.pm      Tutorial.pod.bak&#xA;CVS/           Property.pm~      TestRunner.pm~&#xA;Generator.pm   Property.pm.bak   TestRunner.pm.bak&#xA;\[tom@bifur LectroTest]$ __darcs add \*.pm \*.pod__&#xA;{code}&#xA;&#xA;At this point, it looked like I had all of the files under&#xA;darcs&apos;s watchful eye.&#xA;&#xA;{code:none}&#xA;\[tom@bifur LectroTest]$ __darcs w -s  __~~# abbreviated: w -&gt; whatsnew~~&#xA;A ./Build.PL&#xA;A ./Changes&#xA;A ./MANIFEST&#xA;A ./MANIFEST.SKIP&#xA;A ./THANKS&#xA;A ./TODO&#xA;A ./buildrpm&#xA;A ./checkpods&#xA;A ./lib/&#xA;A ./lib/Test/&#xA;A ./lib/Test/LectroTest/&#xA;A ./lib/Test/LectroTest.pm&#xA;A ./lib/Test/LectroTest/Compat.pm&#xA;A ./lib/Test/LectroTest/Generator.pm&#xA;A ./lib/Test/LectroTest/Property.pm&#xA;A ./lib/Test/LectroTest/TestRunner.pm&#xA;A ./lib/Test/LectroTest/Tutorial.pod&#xA;A ./t/&#xA;A ./t/001.t&#xA;A ./t/002.t&#xA;A ./t/003.t&#xA;A ./t/004.t&#xA;A ./t/005.t&#xA;A ./t/compat.t&#xA;A ./tex/&#xA;A ./tex/Makefile&#xA;A ./tex/titlepage.ltx&#xA;A ./toms-notes.txt&#xA;\[tom@bifur LectroTest]$ __cd ../../..  __~~# back up to project home~~&#xA;{code}&#xA;&#xA;That looked right.  It was time to record my changes.&#xA;This was straightforward.&#xA;&#xA;{code:none}&#xA;\[tom@bifur qc]$ __darcs record --all    __~~# record all changes~~&#xA;Darcs needs to know what name (conventionally an email address) to use as the&#xA;patch author, e.g. &apos;Fred Bloggs &amp;lt;fred@bloggs.invalid&gt;&apos;.  If you provide one&#xA;now it will be stored in the file &apos;_darcs/prefs/author&apos; and used as a default&#xA;in the future.  To change your preferred author address, simply delete or edit&#xA;this file.&#xA;&#xA;What is your email address? __Tom Moertel &amp;lt;tom@moertel.com&gt;__&#xA;What is the patch name? __Initial checkin of sources__&#xA;Do you want to add a long comment? \[yn] __n__&#xA;&#xA;Finished recording patch &apos;Initial checkin of sources&apos;&#xA;{code}&#xA;&#xA;Now what did darcs think has changed?&#xA;&#xA;{code:none}&#xA;\[tom@bifur qc]$ __darcs w -s__&#xA;No changes!&#xA;{code}&#xA;&#xA;Excellent.&#xA;&#xA;One cool feature of darcs is that every working directory&#xA;is also a complete, independent repository.  To make a branch,&#xA;then, is as simple as checking out a new repository.&#xA;&#xA;Of course, because there is no central repository in the darcs model,&#xA;&quot;checking out&quot; is a concept that does not really apply.  Rather, what&#xA;I must do is set up a new repository and then &quot;push&quot; my existing&#xA;repository&apos;s patches to it.  I can push in many ways, including&#xA;via ssh to a remotely hosted repository, but here I will just set up&#xA;a new repo in /tmp and push to it on the local filesystem.&#xA;&#xA;{code:none}&#xA;\[tom@bifur qc]$ __mkdir /tmp/lt &amp;&amp; pushd /tmp/lt__&#xA;/tmp/lt ~/work/research/perl/qc&#xA;\[tom@bifur lt]$ __darcs init   __~~# set up new repo at /tmp/lt~~&#xA;\[tom@bifur lt]$ __popd__&#xA;~/work/research/perl/qc&#xA;\[tom@bifur qc]$ __darcs push /tmp/lt   __~~# push to repo at /tmp/lt~~&#xA;&#xA;Sat Feb 12 01:26:15 EST 2005  Tom Moertel &amp;lt;tom@moertel.com&gt;&#xA;  \* Initial checkin of sources&#xA;Shall I push this patch? (1/1) \[ynWvxqadjk], or ? for help: __y__&#xA;&#xA;Finished applying...&#xA;{code}&#xA;&#xA;Now, I can begin working on my new branch in the /tmp/lt working&#xA;directory.&#xA;&#xA;{code:none}&#xA;\[tom@bifur qc]$ __cd /tmp/lt__&#xA;\[tom@bifur lt]$ __l__&#xA;Build.PL  Changes    _darcs/  MANIFEST       posts/  tex/    TODO&#xA;buildrpm  checkpods  lib/     MANIFEST.SKIP  t/      THANKS  toms-notes.txt&#xA;\[tom@bifur lt]$ __emacs lib/Test/LectroTest.pm   __~~# fix typo~~&#xA;\[tom@bifur lt]$ __darcs record__&#xA;hunk ./lib/Test/LectroTest.pm 38&#xA;\-of your software.  LectroTest then checks your software see whether&#xA;\+of your software.  LectroTest then checks your software to see whether&#xA;Shall I record this patch? (1/1) \[ynWsfqadjk], or ? for help: __y__&#xA;&#xA;What is the patch name? __Fixed stupid typo in intro text of T::LectroTest.pm__&#xA;Do you want to add a long comment? \[yn] __n__&#xA;&#xA;Finished recording patch &apos;Fixed stupid typo in intro text of T::LectroTest.pm&apos;&#xA;{code}&#xA;&#xA;Now my branch repository contains two patches:&#xA;&#xA;{code:none}&#xA;\[tom@bifur lt]$ __darcs changes__&#xA;Sat Feb 12 13:20:07 EST 2005  Tom Moertel &amp;lt;tom@moertel.com&gt;&#xA;  \* Fixed stupid typo in intro text of T::LectroTest.pm&#xA;&#xA;Sat Feb 12 01:26:15 EST 2005  Tom Moertel &amp;lt;tom@moertel.com&gt;&#xA;  \* Initial checkin of sources&#xA;{code}&#xA;&#xA;Because the typo that I fixed is not unique to my new branch, I ought&#xA;to make sure that the original branch gets the fix, too.  To do so, I&#xA;just push it:&#xA;&#xA;{code:none}&#xA;\[tom@bifur lt]$ __darcs push ~/work/research/perl/qc__&#xA;Pushing to /home/thor/work/research/perl/qc...&#xA;&#xA;Sat Feb 12 13:20:07 EST 2005  Tom Moertel &amp;lt;tom@moertel.com&gt;&#xA;  * Fixed stupid typo in intro text of T::LectroTest.pm&#xA;Shall I push this patch? (1/1) [ynWvxqadjk], or ? for help: __y__&#xA;&#xA;Finished applying...&#xA;{code}&#xA;&#xA;And now my patch has been pushed back up to the mainstream&#xA;branch!  ~~This~~ is an attractive development model.&#xA;&#xA;So far, I like darcs.  Its source code&amp;#8211;management model is&#xA;simple and powerful.  Its command set is small enough to actually&#xA;grok.  Using darcs has me wondering why other SCM systems have made&#xA;the problem seem so complicated.  My life is complicated enough as it&#xA;is.&#xA;&#xA;I think I just switched to darcs.&#xA;</s:content>
        <s:mTime>2005-02-12 17:55:39.075</s:mTime>
        <s:cTime>2005-02-12 17:55:39.075</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#start/2005-03-03/1'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/start/2005-02-12/1'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#start/'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
