[darcs-devel] [patch1931] WIP: remove isInverted from PatchInfo

Ganesh Sittampalam bugs at darcs.net
Sat Sep 21 21:34:25 UTC 2019


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

> I always assumed there was a tacit understanding that named patches in a
> repo are never stored inverted. So i am not too worried here.

I was partly wondering if there might be cases where we store a named
patch outside the main sequence of patches in the repo.

But also now I think about it, I have a feeling that rollback used to
work differently and might have done this. I will dig in the history.

One other question about backwards compatibility: currently the XML
output (Darcs.Patch.Info.toXml') includes a line about 'inverted'.
I initially took the conservative approach and preserved it, but
thinking about it I am inclined to remove it.

> One way to view this is that for named patches (including named prims)
> adding the inverse of a patch to a sequence is the same as removing that
> patch i.e. a patch and its inverse cancel each other. It would be
> possible, in principle, to codify this with a custom Eq2 instance for
> sequences of patches with a SignedIdent instance (i.e. including
> Invertible) that removes inverse pairs, but to do that cleanly requires
> DerivingVia, so this is currently out of reach.

A sequence containing extra patches+inverses doesn't have the same
commute behaviour as one where they have been cancelled, so this doesn't
feel right to me.

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


More information about the darcs-devel mailing list