Hi all, On Monday 13 April 2009 18:10:12 Ashley Moran wrote: > Just wondering, how feasible would a patch type that adjusts only the > spaces (and/or tabs) in a line be?
My gut feeling is that a patch type for changing indentation (initial whitespace) would be quite doable. Then you can tell darcs that those patches don't conflict with hunk patches that leave the whitespace intact. > So I was wondering, would it be possible for darcs to have a patch > type that could change whitespace only, allowing the merge of, say, > patches trying to change: > "blah blah blah" > > to: > "blah blah blah" > > and: > "blah BLAH blah" > > the result being: > > "blah BLAH blah" But that's harder, because we can see that the second white space sequence in the third line is 'the same' as the second white space sequence in the first. But how can we define this sameness in a computer program? One could simply use a numeric index (like 'the second sequence' here). Such whitespace patches only commutes with hunk patches that do not insert or remove any whitespace sequences. Any patch that inserts whitespace sequences or removes them would be a hunk patch. Can anyone see a problem with this approach? A problem might be that a whitespace patch that goes from " zip a b" to "zip a b" would commute with a hunk patch that goes from " zip a b" to " unsafePerformIO $ exitFailure", while intuitively I think the commute should fail because the hunk patch changes the line to be a semantically completely different line, even if it leaves the number of whitespace sequences intact. Regards, Reinier
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
