Difference between revisions of "Darcs"

From HaskellWiki
Jump to navigation Jump to search
(Updated links)
(34 intermediate revisions by 8 users not shown)
Line 1: Line 1:
'''darcs''' is a peer-to-peer revision control system, written in Haskell.
+
'''darcs''' is a peer-to-peer revision control system, written in Haskell. It is the standard RCS of the Haskell community.
   
 
== Understanding darcs ==
 
== Understanding darcs ==
Line 7: Line 7:
 
* '''Patches''': a patch is a collection of changes that forms the unit of synchronisation with other repositories
 
* '''Patches''': a patch is a collection of changes that forms the unit of synchronisation with other repositories
 
* Unrecorded '''changes''' to known files and directories
 
* Unrecorded '''changes''' to known files and directories
* '''Unknown items''' (files and directories)
+
* '''Unmanaged items''' (files and directories)
 
* '''Boring items''': anything with a name matched in <tt>_darcs/prefs/boring</tt>
 
* '''Boring items''': anything with a name matched in <tt>_darcs/prefs/boring</tt>
  +
* The '''unrevert cache''' of changes
  +
  +
Note that some projects are keen on making sure all derivative items are "boring" rather than merely unknown items that will show up with <tt>darcs wh -l</tt>. Other projects less so.
   
 
== Operations ==
 
== Operations ==
   
=== Unknown items ===
+
=== Unmanaged items ===
   
 
*<tt>darcs whatsnew -l</tt>: show changes to managed files, and unmanaged items
*'''creating a item''': these will be "unknown".
 
   
 
*'''creating a item''': add item to the unmanaged items.
*<tt>darcs add</tt>: turns an unknown item into a change
 
   
*<tt>darcs remove</tt>: creates an change to remove the item but keeps it as an unknown item.
+
*<tt>darcs add</tt>: convert the unmanaged item into a change to create the item and its contents
   
*<tt>darcs whatsnew -l</tt>: show changes and unknown items
+
*<tt>darcs remove</tt>: add a change which empties the item and deletes it, but keep it as an unmanaged item.
   
 
=== Changes ===
 
=== Changes ===
   
  +
*<tt>darcs whatsnew</tt>: show unrecorded changes
*'''removing an item''': creates a change to remove the item
 
   
*'''editing a file''' adds to the edit to the changes
+
*'''removing a managed item''': add a change to remove the item
   
  +
*'''editing a managed file''': add a change for the edit
*<tt>darcs whatsnew</tt>: show changes
 
   
*<tt>darcs mv</tt>: create a change to move an item
+
*<tt>darcs mv</tt>: add a change to move an item
   
*<tt>darcs replace</tt>: create a change to replace text in a file
+
*<tt>darcs replace</tt>: add a change to replace text in a file
   
*<tt>darcs record</tt>: record changes as a patch
+
*<tt>darcs record</tt>: record changes to add a patch
  +
  +
*<tt>darcs unrecord</tt>: remove a patch by turning back it into unrecorded changes
  +
  +
*<tt>darcs amend-record</tt>: replace a patch with one with added changes
  +
  +
*<tt>darcs revert</tt>: remove changes and put them in the unrevert cache. ''Warning: you will lose the previous contents of the unrevert cache.''
  +
  +
*<tt>darcs unrevert</tt>: take changes out of the unrevert cache and add them to the unrecorded changes.
   
 
=== Patches ===
 
=== Patches ===
   
*<tt>darcs pull</tt>: get patches from another repository
+
*<tt>darcs changes</tt>: show patches
  +
  +
*<tt>darcs send --output=''FILE''</tt>: make an email bundle from patches
  +
 
*<tt>darcs send --to=''ADDRESS''</tt>: send an email bundle from patches
  +
  +
*<tt>darcs pull</tt>: add patches from another repository
  +
  +
*<tt>darcs push</tt>: add patches from this repository to another repository
  +
  +
*<tt>darcs apply</tt>: add patches from an email bundle
   
*<tt>darcs push</tt>: put patches in another repository
+
*<tt>darcs rollback</tt>: add a patch that is the inverse of an existing patch
   
  +
*<tt>darcs obliterate</tt>: remove a patch. ''Warning: if the patch doesn't exist elsewhere, you will lose that work.''
*<tt>darcs apply</tt>: get patches from an email bundle
 
   
*<tt>darcs rollback</tt>: adds a patch that is the inverse of an existing patch
+
*<tt>darcs tag</tt>: add a tag for the current set of patches
   
 
=== Repositories ===
 
=== Repositories ===
Line 50: Line 71:
 
*<tt>darcs initialize</tt>: create a new empty repository
 
*<tt>darcs initialize</tt>: create a new empty repository
   
*<tt>darcs get</tt>: create a new empty repository and get patches from another repository
+
*<tt>darcs get</tt>: create a new empty repository and add patches from another repository
   
== External link ==
+
== External links ==
   
 
* [http://darcs.net/ darcs]
 
* [http://darcs.net/ darcs]
  +
* [http://en.wikibooks.org/wiki/Understanding_darcs Understanding darcs] - an illustrated wikibook about darcs and patch theory
  +
* [http://blog.interlinked.org/tutorials/darcs.html Darcs, Taking version control to the next level], a tutorial
  +
* [http://mark.stosberg.com/blog/2005/01/benefits-from-a-real-world-switch-from-cvs-to-darcs.html Benefits from a real world switch from CVS to darcs]
  +
* Implementation details of <code>darcs</code> show motivating examples for [[generalised algebraic datatype]]s. The motivations are described in David Roundy's slides [http://darcs.net/fosdem_talk/talk.pdf Implementing the darcs patch formalism and verifying it] (see p. 11, 13--14.). The talk mentions also the notions of [[phantom type]], and [[existential type]], and [[type witness]] (see p. 15).
  +
* See [http://web.archive.org/web/20070409170354/http://darcs.net/DarcsWiki/Talks also other talks] on <code>darcs</code>. One of them ([cufp.galois.com/2005/slides/DavidRoundy.pdf The Myth and Reality of using Haskell in the ‘Real World’]) discusses a more general topic: usefulness of Haskell (in real life) and in general, the power of (lazy) functional programming.
  +
* [http://wiki.darcs.net/ConfictMiseryAnalysis Conflict bug] -(a problem in Darcs-1)
  +
* Free [http://patch-tag.com darcs hosting] for open source projects at patch-tag.com
   
 
[[Category:Tools]]
 
[[Category:Tools]]

Revision as of 22:33, 9 January 2010

darcs is a peer-to-peer revision control system, written in Haskell. It is the standard RCS of the Haskell community.

Understanding darcs

You can think of a darcs repository as containing these things:

  • Patches: a patch is a collection of changes that forms the unit of synchronisation with other repositories
  • Unrecorded changes to known files and directories
  • Unmanaged items (files and directories)
  • Boring items: anything with a name matched in _darcs/prefs/boring
  • The unrevert cache of changes

Note that some projects are keen on making sure all derivative items are "boring" rather than merely unknown items that will show up with darcs wh -l. Other projects less so.

Operations

Unmanaged items

  • darcs whatsnew -l: show changes to managed files, and unmanaged items
  • creating a item: add item to the unmanaged items.
  • darcs add: convert the unmanaged item into a change to create the item and its contents
  • darcs remove: add a change which empties the item and deletes it, but keep it as an unmanaged item.

Changes

  • darcs whatsnew: show unrecorded changes
  • removing a managed item: add a change to remove the item
  • editing a managed file: add a change for the edit
  • darcs mv: add a change to move an item
  • darcs replace: add a change to replace text in a file
  • darcs record: record changes to add a patch
  • darcs unrecord: remove a patch by turning back it into unrecorded changes
  • darcs amend-record: replace a patch with one with added changes
  • darcs revert: remove changes and put them in the unrevert cache. Warning: you will lose the previous contents of the unrevert cache.
  • darcs unrevert: take changes out of the unrevert cache and add them to the unrecorded changes.

Patches

  • darcs changes: show patches
  • darcs send --output=FILE: make an email bundle from patches
  • darcs send --to=ADDRESS: send an email bundle from patches
  • darcs pull: add patches from another repository
  • darcs push: add patches from this repository to another repository
  • darcs apply: add patches from an email bundle
  • darcs rollback: add a patch that is the inverse of an existing patch
  • darcs obliterate: remove a patch. Warning: if the patch doesn't exist elsewhere, you will lose that work.
  • darcs tag: add a tag for the current set of patches

Repositories

  • darcs initialize: create a new empty repository
  • darcs get: create a new empty repository and add patches from another repository

External links