[darcs-users] matching vs deps (Was: Easiest way to recover a change from an old patch?)

Eric Kow kowey at darcs.net
Tue Aug 10 12:27:39 UTC 2010


On Tue, Aug 10, 2010 at 12:09:27 +0100, Ashley Moran wrote:
> Ah... so doing -p on an old patch will include only the dependencies
> to get that patch?  I understand now, but I still find that a bit
> confusing.

The fact that darcs show dependencies by default is something that
regularly confuses users.  Heck, I've been tripped up it and so have
other Darcs developers.

The good news is that we have an FAQ about it:
 * http://wiki.darcs.net/FAQ#darcs-offers-me-unexpected-match-results

The bad news is that we need to have an FAQ about it.
Perhaps we can do better!

> I think my dream darcs interface to this would be to present all
> patches, and interactively ask if you want to roll back the
> dependencies too.  That way you don't need to know in advance whether
> the patch has dependencies (which can be hard to guess for large
> patches).

You may be interested in (--dont-prompt-for-dependencies), which lacks the
interactiveness you seek.

I like your idea, but there may be some UI mechanics to hammer out.

Right now -- and not picking on Alexey but just finding an example of
a rollback sequence -- we have something like this

  $ darcs rollback -p Hardlink
  Mon Aug  2 04:54:45 BST 2010  Alexey Levan <exlevan at gmail.com>
    * Minimize the number of packed inventories
  Shall I rollback this patch? (1/3)  [ynW...], or ? for more options: y
  Mon Aug  2 03:49:14 BST 2010  Alexey Levan <exlevan at gmail.com>
    * Use cache while getting a packed repository
  Shall I rollback this patch? (2/3)  [ynW...], or ? for more options: y
  Sun Aug  1 06:03:49 BST 2010  Alexey Levan <exlevan at gmail.com>
    * Hardlink files while getting a packed repository
  Shall I rollback this patch? (3/3)  [ynW...], or ? for more options: 

So the first two patches ("Minimize" + "Use cache") depend on "Hardlink"
and we can't rollback the latter without the former.  What's confusing is
that you get presented with seemingly unrelated patches.

Am I right in thinking that you want something more like this?

  $ darcs rollback -p Hardlink
  Sun Aug  1 06:03:49 BST 2010  Alexey Levan <exlevan at gmail.com>
    * Hardlink files while getting a packed repository

  There are 2 patches that depend on this patch.
  Shall I rollback this patch? (3/3) [ynW...], or ? for more options: y
  OK, will also roll back its two dependents

One detail to sort out is how this generalises to darcs pull and other
commands that use matchers (fairly straightforwardly, I think; you just
need to change your wording carefully).

Another detail is how does this interact with patch navigation?  Perhaps
one answer is when I hit j/k to interactively select patches, (A) I am
only presented with matched patches and (B) changing my mind on a patch
means changing my mind on its dependencies (C) except for the case of
dependencies that are shared by multiple matched patches and (D) also
except for the case of explicitly requested patches [this can be
detected through commutation]

Finally, how do we report dependencies on multiple patches?  Do we
repeat them on each one?  I'd be inclined to say no for simplicity...

Hmm, I liking the idea more after thinking about it. Was a bit resistant
at first. Florent may be interested in this discussion too.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, please try +44 (0)1273 64 2905.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100810/bff3667a/attachment.pgp>


More information about the darcs-users mailing list