[darcs-devel] filler patches and future dependencies

Eric Y. Kow eric.kow at gmail.com
Tue Aug 14 19:19:59 UTC 2007


Recently on darcs-user, Nathan Gray announced his darcs-repatch script.
It seems like this might be quite an interesting component to a kind of
darcs first aid kit.  Nathan's script seems nice in that it allows you
to preserve your history.  On the other hand, I wonder if there isn't an
even better, cleaner way to recover from inconsistent repositories.  By
'clean', I mean that we fix repositories by *adding* patches only, never
by removing and modifying them.  The goal would be able to repair a live
repository and make it so that you can push and pull the corrections
without traumatising the end user.

An inconsistent repository is one where we try to apply a patch to the
wrong context (due to bugs, evil gremlins, cosmic rays, etc).  We can
think of such situation as there being a gap between the context and the
patch we're trying to apply.

So what I was wondering if there might not be some way to insert a
"filler" patch to plug the gap.  For example, you might have a patch
which adds hunks to a file that does not exist yet... so to compensate
for this, you insert a filler patch which adds the missing file.

The main problem here consists in making the original patch depend on
the filler patch, because we do not want to modify the original patch.
The solution I propose is to introduce a notion of 'future dependency',
so that it is not the original patch which depends on the filler, but
the filler which future-depends on the original patch.  If a patch p1
future-depends on patch p2, it behaves as if p2 depends on p1: you must
pull patch p1 in order to pull p2 and you cannot obliterate p2 without
first obliterating p1.

There remain some questions to answer.  I'll give my suggestions below
but avoid going into detail for now.

* how to create these filler patches
  - A mirror program called 'evildarcs'
* how to apply them
  - Don't, except for evildarcs (pristine), darcs get and darcs repair
* how to commute them
  - Freely, except for future dependencies.
* how to deal with cases where we really want to remove a patch 
  - Cancellation filler patch?

I guess I won't be able to work on this.  But any comments?  Feasibility
guesses?

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070814/d1b79f0b/attachment.pgp


More information about the darcs-devel mailing list