darcs

Issue 978 wish: Inter/Intra-File Hunk Move patch type

Title wish: Inter/Intra-File Hunk Move patch type
Priority wishlist Status given-up
Milestone 3.0.0 Resolved in
Superseder Nosy List Serware, darcs-devel, dmitry.kurochkin, ganesh, kowey, nwf, thorkilnaur, tommy
Assigned To ganesh
Topics

Created on 2008-08-07.04:32:26 by nwf, last changed 2017-07-30.23:59:24 by gh.

Files
File name Uploaded Type Edit Remove
hunkmove-take1.darcs nwf, 2008-08-07.10:20:41 text/plain
Messages
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.
History
Date User Action Args
2008-08-07 04:32:26nwfcreate
2008-08-07 07:20:10koweysetstatus: 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:22koweysetnosy: 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:46nwfsetstatus: deferred -> unknown
nosy: tommy, beschmi, kowey, dagit, Serware, nwf
messages: + msg5305
files: + hunkmove-take1.darcs
2008-08-07 10:41:26nwfsetnosy: tommy, beschmi, kowey, dagit, Serware, nwf
messages: + msg5306
2008-08-07 10:55:52koweysetnosy: 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:15adminsetnosy: + dmitry.kurochkin, simon, thorkilnaur, - beschmi
2009-08-11 00:19:42adminsetnosy: - dagit
2009-08-18 22:44:35koweysetstatus: 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:53adminsetnosy: + darcs-devel, - simon
2009-08-27 14:27:35adminsetnosy: tommy, kowey, darcs-devel, ganesh, thorkilnaur, dmitry.kurochkin, Serware, nwf
2009-10-23 22:43:43adminsetnosy: + serware, - Serware
2009-10-23 23:29:34adminsetnosy: + Serware, - serware
2010-06-15 21:10:43adminsettopic: - Target-3.0
2010-06-15 21:10:44adminsetmilestone: 3.0.0
2017-07-30 23:59:24ghsetstatus: has-patch -> given-up