Subsections


Repository format

A repository consists of a working directory, which has within it a directory called _darcs. There must also be subdirectories within _darcs named current and patches. The current directory contains the version of the tree which has been recorded, while patches contains the actual patches which are in the repository.

Also within _darcs is the inventory file, which lists all the patches that are in the repo. Moreover, it also gives the order of the representation of the patches as they are stored. Given a source of patches, i.e. any other set of repositories which have between them all the patches contained in a given repo, that repo can be reproduced based on only the information in the inventory file. Under those circumstances, the order of the patches specified in the inventory file would be unimportant, as this order is only needed to provide context for the interperetation of the stored patches in this repository.

There is a very special patch which may be stored in patches which is called `pending'. This patch describes any changes which have not yet been recorded, and cannot be determined by a simple diff. For example file additions or renames are placed in pending until they are recorded. Similarly, token replaces are stored in pending until they are recorded.

prefs

The _darcs directory will also typically contain a prefs directory. This directory exists simply to hold user configuration settings specific to this repository. The contents of this directory are intended to be modifiable by the user, although a mistake in such a modification may cause darcs to behave strangely.

defaults

Default values for darcs commands can be configured on a per-repository basis by editing (and possibly creating) the _darcs/prefs/defaults file. Each line of this file has the following form:

COMMAND FLAG VALUE
where COMMAND is either the name of the command to which the default applies, or ALL to indicate that the default applies to all commands accepting that flag. The FLAG term is the name of the long argument option without the ``--'', i.e. verbose rather than --verbose. Finally, the VALUE option can be omitted if the flag is one such as verbose that doesn't involve a value.

For example, if your system clock is bizarre, you could instruct darcs to always ignore the file modification times by adding the following line to your _darcs/prefs/defaults file. (Note that this would have to be done for each repository!)

ALL ignore-times

If you never want to run a test when recording to a particular repository (but still want to do so when running check on that repo), and like to name all your patches ``Stupid patch'', you could use the following:

record no-test
record patch-name Stupid patch

Also, a global preferences file can be created with the name .darcs/defaults in your home directory. Options present there will be added to the repository-specific preferences.

repos

The _darcs/prefs/repos file contains a list of repositories you have pulled from or pushed to, and is used for autocompletion of pull and push commands in bash. Feel free to delete any lines from this list that might get in there, or to delete the file as a whole.


author

The _darcs/prefs/author file contains the email address (or name) to be used as the author when patches are recorded in this repository. This file overrides the contents of the environment variables $DARCS_EMAIL and $EMAIL.

boring

The _darcs/prefs/boring file may contain a list of regular expressions describing files, such as object files, that you do not expect to add to your project. As an example, the boring file that I use with my darcs repository is:
\.hi$
\.o$
^\.[^/]
^_
~$
(^|/)CVS($|/)
The last line is actually irrelevant because I don't use CVS, but if I did it would be handy. You may want to have the boring file under version control. To do this you can use darcs setpref to set the value ``boringfile'' to the name of your desired boring file (e.g. ``darcs setpref boringfile ./.boring'', where the .boring is a file that has been darcs added to your repository). You can also set up a ``boring'' regexps file in your home directory, named ~/.darcs/boring, which will be used with all of your darcs repositories.

Any file whose full path (such as manual/index.html) matches any of the boring regular expressions is considered boring. The boring file is used to filter the files provided to darcs add, to allow you to use a simple ``darcs add newdir newdir/*'' without accidentally adding a bunch of object files. It is also used when the --look-for-adds flag is given to whatsnew or record.

binary

The _darcs/prefs/binaries file may contain a list of regular expressions describing files that should be treated as binary files rather than text files. You probably will want to have the binaries file under version control. To do this you can use darcs setpref to set the value ``binariesfile'' to the name of your desired binaries file (e.g. ``darcs setpref binariesfile ./.binaries'', where .binaries is a file that has been darcs added to your repository). As with the boring file, you can also set up a ~/.darcs/binaries file if you like.

Isaac Jones 2004-03-07