[darcs-users] bug in darcs whatsnew

David Roundy droundy at abridgegame.org
Sat Aug 21 10:30:25 UTC 2004


On Fri, Aug 20, 2004 at 03:43:39PM +0200, Ketil Malde wrote:
> David Roundy <droundy at abridgegame.org> writes:
> 
> > Perhaps.  I had thought about this as a possibility way back before darcs
> > was in haskell, and didn't end up doing it, simply because the current
> > "hunk granularity" is usually good enough.  The key is that one would need
> > a clean user interface, which might be hard to come up with.
> 
> Perhaps an option b[reak up], working something like:

Yeah, that would be a reasonable interface.  However breaking into single
lines would be perhaps problematic, since you'd have to break up both the
"old" version and the "new", so you could lead to the user having to hit
'y' or 'n' hundreds of times, which wouldn't be nice.  Maybe 'b' should
just break into two parts the old and new versions, so you could at least
anser O(log(n)) questions rather than n questions in the common case where
you just want one half of the hunk.  Then we could (in theory) try to be
smart about where we split the hunk in response to 'b'.

One thing I'm not clear on is how we'd deal with the more complex requests
a user could make.  e.g. given the hunk


hunk
-1
-2
-3
+a
+b
+c

if the user wants to keep the "-1" and "-3" but not the "-2", how do we
know what the file ends up as? Basically the order of prompting will
determine this, and it isn't obvious what's the best way to do it.
Fundamentally, the issue is that unlike the case of a pure addition or
subtraction patch, there is no unique set of subpatches into which the hunk
can be broken.  e.g. we could break it into either


hunk
-1
hunk
-2
hunk
-3
hunk
+a
hunk
+b
hunk
+c

or

hunk
+a
hunk
+b
hunk
+c
hunk
-1
hunk
-2
hunk
-3

and which choice we make would affect what "subpatches" the user can decide
upon.  For example, if the user wants to keep the "adds" and leave out the
"subtracts", he'll either get

a
b
c
1
2
3

or

1
2
3
a
b
c

So it's not quite clear how to go about this.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list