Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328551 - Merge algorithm instead of marking a conflict removed conflicting line
Summary: Merge algorithm instead of marking a conflict removed conflicting line
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Christian Halstrick CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-24 14:42 EDT by Dariusz Luksza CLA
Modified: 2010-10-28 16:25 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.