1DARCS(1)                    General Commands Manual                   DARCS(1)
2
3
4

NAME

6       darcs - an advanced revision control system
7

SYNOPSIS

9       darcs command <arguments|[options]>...
10
11       Where the commands and their respective arguments are
12
13       darcs help [<darcs_command> [darcs_subcommand]]
14       darcs add <file|directory> ...
15       darcs remove <file|directory> ...
16       darcs move <source> ... <destination>
17       darcs replace <old> <new> <file> ...
18       darcs revert [file|directory]...
19       darcs unrevert
20       darcs whatsnew [file|directory]...
21       darcs record [file|directory]...
22       darcs unrecord
23       darcs amend-record [file|directory]...
24       darcs mark-conflicts
25       darcs tag [tagname]
26       darcs setpref <pref> <value>
27       darcs diff [file|directory]...
28       darcs changes [file|directory]...
29       darcs annotate [file|directory]...
30       darcs dist
31       darcs trackdown [[initialization] command]
32       darcs show contents [file]...
33       darcs show files [file|directory]...
34       darcs show index
35       darcs show pristine
36       darcs show repo
37       darcs show authors
38       darcs show tags
39       darcs pull [repository]...
40       darcs obliterate
41       darcs rollback [file|directory]...
42       darcs push [repository]
43       darcs send [repository]
44       darcs apply <patchfile>
45       darcs get <repository> [<directory>]
46       darcs put <new repository>
47       darcs initialize
48       darcs optimize
49       darcs check
50       darcs repair
51       darcs convert <source> [<destination>]
52
53

DESCRIPTION

55       Darcs is a free, open source revision control system. It is:
56
57       ·  Distributed: Every user has access to the full command set, removing
58          boundaries between server and client or  committer  and  non‐commit‐
59          ters.
60
61       ·  Interactive:  Darcs is easy to learn and efficient to use because it
62          asks you questions  in  response  to  simple  commands,  giving  you
63          choices  in your work flow. You can choose to record one change in a
64          file, while ignoring another. As you update from upstream,  you  can
65          review  each  patch  name,  even  the  full  `diff'  for interesting
66          patches.
67
68       ·  Smart: Originally developed by  physicist  David  Roundy,  darcs  is
69          based  on  a  unique  algebra  of  patches.  This smartness lets you
70          respond to changing demands in ways that would otherwise not be pos‐
71          sible. Learn more about spontaneous branches with darcs.
72

OPTIONS

74       Different  options are accepted by different Darcs commands.  Each com‐
75       mand's most important options are listed in the COMMANDS section.   For
76       a full list of all options accepted by a particular command, run `darcs
77       command --help'.
78
79   Selecting Patches:
80       The --patches option yields patches with names matching  an  `extended'
81       regular  expression.   See  regex(7) for details.  The --matches option
82       yields patches that match a logical (Boolean) expression: one  or  more
83       primitive  expressions  combined by grouping (parentheses) and the com‐
84       plement (not), conjunction (and) and disjunction (or) operators.  The C
85       notation for logic operators (!, && and ||) can also be used.
86
87        --patches=regex is a synonym for --matches='name regex'
88        --from-patch and --to-patch are synonyms for --from-match='name... and
89       --to-match='name...
90        --from-patch and --to-match can be unproblematically combined:
91        darcs  changes   --from-patch='html.*documentation'   --to-match='date
92       20040212'
93
94       The following primitive Boolean expressions are supported:
95         exact - check a literal string against the patch name.
96         name - check a regular expression against the patch name.
97         author - check a regular expression against the author name.
98         hunk  -  check  a  regular  expression against the contents of a hunk
99       patch.
100         hash - match the darcs hash for a patch.
101         date - match the patch date.
102         touch - match file paths for a patch.
103
104       Here are some examples:
105         darcs annotate --summary --match 'exact "Resolve issue17: use dynamic
106       memory allocation."'
107         darcs annotate --summary --match 'name issue17'
108         darcs annotate --summary --match 'name "^[Rr]esolve issue17\>"'
109         darcs annotate --summary --match 'author "David Roundy"'
110         darcs annotate --summary --match 'author droundy'
111         darcs annotate --summary --match 'author droundy@darcs.net'
112         darcs annotate --summary --match 'hunk foo = 2'
113         darcs annotate --summary --match 'hunk ^instance .* Foo where$'
114         darcs         annotate         --summary         --match        'hash
115       20040403105958-53a90-c719567e92c3b0ab9eddd5290b705712b8b918ef'
116         darcs annotate --summary --match 'date "2006-04-02 22:41"'
117         darcs annotate --summary --match 'date "tea time yesterday"'
118         darcs annotate --summary --match 'touch src/foo.c'
119         darcs annotate --summary --match 'touch src/'
120         darcs annotate --summary --match 'touch "src/*.(c|h)"'
121
122

COMMANDS

124       darcs help [<darcs_command> [darcs_subcommand]]
125           Without arguments, `darcs help' prints a categorized list of  darcs
126           commands  and a short description of each one.  With an extra argu‐
127           ment, `darcs help foo' prints detailed help about the darcs command
128           foo.
129
130
131   Changing and querying the working copy:
132       darcs add <file|directory> ...
133           Generally  a  repository contains both files that should be version
134           controlled (such as source code) and files that Darcs should ignore
135           (such  as  executables  compiled from the source code).  The `darcs
136           add' command is used to tell Darcs which files to version control.
137
138           When an existing project is first imported into a Darcs repository,
139           it  is  common  to run `darcs add -r *' or `darcs record -l' to add
140           all initial source files into darcs.
141
142           Adding symbolic links (symlinks) is not supported.
143
144           Darcs will ignore all files and folders that  look  `boring'.   The
145           --boring option overrides this behaviour.
146
147           Darcs  will not add file if another file in the same folder has the
148           same name, except for case.  The --case-ok  option  overrides  this
149           behaviour.   Windows  and  OS X usually use filesystems that do not
150           allow files a folder to have the same name  except  for  case  (for
151           example, `ReadMe' and `README').  If --case-ok is used, the reposi‐
152           tory might be unusable on those systems!
153
154           The --date-trick option allows you to enable an experimental  trick
155           to make add conflicts, in which two users each add a file or direc‐
156           tory with the same name, less problematic.   While  this  trick  is
157           completely safe, it is not clear to what extent it is beneficial.
158
159       darcs remove <file|directory> ...
160           The  `darcs  remove'  command  exists  primarily  for symmetry with
161           `darcs add', as the normal way to remove a file from  version  con‐
162           trol is simply to delete it from the working tree.  This command is
163           only useful in the unusual case where one wants to record a removal
164           patch  WITHOUT  deleting the copy in the working tree (which can be
165           re-added).
166
167           Note that applying a removal patch to a repository (e.g. by pulling
168           the patch) will ALWAYS affect the working tree of that repository.
169
170       darcs move <source> ... <destination>
171           Darcs  cannot reliably distinguish between a file being deleted and
172           a new one added, and a file being moved.   Therefore  Darcs  always
173           assumes  the  former,  and  provides  the `darcs mv' command to let
174           Darcs know when you want the latter.  This command will  also  move
175           the file in the working tree (unlike `darcs remove'), unless it has
176           already been moved.
177
178           Darcs will not rename a file if another file in the same folder has
179           the  same  name,  except  for case.  The --case-ok option overrides
180           this behaviour.  Windows and OS X usually use filesystems  that  do
181           not allow files a folder to have the same name except for case (for
182           example, `ReadMe' and `README').  If --case-ok is used, the reposi‐
183           tory might be unusable on those systems!
184
185       darcs replace <old> <new> <file> ...
186           In addition to line-based patches, Darcs supports a limited form of
187           lexical substitution.  Files are treated as sequences of words, and
188           each  occurrence of the old word is replaced by the new word.  This
189           is intended to provide a clean way to rename a  function  or  vari‐
190           able.  Such renamings typically affect lines all through the source
191           code, so a traditional line-based patch would  be  very  likely  to
192           conflict with other branches, requiring manual merging.
193
194           Files are tokenized according to one simple rule: words are strings
195           of valid token characters, and everything between them (punctuation
196           and  whitespace)  is discarded.  By default, valid token characters
197           are letters, numbers and the underscore (i.e. [A-Za-z0-9_]).   How‐
198           ever  if  the  old  and/or  new  token  contains either a hyphen or
199           period,  BOTH  hyphen  and  period  are  treated  as  valid   (i.e.
200           [A-Za-z0-9_.-]).
201
202           The   set   of   valid  characters  can  be  customized  using  the
203           --token-chars option.  The argument must be  surrounded  by  square
204           brackets.  If a hyphen occurs between two characters in the set, it
205           is treated as a set range.  For  example,  in  most  locales  [A-Z]
206           denotes  all uppercase letters.  If the first character is a caret,
207           valid tokens are taken to be the complement of the remaining  char‐
208           acters.   For  example, [^:\n] could be used to match fields in the
209           passwd(5), where records and fields are separated by  newlines  and
210           colons respectively.
211
212           If  you choose to use --token-chars, you are STRONGLY encouraged to
213           do so consistently.  The consequences  of  using  multiple  replace
214           patches with different --token-chars arguments on the same file are
215           not well tested nor well understood.
216
217           By default Darcs will refuse to perform a replacement  if  the  new
218           token  is  already in use, because the replacements would be not be
219           distinguishable from the existing tokens.  This  behaviour  can  be
220           overridden  by  supplying  the  --force  option,  but an attempt to
221           `darcs rollback' the resulting patch  will  affect  these  existing
222           tokens.
223
224           Limitations:
225
226           The  tokenizer  treats files as byte strings, so it is not possible
227           for --token-chars to include multi-byte  characters,  such  as  the
228           non-ASCII   parts   of  UTF-8.   Similarly,  trying  to  replace  a
229           `high-bit' character from a unibyte encoding will  also  result  in
230           replacement  of  the  same  byte in files with different encodings.
231           For example, an acute a from ISO 8859-1 will also  match  an  alpha
232           from ISO 8859-7.
233
234           Due  to  limitations  in the patch file format, --token-chars argu‐
235           ments cannot contain literal whitespace.   For  example,  [^  \n\t]
236           cannot  be used to declare all characters except the space, tab and
237           newline as valid within a  word,  because  it  contains  a  literal
238           space.
239
240           Unlike  POSIX regex(7) bracket expressions, character classes (such
241           as [[:alnum:]]) are NOT supported by  --token-chars,  and  will  be
242           silently treated as a simple set of characters.
243
244       darcs revert [file|directory]...
245           The  `darcs revert' command discards unrecorded changes the working
246           tree.  As with `darcs  record',  you  will  be  asked  which  hunks
247           (changes)  to  revert.   The --all switch can be used to avoid such
248           prompting. If files or directories are specified,  other  parts  of
249           the working tree are not reverted.
250
251           In  you  accidentally  reverted  something  you wanted to keep (for
252           example, typing `darcs rev -a' instead of `darcs rec -a'), you  can
253           immediately run `darcs unrevert' to restore it.  This is only guar‐
254           anteed to work if the  repository  has  not  changed  since  `darcs
255           revert' ran.
256
257       darcs unrevert
258           Unrevert  is  a  rescue  command  in case you accidentally reverted
259           something you wanted to keep (for example, typing  `darcs  rev  -a'
260           instead of `darcs rec -a').
261
262           This  command  may  fail  if  the  repository has changed since the
263           revert took place.  Darcs will ask for confirmation before  execut‐
264           ing  an  interactive  command that will DEFINITELY prevent unrever‐
265           sion.
266
267       darcs whatsnew [file|directory]...
268           The `darcs whatsnew' command lists unrecorded changes to the  work‐
269           ing  tree.   If  you  specify  a set of files and directories, only
270           unrecorded changes to those files and directories are listed.
271
272           With the --summary option, the changes are condensed  to  one  line
273           per  file,  with mnemonics to indicate the nature and extent of the
274           change.  The --look-for-adds option causes  candidates  for  `darcs
275           add'  to  be included in the summary output.  Summary mnemonics are
276           as follows:
277
278             `A f' and `A d/' respectively mean an added file or directory.
279             `R f' and `R d/' respectively mean a removed file or directory.
280             `M f -N +M rP' means a modified file, with N lines deleted, M
281             lines added, and P lexical replacements.
282             `f -> g' means a moved file or directory.
283
284             An exclamation mark (!) as in `R! foo.c', means the hunk is known
285           to
286             conflict with a hunk in another patch.  The phrase `duplicated'
287             means  the  hunk  is  known  to be identical to a hunk in another
288           patch.
289
290           By default,  `darcs  whatsnew'  uses  Darcs'  internal  format  for
291           changes.  To see some context (unchanged lines) around each change,
292           use the --unified option.  To view changes in  conventional  `diff'
293           format,  use  the  `darcs diff' command; but note that `darcs what‐
294           snew' is faster.
295
296           This command exits unsuccessfully (returns a non-zero exit  status)
297           if there are no unrecorded changes.
298
299
300   Copying changes between the working copy and the repository:
301       darcs record [file|directory]...
302           The  `darcs  record' command is used to create a patch from changes
303           in the working tree.  If you specify a set of  files  and  directo‐
304           ries, changes to other files will be skipped.
305
306           Every  patch  has  a name, an optional description, an author and a
307           date.
308
309           The patch name should be a short sentence that concisely  describes
310           the  patch,  such  as `Add error handling to main event loop.'  You
311           can supply it in advance with the -m option,  or  provide  it  when
312           prompted.
313
314           The  patch  description is an optional block of free-form text.  It
315           is used to supply additional information that doesn't  fit  in  the
316           patch  name.   For example, it might include a rationale of WHY the
317           change was necessary.  By default Darcs asks if you want to  add  a
318           description; the --edit-long-comment and --skip-long-comment can be
319           used to  answer  `yes'  or  `no'  (respectively)  to  this  prompt.
320           Finally,  the  --logfile  option  allows  you to supply a file that
321           already contains the patch name (first line) and patch  description
322           (subsequent lines).  This is useful if a previous record failed and
323           left a darcs-record-0 file.
324
325           Each patch is attributed to its author, usually  by  email  address
326           (for  example,  `Fred  Bloggs <fred@example.net>').  Darcs looks in
327           several places for this author string:  the  --author  option,  the
328           files  _darcs/prefs/author  (in the repository) and ~/.darcs/author
329           (in  your  home   directory),   and   the   environment   variables
330           $DARCS_EMAIL and $EMAIL.  If none of those exist, Darcs will prompt
331           you for an author string and write it to _darcs/prefs/author.
332
333           The patch date is generated automatically.  It can only be  spoofed
334           by using the --pipe option.
335
336           If a test command has been defined with `darcs setpref', attempting
337           to record a patch will cause the test command to be run in a  clean
338           copy  of  the  working  tree  (that  is,  including  only  recorded
339           changes).  If the test fails, the record operation will be aborted.
340
341           The --set-scripts-executable option causes scripts to be made  exe‐
342           cutable in the clean copy of the working tree, prior to running the
343           test.  See `darcs get' for an explanation of the script heuristic.
344
345           If your test command is tediously slow (e.g. `make  all')  and  you
346           are  recording  several  patches  in  a  row,  you  may wish to use
347           --no-test to skip all but the final test.
348
349       darcs unrecord
350           Unrecord does the opposite of record in that it makes  the  changes
351           from  patches  active  changes again which you may record or revert
352           later.  The working copy itself will not change.  Beware  that  you
353           should  not  use  this  command  if  you are going to re-record the
354           changes in any way and there is a possibility that another user may
355           have already pulled the patch.
356
357       darcs amend-record [file|directory]...
358           Amend-record  updates  a  `draft'  patch with additions or improve‐
359           ments, resulting in a single `finished' patch.  This is better than
360           recording  the  additions  and  improvements  as  separate patches,
361           because then whenever the `draft' patch is copied between reposito‐
362           ries, you would need to make sure all the extra patches are copied,
363           too.
364
365           Do not copy draft patches between repositories, because a  finished
366           patch  cannot  be copied into a repository that contains a draft of
367           the same patch.  If this has already happened,  `darcs  obliterate'
368           can be used to remove the draft patch.
369
370           Do  not  run  amend-record  in repository that other developers can
371           pull from, because  if  they  pull  while  an  amend-record  is  in
372           progress, their repository may be corrupted.
373
374           When  recording  a draft patch, it is a good idea to start the name
375           with `DRAFT:' so that other developers know  it  is  not  finished.
376           When  finished, remove it with `darcs amend-record --edit-long-com‐
377           ment'.  To change the patch name without starting  an  editor,  use
378           --patch-name.
379
380           Like  `darcs  record', if you call amend-record with files as argu‐
381           ments, you will only be asked about changes to those files.  So  to
382           amend a patch to foo.c with improvements in bar.c, you would run:
383
384               darcs amend-record --match 'touch foo.c' bar.c
385
386           It  is  usually  a bad idea to amend another developer's patch.  To
387           make amend-record only ask about your own patches by  default,  you
388           can  add  something  like  `amend-record  match  David  Roundy'  to
389           ~/.darcs/defaults, where `David Roundy' is your  name.  On  Windows
390           use C:/Documents And Settings/user/Application Data/darcs/defaults
391
392       darcs mark-conflicts
393           Darcs  requires human guidance to unify changes to the same part of
394           a source file.  When a conflict first occurs, darcs will  add  both
395           choices to the working tree, delimited by the markers `v v v', `* *
396           *' and `^ ^ ^'.
397
398           However, you might revert or manually delete these markers  without
399           actually  resolving  the  conflict.  In this case, `darcs mark-con‐
400           flicts' is useful to show where any unresolved  conflicts.   It  is
401           also  useful  if  `darcs  apply'  is called with --apply-conflicts,
402           where conflicts aren't marked initially.
403
404           Any unrecorded changes to the working tree  WILL  be  lost  forever
405           when  you  run this command!  You will be prompted for confirmation
406           before this takes place.
407
408           This command was historically called `resolve', and this deprecated
409           alias still exists for backwards-compatibility.
410
411
412   Direct modification of the repository:
413       darcs tag [tagname]
414           The `darcs tag' command names the current repository state, so that
415           it can easily be referred to later.  Every `important' state should
416           be  tagged;  in  particular  it is good practice to tag each stable
417           release with a number or codename.  Advice on release numbering can
418           be found at http://producingoss.com/en/development-cycle.html.
419
420           To  reproduce  the state of a repository `R' as at tag `t', use the
421           command `darcs get --tag t R'.  The command `darcs show tags' lists
422           all tags in the current repository.
423
424           Tagging  also provides significant performance benefits: when Darcs
425           reaches a shared tag that depends on all antecedent patches, it can
426           simply stop processing.
427
428           Like  normal  patches, a tag has a name, an author, a timestamp and
429           an optional long description, but it does not  change  the  working
430           tree.   A tag can have any name, but it is generally best to pick a
431           naming scheme and stick to it.
432
433           The `darcs tag' command accepts the --pipe option, which behaves as
434           described in `darcs record'.
435
436       darcs setpref <pref> <value>
437           When  working  on  project with multiple repositories and contribu‐
438           tors, it is sometimes desirable for a preference to be set  consis‐
439           tently project-wide.  This is achieved by treating a preference set
440           with `darcs setpref' as an unrecorded change,  which  can  then  be
441           recorded and then treated like any other patch.
442
443           Valid preferences are:
444
445             test -- a shell command that runs regression tests
446             predist -- a shell command to run before `darcs dist'
447             boringfile -- the path to a version-controlled boring file
448             binariesfile -- the path to a version-controlled binaries file
449
450           For example, a project using GNU autotools, with a `make test' tar‐
451           get to perform regression tests,  might  enable  Darcs'  integrated
452           regression testing with the following command:
453
454             darcs setpref test 'autoconf && ./configure && make && make test'
455
456           Note  that merging is not currently implemented for preferences: if
457           two patches attempt to set the  same  preference,  the  last  patch
458           applied  to  the  repository  will always take precedence.  This is
459           considered a low-priority bug, because preferences are seldom set.
460
461
462   Querying the repository:
463       darcs diff [file|directory]...
464           Diff can be used to create a diff between two versions which are in
465           your  repository.  Specifying just --from-patch will get you a diff
466           against your working copy.  If you give diff no version  arguments,
467           it gives you the same information as whatsnew except that the patch
468           is formatted as the output of a diff command
469
470       darcs changes [file|directory]...
471           The `darcs changes' command lists the patches that  constitute  the
472           current  repository  or, with --repo, a remote repository.  Without
473           options or arguments, ALL patches will be listed.
474
475           When given one or more files  or  directories  as  arguments,  only
476           patches  which  affect  those files or directories are listed. This
477           includes changes that happened to files before they were  moved  or
478           renamed.
479
480           When given a --from-tag, --from-patch or --from-match, only changes
481           since that tag or  patch  are  listed.   Similarly,  the  --to-tag,
482           --to-patch  and  --to-match  options  restrict  the  list  to older
483           patches.
484
485           The --last and --max-count options both limit the number of patches
486           listed.   The former applies BEFORE other filters, whereas the lat‐
487           ter applies AFTER other filters.  For example `darcs changes  foo.c
488           --max-count 3' will print the last three patches that affect foo.c,
489           whereas `darcs changes --last 3 foo.c'  will,  of  the  last  three
490           patches, print only those that affect foo.c.
491
492           Three  output formats exist.  The default is --human-readable.  You
493           can also select --context, which is the internal format (as seen in
494           patch bundles) that can be re-read by Darcs (e.g. `darcs get --con‐
495           text').
496
497           Finally, there is --xml-output, which emits valid XML...  unless  a
498           the  patch  metadata  (author,  name  or  description)  contains  a
499           non-ASCII character and was recorded in a non-UTF8 locale.
500
501           Note that while the --context flag may be used in conjunction  with
502           --xml-output or --human-readable, in neither case will darcs get be
503           able to read the output.  On the other hand, sufficient information
504           WILL  be  output  for a knowledgeable human to recreate the current
505           state of the repository.
506
507       darcs annotate [file|directory]...
508           The `darcs annotate' command  provides  two  unrelated  operations.
509           When  called  on  a file, it will find the patch that last modified
510           each line in that  file.   When  called  on  a  patch  (e.g.  using
511           --patch), it will print the internal representation of that patch.
512
513           The  --summary option will result in a summarized patch annotation,
514           similar to `darcs whatsnew'.  It has no effect on file annotations.
515
516           By default, output is in a human-readable format.  The --xml-output
517           option can be used to generate output for machine postprocessing.
518
519       darcs dist
520           The `darcs dist' command creates a compressed archive (a `tarball')
521           in the repository's root directory, containing the  recorded  state
522           of  the  working  tree (unrecorded changes and the _darcs directory
523           are excluded).
524
525           If a predist command is set (see  `darcs  setpref'),  that  command
526           will  be run on the tarball contents prior to archiving.  For exam‐
527           ple, autotools projects would set it to `autoconf && automake'.
528
529           By default, the tarball (and the  top-level  directory  within  the
530           tarball) has the same name as the repository, but this can be over‐
531           ridden with the --dist-name option.
532
533       darcs trackdown [[initialization] command]
534           Trackdown tries to find the most recent version in  the  repository
535           which  passes  a  test.   Given  no  arguments, it uses the default
536           repository test.  Given one argument, it treats it as a  test  com‐
537           mand.   Given two arguments, the first is an initialization command
538           with is run only once, and the second is the test command.
539
540       darcs show contents [file]...
541           Show contents can be used to display an  earlier  version  of  some
542           file(s).   If  you give show contents no version arguments, it dis‐
543           plays the recorded version of the file(s).
544
545       darcs show files [file|directory]...
546           The `darcs show files' command lists those files and directories in
547           the  working  tree that are under version control.  This command is
548           primarily for scripting purposes;  end  users  will  probably  want
549           `darcs whatsnew --summary'.
550
551           A  file  is  `pending'  if  it has been added but not recorded.  By
552           default, pending files (and directories) are listed; the --no-pend‐
553           ing option prevents this.
554
555           By default `darcs show files' lists both files and directories, but
556           the alias `darcs show manifest' only  lists  files.   The  --files,
557           --directories,  --no-files  and --no-directories modify this behav‐
558           iour.
559
560           By default entries are one-per-line (i.e. newline separated).  This
561           can  cause  problems  if  the  files themselves contain newlines or
562           other control characters.  To get aroudn this,  the  --null  option
563           uses  the  null  character instead.  The script interpreting output
564           from this command needs to understand this  idiom;  `xargs  -0'  is
565           such a command.
566
567           For example, to list version-controlled files by size:
568
569               darcs show files -0 | xargs -0 ls -ldS
570
571       darcs show index
572           The  `darcs  show index' command lists all version-controlled files
573           and directories along with their hashes as stored in  _darcs/index.
574           For  files,  the fields correspond to file size, sha256 of the cur‐
575           rent file content and the filename.
576       darcs show pristine
577           The `darcs show  pristine'  command  lists  all  version-controlled
578           files  and  directories  along  with  the  hashes of their pristine
579           copies. For files, the fields correspond to file  size,  sha256  of
580           the pristine file content and the filename.
581       darcs show repo
582           The `darcs show repo' command displays statistics about the current
583           repository, allowing third-party scripts to access this information
584           without  inspecting  _darcs directly (and without breaking when the
585           _darcs format changes).
586
587           By default, the number of patches is shown.   If  this  data  isn't
588           needed,  use  --no-files  to  accelerate  this command from O(n) to
589           O(1).
590
591           By default, output is in a human-readable format.  The --xml-output
592           option can be used to generate output for machine postprocessing.
593
594       darcs show authors
595           The  `darcs  show authors' command lists the authors of the current
596           repository, sorted by the number of patches contributed.  With  the
597           --verbose  option,  this  command  simply  lists the author of each
598           patch (without aggregation or sorting).
599
600           An author's name or email address may change over  time.   To  tell
601           Darcs  when  multiple  author strings refer to the same individual,
602           create an `.authorspellings' file in the root of the working  tree.
603           Each  line  in this file begins with an author's canonical name and
604           address, and may be followed by a comma separated list of  extended
605           regular  expressions.   Blank  lines  and  lines beginning with two
606           hyphens  are  ignored.   The  format  of  .authorspelling  can   be
607           described by this pattern:
608
609            name <address> [, regexp ]*
610
611           There  are some pitfalls concerning special characters: Whitespaces
612           are stripped, if you need space in regexp use [ ].   Because  comma
613           serves  as a separator you have to escape it if you want it in reg‐
614           exp. Note that .authorspelingfile use extended regular  expressions
615           so +, ? and so on are metacharacters and you need to escape them to
616           be interpreted literally.
617
618           Any patch with an author string that matches the canonical  address
619           or  any  of  the associated regexps is considered to be the work of
620           that author.  All matching is case-insensitive and partial (it  can
621           match a substring). Use ^,$ to match the whole string in regexps
622
623           Currently  this  canonicalization  step is done only in `darcs show
624           authors'.  Other commands,  such  as  `darcs  changes'  use  author
625           strings verbatim.
626
627           An example .authorspelling file is:
628
629               -- This is a comment.
630               Fred Nurk <fred@example.com>
631               John Snagge <snagge@bbc.co.uk>, John, snagge@, js@(si|mit).edu
632               Chuck Jones\, Jr. <chuck@pobox.com>, cj\+user@example.com
633
634       darcs show tags
635           The  tags  command  writes  a list of all tags in the repository to
636           standard output.
637
638           Tab characters (ASCII character 9) in tag names are changed to spa‐
639           ces  for  better  interoperability  with shell tools.  A warning is
640           printed if this happens.
641
642   Copying patches between repositories with working copy update:
643       darcs pull [repository]...
644           Pull is used to bring changes made in another repository  into  the
645           current  repository  (that is, either the one in the current direc‐
646           tory, or the one specified with the --repodir option). Pull  allows
647           you  to  bring  over  all  or  some of the patches that are in that
648           repository but not in this one. Pull accepts arguments,  which  are
649           URLs  from which to pull, and when called without an argument, pull
650           will use the repository from which you have  most  recently  either
651           pushed or pulled.
652
653       darcs obliterate
654           Obliterate  completely  removes  recorded  patches  from your local
655           repository.  The changes will be undone in your  working  copy  and
656           the patches will not be shown in your changes list anymore.  Beware
657           that you can lose precious code by obliterating!
658
659       darcs rollback [file|directory]...
660           Rollback is used to undo the effects of one or more patches without
661           actually  deleting them.  Instead, it creates a new patch reversing
662           selected  portions.   of  those  changes.  Unlike  obliterate   and
663           unrecord  (which  accomplish  a similar goal) rollback is perfectly
664           safe, since it leaves in the repository a record of its changes.
665
666       darcs push [repository]
667           Push is the opposite of pull.  Push allows you to copy changes from
668           the current repository into another repository.
669
670       darcs send [repository]
671           Send  is used to prepare a bundle of patches that can be applied to
672           a target repository.  Send accepts the URL of the repository as  an
673           argument.   When called without an argument, send will use the most
674           recent repository that was either pushed to, pulled  from  or  sent
675           to.   By  default,  the patch bundle is sent by email, although you
676           may save it to a file.
677
678       darcs apply <patchfile>
679           The `darcs apply' command takes a  patch  bundle  and  attempts  to
680           insert  it into the current repository.  In addition to invoking it
681           directly on bundles created by `darcs send', it is used  internally
682           by `darcs push' and `darcs put' on the remote end of an SSH connec‐
683           tion.
684
685           If no file is supplied, the bundle is read from standard input.
686
687           If given an email instead of a patch bundle, Darcs  will  look  for
688           the bundle as a MIME attachment to that email.  Currently this will
689           fail if the MIME boundary is rewritten,  such  as  in  Courier  and
690           Mail.app.
691
692           If the `--reply noreply@example.net' option is used, and the bundle
693           is attached to an email, Darcs will send a report (indicating  suc‐
694           cess  or  failure) to the sender of the bundle (the To field).  The
695           argument to noreply is the address the report will appear to origi‐
696           nate FROM.
697
698           The  --cc  option  will  cause  the  report  to  be CC'd to another
699           address,      for      example      `--cc       reports@lists.exam‐
700           ple.net,admin@lists.example.net'.   Using  --cc  without --reply is
701           undefined.
702
703           If gpg(1) is installed,  you  can  use  `--verify  pubring.gpg'  to
704           reject bundles that aren't signed by a key in pubring.gpg.
705
706           If  --test is supplied and a test is defined (see `darcs setpref'),
707           the bundle will be rejected if the test fails  after  applying  it.
708           In  that  case,  the  rejection email from --reply will include the
709           test output.
710
711           A patch bundle may introduce  unresolved  conflicts  with  existing
712           patches  or with the working tree.  By default, Darcs will add con‐
713           flict markers (see `darcs mark-conflicts').
714
715           The --allow-conflicts option will skip conflict  marking;  this  is
716           useful  when  you  want  to  treat  a repository as just a bunch of
717           patches, such as using `darcs pull --union'  to  download  of  your
718           co-workers patches before going offline.
719
720           This  can  mess  up unrecorded changes in the working tree, forcing
721           you to resolve the conflict immediately.  To simply reject  bundles
722           that  introduce  unresolved  conflicts, using the --dont-allow-con‐
723           flicts option.  Making this the default in push-based workflows  is
724           strongly recommended.
725
726           Unlike  most  Darcs commands, `darcs apply' defaults to --all.  Use
727           the --interactive option to pick which patches to apply from a bun‐
728           dle.
729
730       darcs get <repository> [<directory>]
731           Get  creates  a  local  copy  of a repository.  The optional second
732           argument specifies a destination directory for  the  new  copy;  if
733           omitted, it is inferred from the source location.
734
735           By  default  Darcs  will copy every patch from the original reposi‐
736           tory.  This means the copy is completely independent of the  origi‐
737           nal;  you  can operate on the new repository even when the original
738           is inaccessible.  If you expect the original repository  to  remain
739           accessible,  you can use --lazy to avoid copying patches until they
740           are needed (`copy on demand').  This is  particularly  useful  when
741           copying a remote repository with a long history that you don't care
742           about.
743
744           The --lazy option isn't as useful for local copies,  because  Darcs
745           will  automatically  use `hard linking' where possible.  As well as
746           saving time and space, you can move or delete the original  reposi‐
747           tory  without affecting a complete, hard-linked copy.  Hard linking
748           requires that the copy be on the same filesystem and  the  original
749           repository,  and  that  the  filesystem support hard linking.  This
750           includes NTFS, HFS+ and all general-purpose Unix filesystems  (such
751           as ext3, UFS and ZFS).  FAT does not support hard links.
752
753           Darcs  get  will  not copy unrecorded changes to the source reposi‐
754           tory's working tree.
755
756           It is often desirable to make a copy of a repository that  excludes
757           some  patches.  For example, if releases are tagged then `darcs get
758           --tag .' would make a copy of  the  repository  as  at  the  latest
759           release.
760
761           An  untagged repository state can still be identified unambiguously
762           by a context file,  as  generated  by  `darcs  changes  --context'.
763           Given  the  name of such a file, the --context option will create a
764           repository that includes only the patches from that context.   When
765           a  user reports a bug in an unreleased version of your project, the
766           recommended way to find out exactly what version they were  running
767           is to have them include a context file in the bug report.
768
769           You  can also make a copy of an untagged state using the --to-patch
770           or --to-match options, which  exclude  patches  `after'  the  first
771           matching  patch.  Because these options treat the set of patches as
772           an ordered sequence, you may get different results after reordering
773           with `darcs optimize', so tagging is preferred.
774
775           If the source repository is in a legacy darcs-1 format and contains
776           at least one  checkpoint  (see  `darcs  optimize'),  the  --partial
777           option will create a partial repository.  A partial repository dis‐
778           cards history  from  before  the  checkpoint  in  order  to  reduce
779           resource  requirements.  For modern darcs-2 repositories, --partial
780           is a deprecated alias for the --lazy option.
781
782           A repository created by `darcs get' will be in the  best  available
783           format: it will be able to exchange patches with the source reposi‐
784           tory, but will not be directly readable  by  Darcs  binaries  older
785           than 2.0.0.  Use the `--old-fashioned-inventory' option if the lat‐
786           ter is required.
787
788       darcs put <new repository>
789           The `darcs put' command creates a copy of the  current  repository.
790           It is currently very inefficient, so when creating local copies you
791           should use `darcs get . x' instead of `darcs put x'.
792
793           Currently this command just uses `darcs init' to create the  target
794           repository, then `darcs push --all' to copy patches to it.  Options
795           passed to `darcs put' are passed to the init and/or  push  commands
796           as  appropriate.   See  those  commands  for an explanation of each
797           option.
798
799
800   Administrating repositories:
801       darcs initialize
802           The `darcs initialize' command turns the current directory  into  a
803           Darcs  repository.   Any  existing  files and subdirectories become
804           UNSAVED changes in the working tree: record them  with  `darcs  add
805           -r' and `darcs record'.
806
807           When converting a project to Darcs from some other VCS, translating
808           the full revision history to native Darcs patches  is  recommended.
809           (The  Darcs wiki lists utilities for this.)  Because Darcs is opti‐
810           mized for small patches, simply importing the latest revision as  a
811           single  large  patch  can  PERMANENTLY degrade Darcs performance in
812           your repository by an order of magnitude.
813
814           This command creates the `_darcs' directory, which  stores  version
815           control  metadata.   It  also  contains  per-repository settings in
816           _darcs/prefs/, which you can read about in the user manual.
817
818           In addition to the default `darcs-2' format, there are two backward
819           compatibility  formats for the _darcs directory.  These formats are
820           only useful if some of your contributors  do  not  have  access  to
821           Darcs  2.0  or  higher.  In that case, you need to use the original
822           format (called `old-fashioned  inventory'  or  `darcs-1')  for  any
823           repositories those contributors access.
824
825           As  patches  cannot be shared between darcs-2 and darcs-1 reposito‐
826           ries, you cannot use the darcs-2 format  for  private  branches  of
827           such a project.  Instead, you should use the `hashed' format, which
828           provides most of the features of the darcs-2 format, while  retain‐
829           ing  the  ability  to share patches with darcs-1 repositories.  The
830           `darcs get' command will do this by default.
831
832           Once all contributors have access to Darcs 2.0 or higher, a darcs-1
833           project  can  be migrated to darcs-2 using the `darcs convert' com‐
834           mand.
835
836           Darcs will create a hashed repository by default  when  you  `darcs
837           get' a repository in old-fashioned inventory format.  Once all con‐
838           tributors have upgraded to Darcs 2.0 or later, use `darcs  convert'
839           to convert the project to the darcs-2 format.
840
841           Initialize is commonly abbreviated to `init'.
842
843       darcs optimize
844           The  `darcs optimize' command modifies the current repository in an
845           attempt to reduce its resource requirements.  By default  a  single
846           fast, safe optimization is performed; additional optimization tech‐
847           niques can be enabled by passing options to `darcs optimize'.
848
849           The default optimization moves recent patches (those  not  included
850           in the latest tag) to the `front', reducing the amount that a typi‐
851           cal remote command needs to download.  It should  also  reduce  the
852           CPU time needed for some operations.
853
854           The  `darcs  optimize --relink' command hard-links patches that the
855           current repository has in common with its peers.  Peers  are  those
856           repositories  listed  in  _darcs/prefs/sources, or defined with the
857           `--sibling' option (which can be used multiple times).
858
859           Darcs uses hard-links automatically,  so  this  command  is  rarely
860           needed.   It  is  most useful if you used `cp -r' instead of `darcs
861           get' to copy a repository, or if you pulled the same patch  from  a
862           remote repository into multiple local repositories.
863
864           A `darcs optimize --relink-pristine' command is also available, but
865           generally SHOULD NOT be used.  It results  in  a  relatively  small
866           space saving at the cost of making many Darcs commands MUCH slower.
867
868           By  default  patches  are compressed with zlib (RFC 1951) to reduce
869           storage (and download) size.  In exceptional circumstances, it  may
870           be  preferable to avoid compression.  In this case the `--dont-com‐
871           press' option can be used (e.g. with `darcs record') to avoid  com‐
872           pression.
873
874           The  `darcs  optimize --uncompress' and `darcs optimize --compress'
875           commands can be used to ensure  existing  patches  in  the  current
876           repository  are respectively uncompressed or compressed.  Note that
877           repositories in the legacy `old-fashioned-inventory' format have  a
878           .gz extension on patch files even when uncompressed.
879
880           There  is  one more optimization which CAN NOT be performed by this
881           command.  Every time your record a patch, a new inventory  file  is
882           written  to  _darcs/inventories/,  and  old  inventories  are never
883           reaped.
884
885           If _darcs/inventories/ is consuming a relatively  large  amount  of
886           space,  you  can  safely  reclaim it by using `darcs get' to make a
887           complete copy of the repo.  When doing so,  don't  forget  to  copy
888           over  any  unsaved  changes you have made to the working tree or to
889           unversioned files in _darcs/prefs/ (such as _darcs/prefs/author).
890
891       darcs check
892           This command verifies that the  patches  in  the  repository,  when
893           applied successively to an empty tree, result in the pristine tree.
894           If not, the differences are printed and Darcs  exits  unsucessfully
895           (with a non-zero exit status).
896
897           If  the  repository  is in darcs-1 format and has a checkpoint, you
898           can use the --partial option to  start  checking  from  the  latest
899           checkpoint.   This is the default for partial darcs-1 repositories;
900           the --complete option to forces a full check.
901
902           If a regression test is defined (see `darcs setpref')  it  will  be
903           run by `darcs check'.  Use the --no-test option to disable this.
904
905       darcs repair
906           The  `darcs  repair' command attempts to fix corruption in the cur‐
907           rent repository.  Currently it can only repair damage to the  pris‐
908           tine tree, which is where most corruption occurs.
909
910       darcs convert <source> [<destination>]
911           The  current  repository format is called `darcs-2'.  It was intro‐
912           duced in Darcs 2.0 and became the default for new projects in Darcs
913           2.2.   The  `darcs  convert'  command  allows  existing projects to
914           migrate to this format from the older `darcs-1' format.
915
916           This command DOES NOT modify the source repository; a new  destina‐
917           tion  repository  is  created.  It is safe to run this command more
918           than once on a repository (e.g. for testing), before the final con‐
919           version.
920
921           WARNING:  the repository produced by this command is not understood
922           by Darcs 1.x, and patches cannot be exchanged between  repositories
923           in darcs-1 and darcs-2 formats.
924
925           Furthermore,  darcs 2 repositories created by different invocations
926           of this command SHOULD NOT exchange patches, unless those reposito‐
927           ries  had no patches in common when they were converted.  (That is,
928           within a set of repos that exchange patches,  no  patch  should  be
929           converted more than once.)
930
931           Due  to this limitation, migrating a multi-branch project is a lit‐
932           tle awkward.  Sorry!  Here is the recommended process:
933
934            1. for each branch `foo', tag that branch with `foo-final';
935            2. merge all branches together (--allow-conflicts may help);
936            3. run `darcs optimize --reorder' on the result;
937            4. run `darcs convert' to create a merged darcs-2 repository;
938            5. re-create each branch by calling `darcs get --tag foo-final' on
939               the darcs-2 repository; and finally
940            6. use `darcs obliterate' to delete the foo-final tags.
941
942
943

ENVIRONMENT

945   HOME and APPDATA
946       Per-user preferences  are  set  in  $HOME/.darcs  (on  Unix)  or  %APP‐
947       DATA%/darcs  (on  Windows).   This  is also the default location of the
948       cache.
949
950   DARCS_EDITOR, DARCSEDITOR, VISUAL and EDITOR
951       To edit a patch description of email  comment,  Darcs  will  invoke  an
952       external  editor.  Your preferred editor can be set as any of the envi‐
953       ronment variables $DARCS_EDITOR, $DARCSEDITOR, $VISUAL or $EDITOR.   If
954       none of these are set, vi(1) is used.  If vi crashes or is not found in
955       your PATH, emacs, emacs -nw, nano and (on Windows) edit are each  tried
956       in turn.
957
958   DARCS_PAGER and PAGER
959       Darcs  will  sometimes invoke a pager if it deems output to be too long
960       to fit onscreen.  Darcs will use the pager specified by $DARCS_PAGER or
961       $PAGER.  If neither are set, `less' will be used.
962
963   DARCS_TMPDIR and TMPDIR
964       Darcs  often  creates  temporary  directories.  For example, the `darcs
965       diff' command creates two for the  working  trees  to  be  diffed.   By
966       default  temporary  directories are created in /tmp, or if that doesn't
967       exist, in _darcs (within the current repo).  This can be overridden  by
968       specifying  some other directory in the file _darcs/prefs/tmpdir or the
969       environment variable $DARCS_TMPDIR or $TMPDIR.
970
971   DARCS_KEEP_TMPDIR
972       If the environment variable DARCS_KEEP_TMPDIR is  defined,  darcs  will
973       not remove the temporary directories it creates.  This is intended pri‐
974       marily for debugging Darcs itself, but it can also be useful, for exam‐
975       ple,  to  determine  why  your test preference (see `darcs setpref') is
976       failing when you run `darcs record', but working when run manually.
977
978   DARCS_EMAIL and EMAIL
979       Each patch is attributed to its author, usually by email  address  (for
980       example,  `Fred  Bloggs  <fred@example.net>').   Darcs looks in several
981       places  for  this  author  string:  the  --author  option,  the   files
982       _darcs/prefs/author  (in  the  repository) and ~/.darcs/author (in your
983       home directory), and the environment variables $DARCS_EMAIL and $EMAIL.
984       If  none of those exist, Darcs will prompt you for an author string and
985       write it to _darcs/prefs/author.
986
987   SENDMAIL
988       On Unix, the `darcs send' command relies on sendmail(8).  The  `--send‐
989       mail-command'  or $SENDMAIL environment variable can be used to provide
990       an explicit path to this  program;  otherwise  the  standard  locations
991       /usr/sbin/sendmail and /usr/lib/sendmail will be tried.
992
993   DARCS_SSH
994       Repositories  of  the  form  [user@]host:[dir]  are  taken to be remote
995       repositories, which Darcs accesses with the external program ssh(1).
996
997       The environment variable $DARCS_SSH can be used to specify an  alterna‐
998       tive  SSH  client.  Arguments may be included, separated by whitespace.
999       The value is not interpreted by a shell, so shell constructs cannot  be
1000       used; in particular, it is not possible for the program name to contain
1001       whitespace by using quoting or escaping.
1002
1003   DARCS_SCP and DARCS_SFTP
1004       When reading from a remote repository, Darcs will attempt to run `darcs
1005       transfer-mode'  on  the remote host.  This will fail if the remote host
1006       only has Darcs 1 installed, doesn't have Darcs  installed  at  all,  or
1007       only allows SFTP.
1008
1009       If  transfer-mode  fails,  Darcs  will fall back on scp(1) and sftp(1).
1010       The commands invoked can be customized with the  environment  variables
1011       $DARCS_SCP  and $DARCS_SFTP respectively, which behave like $DARCS_SSH.
1012       If the remote end allows only sftp, try setting DARCS_SCP=sftp.
1013
1014   SSH_PORT
1015       If this environment variable is set, it will be used as the port number
1016       for  all  SSH  calls  made by Darcs (when accessing remote repositories
1017       over SSH).  This is useful if your SSH  server  does  not  run  on  the
1018       default  port,  and  your  SSH  client  does not support ssh_config(5).
1019       OpenSSH users will probably prefer to put something like `Host  *.exam‐
1020       ple.net Port 443' into their ~/.ssh/config file.
1021
1022   HTTP_PROXY, HTTPS_PROXY, FTP_PROXY, ALL_PROXY and NO_PROXY
1023       If  Darcs was built with libcurl, the environment variables HTTP_PROXY,
1024       HTTPS_PROXY and FTP_PROXY can be set to the URL of a proxy in the form
1025
1026         [protocol://]<host>[:port]
1027
1028       In which case libcurl will use the proxy for  the  associated  protocol
1029       (HTTP,  HTTPS and FTP).  The environment variable ALL_PROXY can be used
1030       to set a single proxy for all libcurl requests.
1031
1032       If the environment variable NO_PROXY is a comma-separated list of  host
1033       names,  access  to those hosts will bypass proxies defined by the above
1034       variables.  For example, it is quite common to avoid proxying  requests
1035       to machines on the local network with
1036
1037         NO_PROXY=localhost,*.localdomain
1038
1039       For compatibility with lynx et al, lowercase equivalents of these envi‐
1040       ronment variables (e.g. $http_proxy) are also understood and  are  used
1041       in preference to the uppercase versions.
1042
1043       If  Darcs  was  not built with libcurl, all these environment variables
1044       are silently ignored, and there is no way to use a web proxy.
1045
1046   DARCS_PROXYUSERPWD
1047       If Darcs was built with libcurl, and you are using  a  web  proxy  that
1048       requires  authentication,  you can set the $DARCS_PROXYUSERPWD environ‐
1049       ment variable to the username and password expected by the proxy, sepa‐
1050       rated  by  a  colon.   This environment variable is silently ignored if
1051       Darcs was not built with libcurl.
1052
1053

FILES

1055   _darcs/prefs/binaries
1056       This file contains a list of  extended  regular  expressions,  one  per
1057       line.  A file path matching any of these expressions is assumed to con‐
1058       tain binary data (not text).  The entries in ~/.darcs/binaries  (if  it
1059       exists) supplement those in this file.
1060
1061       Blank  lines,  and  lines beginning with an octothorpe (#) are ignored.
1062       See regex(7) for a description of extended regular expressions.
1063
1064

BUGS

1066       At http://bugs.darcs.net/ you can find a list of known bugs  in  Darcs.
1067       Unknown  bugs  can be reported at that site (after creating an account)
1068       or by emailing the report to bugs@darcs.net.
1069

SEE ALSO

1071       A user manual is included with Darcs, in PDF and  HTML  form.   It  can
1072       also be found at http://darcs.net/manual/.
1073
1074
1075
1076                                2.4.4 (release)                       DARCS(1)
Impressum