Merge tool - repository merge view shows non-conflicting files [message #940301] |
Thu, 11 October 2012 14:06 |
James Scott Messages: 4 Registered: October 2012 |
Junior Member |
|
|
In EGit 2.1.0.201209190230-r on Juno 20120920-0800, I'm seeing non-conflicting files show up in the structure compare view when I invoke the merge tool. These files are not dirty in the working copy, and I can't find any pattern as to why they're showing up.
Here's what I'm doing:
1. Clone a remote repository twice, to two different projects in my workspace. We'll call them Project 1 and Project 2. Check out the same branch in both projects.
2. In Project 1, edit a source file and commit it. Push the commit to the remote.
3. In Project 2, make a conflicting edit in the same source file, commit and push. Push is rejected - non-fast-forward.
4. In Project 2, pull the remote branch. Conflicts are noted.
5. Start the merge tool. I've tried both the "Use Workspace Version" and "Use HEAD" options and they seem to generate the same result: Eclipse shows a dialog that appears to iterate over each file in the repo (we have about 17000 files, so this takes a while), then it shows the Repository Merge view with a tree of files in the Structure Compare view. Most of these don't show any changes when I double-click them, nor would I expect them to, since they didn't change. They do not show as changed in the Git Staging view.
6. I resolve the conflict and commit, then push. All OK.
If I open up Git GUI (Windows) on the project, the files that showed up in the Repository Merge view show as unstaged changes. When I inspect them, it looks like all the lines in the files are removed and added. They still don't show up in the Eclipse Git Staging view, though. If I do a hard reset through Eclipse, they disappear from the Git GUI unstaged changes view.
Is this a known issue in EGit?
|
|
|
|
Re: Merge tool - repository merge view shows non-conflicting files [message #952338 is a reply to message #951364] |
Sun, 21 October 2012 11:16 |
James Scott Messages: 4 Registered: October 2012 |
Junior Member |
|
|
After fiddling around with this for most of yesterday, I'm pretty sure EGit 2.1 still has a bug in its handling of line endings. At the very least, it behaves differently than msysgit 1.7.10 does.
I'm not sure I understand it well enough to submit a bug report, but here's generally what I observed:
1. If I reset my workspace in Eclipse, close Eclipse, and then open Git GUI on the project folder or run git status from command-line git, I would see several files listed as "modified not staged". The modifications appeared to be line-ending related when viewed in Git GUI - generally speaking, the diff would show a remove and re-add every line in the file
2. Closing Git GUI and opening Eclipse would show some of these files in the staging view, but not all.
3. I branched to fix these files - commit the changes that command-line git showed. I used command-line git to commit the changes. When I then tried to merge those changes back to my development branch in EGit, the merge failed with an error message of "merge failed" - no conflicts, it just didn't happen. No more detail appeared in the error log about what went wrong. I had to merge back to the dev branch using command-line git as well, which showed a couple of conflicts.
This may be related to handling files with mixed LF/CRLF line ends. This repo was ported from CVS, has been in development a long time on a number of platforms, and I don't doubt that we have some files with mixed line ends.
|
|
|
|
Re: Merge tool - repository merge view shows non-conflicting files [message #953114 is a reply to message #952521] |
Mon, 22 October 2012 02:21 |
James Scott Messages: 4 Registered: October 2012 |
Junior Member |
|
|
R Shapiro wrote on Sun, 21 October 2012 10:42Last time I checked, which was some time ago, JGit did not yet support .gitattributes. It does support core.autocrlf, at least in 2.2.
Autocrlf support has been around since 2.0, according to bug 301775 (still can't link, not enough posts). I don't think the problem is with .gitattributes, since I started seeing symptoms before I added the .gitattributes file. It went something like this:
1. Clone a repository and create a project using EGit.
2. Close eclipse and open Git GUI on the project dir
3. Git GUI reports a bunch of files modified. Diff on the files shows (in most cases) all lines changed. A few lines in each file show dark squares in the Git GUI diff view, mostly (but not exclusively) at the end of line.
My best guess is that there's something funky in EGit autocrlf support, perhaps with files that have mixed line endings. But I haven't pinned it down yet.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02515 seconds