[darcs-devel] [patch1997] index: fix import layout (and 8 more)

Ganesh Sittampalam bugs at darcs.net
Thu Feb 27 07:41:01 UTC 2020


Ganesh Sittampalam <ganesh at earth.li> added the comment:

> A series of refactors to clean up specific parts of the index code. I
> followed your (Ganesh's) example and did this as a series of small patches
> to convince me that all changes are correct and don't change behavior. This
> worked out pretty well: all tests succeeded the first time I ran them.

FWIW it also makes a big difference to my reviewing speed, as I can
think about each bit separately and I also often only have small chunks
of time to make incremental progress.

>   * index: fix import layout

Fine

>   * index: fix layout of getFileID'

Fine

>   * index: factor nameof and namelength to top level

Fine

>   * index: refactor second argument of nameof

Fine

>   * index: factor out substateof

Fine

>   * index: use compare in local 'subs' functions

Fine

>   * inline namelength and simplify dirlength calculation

Fine

>   * index: fix and extend documentation

Fine (I didn't actually check what you said is true, but I'm sure it is)

>   * index: no longer rely on the special behavior of appendPath

> -          then dirlength state -- must be 0 in this case
> +          Nothing -> dirlength state

Isn't that "must be 0" comment still valid?

> -           tree' = makeTree [ (n, fromJust $ treeitem s) | (n, s) <- inferiors, isJust $ treeitem s ]
> +           tree' = makeTree [ (n, fromJust $ treeitem s) | (Just n, s) <- inferiors, isJust $ treeitem s ]

What's going on here, i.e. how do we know it isn't a behaviour change?

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1997>
__________________________________


More information about the darcs-devel mailing list