Page 1 of 1

rule-based line expansion

Posted: Fri Jan 09, 2009 11:20 pm
by clicktoy
Working with perforce and branches, I often find myself manually merging vcproj files.

If both myself and the other branch modified the same line, I get a conflict. With lines like "AdditionalIncludePath", they have a regular delimiter which essentially functions like "line breaks". If I could flag certain lines in certain file times as expandable, I could insure data within that line was both correctly merged and for future ease of reading, correctly sorted.

I envision this as the typical little "+" beside matching lines in a file, that when expanded, turn each subcompent into their own "virtual" lines in CompareIt. I could then merge them with the same ease I have with full line/block diffs.

I hope that made sense. CompareIt is fantastic. I wave it in front of every coder I ever encounter and rave of it's diffing superiority. (almost sounds like I'm swearing! :)

and Merge anchors are awesome! :)
Great job.

Posted: Wed Jan 14, 2009 8:23 am
by grigsoft
I am sorry for the delay with the answer - I was on vacation.
Thank you for suggestion, although I doubt I can integrate this into CompareIt. But this can definitely be done be some external program, filtering file before and after CompareIt. Currently external converter can only be used to convert file before comparison, but I was going to add a support for 2-way converters: once configured, it will convert file before comparison, and save it back after editing, if any.

2way file converters

Posted: Wed Jan 14, 2009 4:50 pm
by clicktoy
That's a very simple and practical solution. It would work just fine.. the conversion could easily put text begin/end anchors around any expanded lines for clairity. and the converter could be coded in any language you want. I like it! :)