[darcs-devel] inconsistencies in Darcs.Patch.Depends

Ben Franksen ben.franksen at online.de
Sat Jun 9 19:17:24 UTC 2018


The docs for Darcs.Patch.Depends.getUncovered say

-- | @getUncovered ps@ returns the 'PatchInfo' for all the patches in
--   @ps@ that are not depended on by anything else *through explicit
--   dependencies*. [...]

This is a sensible specification but the implementation does not satisfy
it: it only considers explicit dependencies of tags and completely
ignores those of normal patches.

Here is the definition of the term "covered" earlier in the module:

 - Covered: a patch p covers another, q, if p's explicit dependencies
include
 - q. E.g. in a repo [a,b,t] where t is a tag and a,b have no explicit
 - dependencies, then t will cover a and b.

The first sentence tells us that the definition of 'covered' is
basically "covered" = "explicitly depended on". But the example adds the
side condition "... and a,b have no explicit dependencies", suggesting
that the definition might be incomplete. I cannot reverse engineer any
sensible full definition that makes the example consistent with it. So
what if e.g. a explicitly depends on b? Does that mean the tag does not
cover b?

This is all rather unsatifying.

IMO a sensible definition of "covered" would be: the transitive closure
of the relation "explicitly depended upon". So, a is covered by b if b
explicitly depends on a or there is a patch p covered by b that
explicitly depends on a.

If getUncovered were renamed to uncoveredByTags then it would be
consistently named with respect to this definition.

Please tell me if your understanding of the code and/or its docs
deviates from mine.

Cheers
Ben



More information about the darcs-devel mailing list