[darcs-devel] [issue2372] Please remove "HINT: I could not reach..." message

Ben Franksen ben.franksen at online.de
Sat Mar 7 17:07:00 UTC 2015


Guillaume Hoffmann wrote:
> Ben, you can search patches by the hunks they may contain, that will
> probably give you an indication of where the HINT message comes from:
> 
>     darcs log -i --matches "hunk HINT"

I didn't know that trick yet, thanks for sharing. And it brings interesting 
results, too. After a bit of digging around I hit on issue1599 and via that 
on issue1210. This last one gives a pretty good motivation for the sources 
hint: if a cache is inside a directory configured for automounting and it 
cannot be accessed, this will hugely slow down darcs as it tries to 
automount the same directory over and over again.

The right solution is of course to blacklist any directory which Darcs 
notices is not accessible and not to try reading from it again. This is 
exactly what happens (nowadays). I guess this is the prime reason why 
completely ignoring the sources hint causes no noticeable problems (for me, 
and apparently others, too).

However, blacklisting sources is at the moment confined to a single run. 
This means every time you invoke darcs, there will be a possible delay for 
each non-existent entry under an automount directory. A second problem is 
with ~/.darcs/cache, which is hard-coded and thus cannot be removed.

To fix both these problems, I propose the following plan:

(1) Stop accessing ~/.darcs/cache unconditionally. Instead, automatically 
create ~/.darcs/sources (if and only if it does not yet exist), with 
~/.darcs/cache as the single (default) entry. We can do this every time 
Darcs is invoked or just before it starts reading patch files.

(2) Similarly, for each repo create _darcs/prefs/sources that by default is 
a copy of ~/.darcs/sources. Again, do this only if no such file exists (i.e. 
*not* if it exists and is empty).

(3) Whenever an entry in _darcs/prefs/sources or ~/.darcs/sources is 
inaccessible, it gets removed (permanently) from both files.

(4) New entries are auto-added to _darcs/prefs/sources as before i.e. 
whenever we are told to fetch something from a specified repo.

This allows users to reset the caching behaviour of a repo to defaults by 
simply removing _darcs/prefs/sources. In the same way, removing 
~/.darcs/sources resets the global default to the single entry for 
~/.darcs/cache. Everything else is taken care of automatically.

Cheers
Ben



More information about the darcs-devel mailing list