[xwiki-devs] Diff module
Hi devs, Since there is not official standard for diff/merge API I started to write a simple one. Yo can find it on https://github.com/xwiki/xwiki-commons/tree/feature-diff/xwiki-commons-core/.... The first use case for it is to provide a diff/merge API for the Extension Manager XAR merging conflict resolution UI. It is mostly inspired from JRCS/java-diff-utils APIs and implemented using java-diff-utils (http://code.google.com/p/java-diff-utils/) for the diff and JDiff (http://www.qarks.com/web/en/products_jdiff.html) for the multiline String merge. Theses are the most active independent libraries I could find so far and it's not really what I would call active library usually... Would be nice to get some comments/suggestions on the API. For the implementation side if you know some good diff/merge tool I would be glad to get some other suggestions. I took a quick look at various EDIs which obviously have this kind of tools but what I could find is not really designed to be used easily outside of the EDI for which they have been designed. Either its very tied to the EDI itself or it's generic enough but trigger a whole bunch of dependencies while we would use like 1% of the total. Here are the various features I'm looking for in an ideal library: * good 3 ways merge ("good" is not a detail, applying a patch on the third version does not always give very good results) * diff/patch API * support of single line in 3 ways merge and diff Thanks, -- Thomas Mortagne
Hi Thomas, There is the DiffPlugin which is used by the Diff code in the XWiki and Document classes. This API can also be used by applications. I included some HTML display APIs in this DiffPlugin If you are moving to a diff component it would make sense to migrate this code to the new component. Ludovic 2012/5/15 Thomas Mortagne <[email protected]>
Hi devs,
Since there is not official standard for diff/merge API I started to write a simple one. Yo can find it on
https://github.com/xwiki/xwiki-commons/tree/feature-diff/xwiki-commons-core/... .
The first use case for it is to provide a diff/merge API for the Extension Manager XAR merging conflict resolution UI.
It is mostly inspired from JRCS/java-diff-utils APIs and implemented using java-diff-utils (http://code.google.com/p/java-diff-utils/) for the diff and JDiff (http://www.qarks.com/web/en/products_jdiff.html) for the multiline String merge. Theses are the most active independent libraries I could find so far and it's not really what I would call active library usually...
Would be nice to get some comments/suggestions on the API.
For the implementation side if you know some good diff/merge tool I would be glad to get some other suggestions. I took a quick look at various EDIs which obviously have this kind of tools but what I could find is not really designed to be used easily outside of the EDI for which they have been designed. Either its very tied to the EDI itself or it's generic enough but trigger a whole bunch of dependencies while we would use like 1% of the total.
Here are the various features I'm looking for in an ideal library: * good 3 ways merge ("good" is not a detail, applying a patch on the third version does not always give very good results) * diff/patch API * support of single line in 3 ways merge and diff
Thanks, -- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
On Tue, May 15, 2012 at 9:13 PM, Ludovic Dubost <[email protected]> wrote:
Hi Thomas,
There is the DiffPlugin which is used by the Diff code in the XWiki and Document classes. This API can also be used by applications.
I included some HTML display APIs in this DiffPlugin
If you are moving to a diff component it would make sense to migrate this code to the new component.
I'm doing something more generic than a String diff (look at the current API). And HTML presentation of the diff iss presentation stuff and are not going to be in this API. So the API I have already cover more that what is in the diff plugin (minus the HTML stuff of course).
Ludovic
2012/5/15 Thomas Mortagne <[email protected]>
Hi devs,
Since there is not official standard for diff/merge API I started to write a simple one. Yo can find it on
https://github.com/xwiki/xwiki-commons/tree/feature-diff/xwiki-commons-core/... .
The first use case for it is to provide a diff/merge API for the Extension Manager XAR merging conflict resolution UI.
It is mostly inspired from JRCS/java-diff-utils APIs and implemented using java-diff-utils (http://code.google.com/p/java-diff-utils/) for the diff and JDiff (http://www.qarks.com/web/en/products_jdiff.html) for the multiline String merge. Theses are the most active independent libraries I could find so far and it's not really what I would call active library usually...
Would be nice to get some comments/suggestions on the API.
For the implementation side if you know some good diff/merge tool I would be glad to get some other suggestions. I took a quick look at various EDIs which obviously have this kind of tools but what I could find is not really designed to be used easily outside of the EDI for which they have been designed. Either its very tied to the EDI itself or it's generic enough but trigger a whole bunch of dependencies while we would use like 1% of the total.
Here are the various features I'm looking for in an ideal library: * good 3 ways merge ("good" is not a detail, applying a patch on the third version does not always give very good results) * diff/patch API * support of single line in 3 ways merge and diff
Thanks, -- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On Wed, May 16, 2012 at 8:45 AM, Thomas Mortagne <[email protected]> wrote:
On Tue, May 15, 2012 at 9:13 PM, Ludovic Dubost <[email protected]> wrote:
Hi Thomas,
There is the DiffPlugin which is used by the Diff code in the XWiki and Document classes. This API can also be used by applications.
I included some HTML display APIs in this DiffPlugin
If you are moving to a diff component it would make sense to migrate this code to the new component.
I'm doing something more generic than a String diff (look at the current API). And HTML presentation of the diff iss presentation stuff and are not going to be in this API.
So the API I have already cover more that what is in the diff plugin (minus the HTML stuff of course).
As for the Document diff, no it's not using this plugin. At least Document#getContentDiff use JRCS API.
Ludovic
2012/5/15 Thomas Mortagne <[email protected]>
Hi devs,
Since there is not official standard for diff/merge API I started to write a simple one. Yo can find it on
https://github.com/xwiki/xwiki-commons/tree/feature-diff/xwiki-commons-core/... .
The first use case for it is to provide a diff/merge API for the Extension Manager XAR merging conflict resolution UI.
It is mostly inspired from JRCS/java-diff-utils APIs and implemented using java-diff-utils (http://code.google.com/p/java-diff-utils/) for the diff and JDiff (http://www.qarks.com/web/en/products_jdiff.html) for the multiline String merge. Theses are the most active independent libraries I could find so far and it's not really what I would call active library usually...
Would be nice to get some comments/suggestions on the API.
For the implementation side if you know some good diff/merge tool I would be glad to get some other suggestions. I took a quick look at various EDIs which obviously have this kind of tools but what I could find is not really designed to be used easily outside of the EDI for which they have been designed. Either its very tied to the EDI itself or it's generic enough but trigger a whole bunch of dependencies while we would use like 1% of the total.
Here are the various features I'm looking for in an ideal library: * good 3 ways merge ("good" is not a detail, applying a patch on the third version does not always give very good results) * diff/patch API * support of single line in 3 ways merge and diff
Thanks, -- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
-- Thomas Mortagne
On Wed, May 16, 2012 at 8:48 AM, Thomas Mortagne <[email protected]> wrote:
On Wed, May 16, 2012 at 8:45 AM, Thomas Mortagne <[email protected]> wrote:
On Tue, May 15, 2012 at 9:13 PM, Ludovic Dubost <[email protected]> wrote:
Hi Thomas,
There is the DiffPlugin which is used by the Diff code in the XWiki and Document classes. This API can also be used by applications.
I included some HTML display APIs in this DiffPlugin
If you are moving to a diff component it would make sense to migrate this code to the new component.
I'm doing something more generic than a String diff (look at the current API). And HTML presentation of the diff iss presentation stuff and are not going to be in this API.
So the API I have already cover more that what is in the diff plugin (minus the HTML stuff of course).
As for the Document diff, no it's not using this plugin. At least Document#getContentDiff use JRCS API.
Actually looks like getDifferencesAsHTML is used directly by the UI and Document#getContentDiff does not seems very used. In any case there is too completely different things here for the same thing as well as a mixup between base API and UI which is not very nice.
Ludovic
2012/5/15 Thomas Mortagne <[email protected]>
Hi devs,
Since there is not official standard for diff/merge API I started to write a simple one. Yo can find it on
https://github.com/xwiki/xwiki-commons/tree/feature-diff/xwiki-commons-core/... .
The first use case for it is to provide a diff/merge API for the Extension Manager XAR merging conflict resolution UI.
It is mostly inspired from JRCS/java-diff-utils APIs and implemented using java-diff-utils (http://code.google.com/p/java-diff-utils/) for the diff and JDiff (http://www.qarks.com/web/en/products_jdiff.html) for the multiline String merge. Theses are the most active independent libraries I could find so far and it's not really what I would call active library usually...
Would be nice to get some comments/suggestions on the API.
For the implementation side if you know some good diff/merge tool I would be glad to get some other suggestions. I took a quick look at various EDIs which obviously have this kind of tools but what I could find is not really designed to be used easily outside of the EDI for which they have been designed. Either its very tied to the EDI itself or it's generic enough but trigger a whole bunch of dependencies while we would use like 1% of the total.
Here are the various features I'm looking for in an ideal library: * good 3 ways merge ("good" is not a detail, applying a patch on the third version does not always give very good results) * diff/patch API * support of single line in 3 ways merge and diff
Thanks, -- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
-- Thomas Mortagne
-- Thomas Mortagne
Hi Thomas, On May 15, 2012, at 5:49 PM, Thomas Mortagne wrote:
Hi devs,
Since there is not official standard for diff/merge API I started to write a simple one. Yo can find it on https://github.com/xwiki/xwiki-commons/tree/feature-diff/xwiki-commons-core/....
The first use case for it is to provide a diff/merge API for the Extension Manager XAR merging conflict resolution UI.
It is mostly inspired from JRCS/java-diff-utils APIs and implemented using java-diff-utils (http://code.google.com/p/java-diff-utils/) for the diff and JDiff (http://www.qarks.com/web/en/products_jdiff.html) for the multiline String merge. Theses are the most active independent libraries I could find so far and it's not really what I would call active library usually...
Would be nice to get some comments/suggestions on the API.
Similar to Ludovic's question, I'd like to ensure that we can refactor our current diff code to use this new API in the future.
For the implementation side if you know some good diff/merge tool I would be glad to get some other suggestions. I took a quick look at various EDIs which obviously have this kind of tools but what I could find is not really designed to be used easily outside of the EDI for which they have been designed. Either its very tied to the EDI itself or it's generic enough but trigger a whole bunch of dependencies while we would use like 1% of the total.
Here are the various features I'm looking for in an ideal library: * good 3 ways merge ("good" is not a detail, applying a patch on the third version does not always give very good results) * diff/patch API * support of single line in 3 ways merge and diff
What happens if we can't find a library? How hard is it to implement a 3-way diff? Do we have other options? Thanks -Vincent
On Fri, May 18, 2012 at 6:54 PM, Vincent Massol <[email protected]> wrote:
Hi Thomas,
On May 15, 2012, at 5:49 PM, Thomas Mortagne wrote:
Hi devs,
Since there is not official standard for diff/merge API I started to write a simple one. Yo can find it on https://github.com/xwiki/xwiki-commons/tree/feature-diff/xwiki-commons-core/....
The first use case for it is to provide a diff/merge API for the Extension Manager XAR merging conflict resolution UI.
It is mostly inspired from JRCS/java-diff-utils APIs and implemented using java-diff-utils (http://code.google.com/p/java-diff-utils/) for the diff and JDiff (http://www.qarks.com/web/en/products_jdiff.html) for the multiline String merge. Theses are the most active independent libraries I could find so far and it's not really what I would call active library usually...
Would be nice to get some comments/suggestions on the API.
Similar to Ludovic's question, I'd like to ensure that we can refactor our current diff code to use this new API in the future.
Depends which code, refactoring the one returning JRCF API directly is useless. For all the rest in general anyway all we have is very simple diff on lines of String which is not very hard to put in a List<String>... Now I doubt it bring much to refactor them. Again all we have is very simple diff, we don't have anything to merge in old API.
For the implementation side if you know some good diff/merge tool I would be glad to get some other suggestions. I took a quick look at various EDIs which obviously have this kind of tools but what I could find is not really designed to be used easily outside of the EDI for which they have been designed. Either its very tied to the EDI itself or it's generic enough but trigger a whole bunch of dependencies while we would use like 1% of the total.
Here are the various features I'm looking for in an ideal library: * good 3 ways merge ("good" is not a detail, applying a patch on the third version does not always give very good results) * diff/patch API * support of single line in 3 ways merge and diff
What happens if we can't find a library?
We do it ourself.
How hard is it to implement a 3-way diff?
I don't think it's very hard. Plus we can look at what JDiff guys did for String lines which is not much different from any list of anything (at least for not much detail than the "line" is added/removed/modified which is already nice). We already do it ourself for anything but String right now in Extension Manager anyway. Whatever the object type it's always more or less the same idea.
Do we have other options?
I don't see any. Someone has to do it, if we can't find a library we'll do it. The alternative is to not try to merge anything basically and let the user always merge any modification by hand even when it's simple things which would be a pain IMO.
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
participants (3)
-
Ludovic Dubost -
Thomas Mortagne -
Vincent Massol