Patch index is an internal optimization in darcs. darcs uses patch index to quickly identify the patches that modified a given file. This is especially useful for the commands log and annotate.

Patch index is created when running log and annotate, and can be created explicitely by passing the flag --with-patch-index to the commands init, clone and convert. It can also be created explicitely by running darcs optimize enable-patch-index. To disable patch index creation when using log or annotate, pass the flag --no-patch-index. Every time patch index is create, the user can hit Ctrl-C, which will interrupt its creation and disable its automatic creation in the future (unless optimize enable-patch-index is explicitely run).

If patch index is enabled, it is automatically updated and used.

Patch index tries to be as invisible as possible to the user. To this end, creating/using/modifying patch index is almost invisible to the end user.

There are however, some commands which lets the user glean the state of patch index. They are primarily meant for debugging.

  • show patch-index-status returns information on whether patch index is not created/out of date/in sync.
  • show patch-index-test tests the patch index in the repository with some logical consistency properties.
  • show patch-index-all dumps the patch index
  • show patch-index-files displays the files tracked by patch index (This has to be same as the files tracked by darcs)