Created on 2008-08-07.04:32:26 by nwf, last changed 2017-07-30.23:59:24 by gh.
msg5302 (view) |
Author: nwf |
Date: 2008-08-07.04:32:20 |
|
Mentioned in http://bugs.darcs.net/issue74 is a '"hunk move" patch idea', the
basic idea being a mechanism to move a hunk around in or between files. The UI
needs to be sorted out, but even having a basic patch type for this would be
nice; some external tool (e.g. perl) can generate a patch to use with "darcs
apply".
As issue74 is marked wont-fix and is about a different issue, this is probably
worth having its own ticket. Thoughts welcome.
|
msg5303 (view) |
Author: kowey |
Date: 2008-08-07.07:20:07 |
|
Sounds interesting... something I wish for a lot when I study diffs. But I'm
going to mark this deferred until after darcs 2.1
|
msg5305 (view) |
Author: nwf |
Date: 2008-08-07.10:20:41 |
|
Actually, it turned out not to be that bad to write at least a first pass of
such a thing. If somebody else wants to help me test this more fully, I'd be
quite appreciative. Patch, with very light test case, attached.
If you still feel this should be deferred, feel free to mark it as such again.
Thoughts are, as always, welcome.
Attachments
|
msg5306 (view) |
Author: nwf |
Date: 2008-08-07.10:41:23 |
|
Er, hm... thinking about it, I got the commutation relationships wrong for
this; wasn't thinking clearly being up at 0600 and having spent hours learning
Darcs internals. ;)
I think the commutation relations should be:
HunkMove against Hunk, no conflicts : commute
HunkMove against Hunk, conflicts with HM src (and dst?) : update HM to
include Hunk.
HunkMove against Hunk, conflicts only in dst: update H to apply to src and HM
to take it to dst.
HunkMove against HunkMove conflicts are more interesting:
src/src and dst/dst conflicts : actually a conflict
HunkMove then HunkMove entirely again : one HunkMove to do both.
HunkMove then HunkMove subset again: up to three HunkMove patches needed
(first splits into two to original dest, one to new dest)
HunkMove then HunkMove superset: up to three HunkMove patches needed (first
moves to new dest, second splits into two, one above and one below)
HunkMove then HunkMove straddling: up to three HunkMove patches needed (first
splits into two, one to each dest, and the second gets shrunk)
Does that seem right?
I'll see if I can get a more correct version up by this weekend.
|
msg5307 (view) |
Author: kowey |
Date: 2008-08-07.10:55:50 |
|
Interesting stuff! I recommend also learning about the repoformat stuff when
you've got the ideas for this worked out better. It's to ensure
forwards/backwards compatibility.
If you've been learning about internals, I'd also appreciate any documentation
(haddock) you want to lay down along the way, or any notes at
http://wiki.darcs.net/index.html/DarcsInternals
as well as any comments on what was tricky, could be made more straightforward
|
msg8276 (view) |
Author: kowey |
Date: 2009-08-18.22:44:31 |
|
Hi Nathaniel,
So you may be interested to know that Ganesh has been working on this for some
time now. So perhaps you have fun things to say to each other :-)
At the last sprint, he was working on a tool he has been writing for some months
which is intended to help with designing new patch types and their commutation
rules.
|
|
Date |
User |
Action |
Args |
2008-08-07 04:32:26 | nwf | create | |
2008-08-07 07:20:10 | kowey | set | status: unread -> deferred nosy:
+ kowey messages:
+ msg5303 title: Inter/Intra-File Hunk Move patch type -> Inter/Intra-File Hunk Move patch type [revive after 2.1] |
2008-08-07 07:20:22 | kowey | set | nosy:
tommy, beschmi, kowey, dagit, Serware, nwf title: Inter/Intra-File Hunk Move patch type [revive after 2.1] -> Inter/Intra-File Hunk Move patch type [revive after 2.2] |
2008-08-07 10:20:46 | nwf | set | status: deferred -> unknown nosy:
tommy, beschmi, kowey, dagit, Serware, nwf messages:
+ msg5305 files:
+ hunkmove-take1.darcs |
2008-08-07 10:41:26 | nwf | set | nosy:
tommy, beschmi, kowey, dagit, Serware, nwf messages:
+ msg5306 |
2008-08-07 10:55:52 | kowey | set | nosy:
tommy, beschmi, kowey, dagit, Serware, nwf messages:
+ msg5307 title: Inter/Intra-File Hunk Move patch type [revive after 2.2] -> wish: Inter/Intra-File Hunk Move patch type (revive after 2.2) |
2009-08-06 21:10:15 | admin | set | nosy:
+ dmitry.kurochkin, simon, thorkilnaur, - beschmi |
2009-08-11 00:19:42 | admin | set | nosy:
- dagit |
2009-08-18 22:44:35 | kowey | set | status: unknown -> has-patch title: wish: Inter/Intra-File Hunk Move patch type (revive after 2.2) -> wish: Inter/Intra-File Hunk Move patch type nosy:
+ ganesh messages:
+ msg8276 topic:
+ Target-3.0, - Darcs2 assignedto: ganesh |
2009-08-25 18:13:53 | admin | set | nosy:
+ darcs-devel, - simon |
2009-08-27 14:27:35 | admin | set | nosy:
tommy, kowey, darcs-devel, ganesh, thorkilnaur, dmitry.kurochkin, Serware, nwf |
2009-10-23 22:43:43 | admin | set | nosy:
+ serware, - Serware |
2009-10-23 23:29:34 | admin | set | nosy:
+ Serware, - serware |
2010-06-15 21:10:43 | admin | set | topic:
- Target-3.0 |
2010-06-15 21:10:44 | admin | set | milestone: 3.0.0 |
2017-07-30 23:59:24 | gh | set | status: has-patch -> given-up |
|