Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328551

Summary: Merge algorithm instead of marking a conflict removed conflicting line
Product: [Technology] JGit Reporter: Dariusz Luksza <dariusz.luksza>
Component: JGitAssignee: Christian Halstrick <christian.halstrick>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: caniszczyk, christian.halstrick, christian.halstrick, matthias.sohn
Version: 0.9.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Dariusz Luksza CLA 2010-10-24 14:42:24 EDT
Scenario:
0. Create a project and share it using EGit; add example file eg:
<pre>
public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {
	// TODO Auto-generated method stub

    }

}
</pre>
1. Commit changes using EGit
2. Create new branch named 'feature' and check out it
3. Checkout master branch
4. Create new branch named 'bug-fix' and check out it
5. Replace line '// TODO Auto-generated method stub' with eg. 'System.out.println("jgit merge bug");'
6. Commit changes
7. Checkout master branch and merge it with 'bug-fix' - right now everything is OK
8. Checkout 'feature' branch
9. Remove line '// TODO Auto-generated method stub'
10. Commit changes
11. Checkout master branch
12. Merge 'feature' - here we should have a conflict but instead of it line 8 (the one that had System.out in 'bug-fix' branch and was removed in 'feature' branch) was removed during merge.

I test this scenario using cgit and it produce proper conflict information.
Comment 1 Christian Halstrick CLA 2010-10-27 09:43:46 EDT
this sound like a severe bug. I'll test this now.
Comment 2 Christian Halstrick CLA 2010-10-28 16:23:00 EDT
This was indeed a bug in the merge algorithm which was introduced during some "optimizations". It is fixed now with commit beeb1f6d08a907493b3660837fd4059322ca969a. The next nightly builds should contain this.
Comment 3 Christian Halstrick CLA 2010-10-28 16:25:16 EDT
Thats fixed now.