You can find more readable version of this text here:
https://hub.darcs.net/ki11men0w/profile/browse/presentations/darcs-boring-files
PROBLEMS WITH USING [boring|binaries] FILES IN _DARCS_
Recently, I have started actively using _darcs_ in my work. Before that,
I worked only with _git_ for many years and during this time I got used
to some patterns of working with _VCS_.
I would like to discuss some points that seem illogical or inconvenient
to me when working with _darcs_ with _boring_ and _binaries_ files.
Below I will write only about _boring_ files, but everyting also applies
to _binaries_ files.
In _darcs_ there are three ways to configure which files to be ignored:
1. ~/.darcs/boring
A configuration file globally for the user specifying which files
should be ignored in all his repositories.
THIS IS A USER-LEVEL SETTING.
2. _darcs/prefs/boring
The default configuration file that specifies the ignore rules for a
particulat clone of the repository. It is specific and private for
each clone of the repository. It is not under version control and is
not copied by the clone command, and so is not shared between clones
of the repository.
THIS IS A CLONE-LEVEL SETTING.
3. The file specified using `darcs setpref boringfile ...`
If set, it is used instead of _darcs/prefs/boring. Usually a file
set in this way is put under version control so that it can be
shared among different developers.
THIS IS A REPOSITORY-LEVEL SETTING.
In the world of git, I am used to the fact that when creating a
repository in the repository itself, no ignores are configured
automatically. I am used to the fact that the ignoring of files
resulting from the work of the tools used by the programmer during
development should be carried out at the user level, not the repository
level. Different programmers use different tools and taking into account
all their preferences at the repository level very quickly leads to
cluttering of the boring file. I am used to the fact that the file with
the ignore settings at the repository level should contain only what
does not make sense to take into account in the user level settings,
because it is specific for this repository. I'm used to the fact that
boring configuration at the repository level is rather a rare exception:
all ignores are almost always configured either at the user level or at
the clone level.
I do not insist that everyone should adhere to the described approach.
But it seems convenient to me and I would like to stick to it. But it
turned out that _darcs_ is not flexible enough for this. There are two
main points that I would like to change in _darcs_ in order to be able
to work with boring files in the way I'm used to.
Problem #1: in the newly created repositories, _darcs/prefs/boring file is
always filled with templates.
The init, clone and convert import commands always create a
template-filled file _darcs/prefs/boring in the new repository.
This turned out to be an unpleasant surprise for me. The default
template leads to ignoring files that are important for my work, which
in turn led to frequent errors when the necessary files were not under
version control. I cleaned up the _darcs/prefs/boring file in my
repository, but when cloning it was filled with the default template
again. In the end, I figured out that permanent cleaning of this file
when executing the init and clone commands can be achieved by placing
the following lines in the ~.darcs/defaults file:
clone posthook echo > _darcs/prefs/boring
initialize posthook echo > _darcs/prefs/boring
I understand that filling with template is done specifically to make
life easier for those who are starting to learn _haskell_, but for
everyone else it's more of a disservice. This behavior is not described
in the documentation for the init|clone commands and there is no way to
understand what will happen exactly until an error is made.
It seems to me it would be convenient to have a command line option that
allows you to create a file _darcs/prefs/boring empty (without
templates) when executing these commands. This will allow, firstly, to
explicitly learn about this feature from the help, and, secondly, to
simplify the configuration in the ~.darcs/defaults file.
Decision
I implemented this feature in this patch:
https://hub.darcs.net/ki11men0w/darcs-screened/patch/24e79fb194b4caa073f43dc6707cceba500c29fc.
The corresponding command line options are called
--[with|no]-prefs-templates. If none of these options are set, or the
--with-prefs-templates option is set, then _darcs_ behaves as before. To disable
the filling of the file _darcs/prefs/[boring|binaries] for all cases, you can
add to ~.darcs/defaults the line:
ALL no-prefs-templates
Problem #2: ignoring the _darcs/prefs/boring file after setpref
As I wrote above, the _darcs/prefs/boring file allows you to perform
ignore settings at the repository clone level. This is exactly what is
need