[darcs-devel] [patch1863] WIP: force PatchSet to always start at Origin

Ben Franksen bugs at darcs.net
Sat Aug 10 12:00:05 UTC 2019


Ben Franksen <ben.franksen at online.de> added the comment:

I take back my counter proposal. Using Unsafe... all over the place is
not good. Yours is nicely uninvasive, but I would like us to do the
refactor in the rebase log command first.

> You can't get a non-bottom/unsafeCoerced PatchSet without wStart~Origin,
> so the signature is still correct.

Okay, I didn't get that.

>> src/Darcs/Patch/Bundle.hs:119:39: error:
>>     • Could not deduce: wZ ~ Origin
> 
> How did you get that error? 

My mistake. I replaced /every/ wStart with Origin in the module, but the
one in makeBundle2 is not an argument to a PatchSet but rather an RL.

> Won't all the uses of Fork need to use UnsafePatchSet too? Plus things
> like :> etc.

Yes.

> To be clear, I don't think either piece of code you identified above is
> problematic, though perhaps the types are a bit misleading. To the
> extent that any code implicitly assumes that the patch sequence starts
> from Origin, that assumption is now validated by the constrained
> constructor type.

With the exception of the unsafeCoerce you need for rebase log.

I think we can refactor the log and rebase log to share a smaller
function that doesn't take a PatchSet, just an RL. getLogInfo handles
matching options for a patchSet but rebase log doesn't need that, in
fact it doesn't have any matching options.

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


More information about the darcs-devel mailing list