[darcs-users] Re: making add/remove file commute with content change

Michael Conrad silverdirk at silverdirk.com
Thu Nov 29 22:38:44 UTC 2007


On Thu, 29 Nov 2007 04:36:53 -0500, Ketil Malde <ketil.malde at bccs.uib.no>
wrote:
> "Michael Conrad" <silverdirk at silverdirk.com> writes:
>> Actually... there's still a problem with this.  You can't apply a patch
>> that alters a file unless you know that you have all the other patches
>> that have altered the file.
>
> Uh, can't you cherry-pick patches with darcs?
>
>> I see that as mainly a user interface problem, though.  Maybe having
>> ghosts that can be seen with a special darcs command would be a way
>> to let users specify which files they want to have darcs go collect
>> the dependancies for?
>
> Well - I imagine 'ghost hunks' would only be pulled when they are in
> patches that apply to non-ghost ("live"?) files.  So unless you
> implement some trickery to decide which dependencies are really
> needed, all dependencies would be pulled in, which  I suppose would
> include at least file creation, voiding the entire scheme.
> :-)

Maybe what I'm trying to say is that as long as a file stays "ghosted",
everything is fine.  But, if you ever want to un-ghost a file, there is a
huge complicated headache involved in making sure you have all the
patch-files that you need in order to un-ghost it.

If you have a file, lets say, a Makefile, and it looks (in the original
patch) like

    Target1: Dep1 Dep2 Dep3
      Action1
      Action2

    Target2: Dep1
      Action1

And lets say that a second patch adds a target

hunk [unique name of Makefile] 5
+Target3: Dep1 Dep2
+  Action1
+
}

and then a third patch has

hunk [unique name of Makefile] 9
-  Action1
+  Modified Action1
}

and then a fourth patch has

hunk [unique name of Makefile] 8
-Target2: Dep1
+Target2: Dep1 Dep2 Dep3 Dep4
}

Suppose you have Patch#3 and none of the others.  You do stuff with your
repo and various things happen to this patch in the process of
commutation, but nothing happens to this portion of the patch because the
file is ghosted.

Now suppose you decide you want this file, composed of Patch#1 Patch#3 and
Patch#4 *without* Patch#2.  Darcs would have to figure out that Patch#3
depends on Patch#2, but it can be commuted with #2 so that it no longer
depends on it.  Same with Patch#4.  You want darcs to figure this out
without actually applying Patch#2 to your repo, and also without really
knowing which patches it needs from the other user's repo.

It doesn't sound impossible yet, but sounds very hard...

-Mike




More information about the darcs-users mailing list