Community
Participate
Working Groups
I did a merge with built-in git support in Neon and I get poor results quite often. Two files with methods that are repeated like: public XYZ newXYZ() { return XYZ.newInstance(5); } public XYZ newXYZ() { return XYZ.newInstance(5); } This shouldn't be possible in a merge of two Java files that both compile, and yet somehow it didn't match these up correctly. Unfortunately, I can't post our source code for legal reasons, but there are many, many examples of this in any big merge (a few hundred files). I honestly don't think it's worth working on the old diff tools for merging. Instead it would be better if there was a new Java-aware merge tool for git that used the structure of the code to merge things. Moving a method, changing spacing or comment wrapping or other unimportant differences shouldn't be flagged as complicated conflicts. Instead the diff tool should look at class members and see what changed in terms of members and then only diff the code inside each method with the corresponding method in the other file. Right now, methods can be split when diffing in really ugly and weird ways that make it very hard to do merges. I think a smart merger for Java could really make everyone's life a LOT easier and it would be a unique Eclipse advantage. Although I'm too swamped to work on such a thing, I don't think this is as hard as it sounds. If both files compile, it should be possible to compare the members for +/-/~ and to use the existing diff code inside each method. Thanks for listening. Jon -- Configuration Details -- Product: Eclipse 4.6.3.20170314-1500 (org.eclipse.epp.package.java.product)Installed Features: org.eclipse.jdt 3.12.3.v20170301-0400 Versioning Plugin: org.eclipse.platform 4.6.3.v20170301-0400
I agree this would improve merging for Java sources, though there are many other languages and we need someone who has time to work on a language specific merge algorithm