Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Merge tool - repository merge view shows non-conflicting files(Trying to understand what the structure compare view in the merge tool is showing me.)
Merge tool - repository merge view shows non-conflicting files [message #940301] Thu, 11 October 2012 14:06 Go to next message
James Scott is currently offline James ScottFriend
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 #951364 is a reply to message #940301] Sat, 20 October 2012 17:19 Go to previous messageGo to next message
James Scott is currently offline James ScottFriend
Messages: 4
Registered: October 2012
Junior Member
I'm getting a little closer to figuring this out...the same list of files shows up when I set * text=auto in .gitattributes and do the following commands:
del .git\index (did I mention this is on Windows?)
git reset
git status


Those commands are based on what I read in the gitattributes doc about normalizing line endings. (can't link, not enough posts)

So I guess something is funny about the line endings in those files, though I can't quite figure out what. I don't think they're mixed LF/CRLF.

I'm seeing something similar with other files that are checked in with LF line endings - the files in my Eclipse workspace have CRLF endings, but if I check out with command-line git, the files in the workspace still have LF. So maybe there's something still wonky with EGit/JGit handling of EOL chars or autocrlf. I don't think I've moved off the default config for core.autocrlf, but it seems that files with LF line ends get checked out as CRLF when I use 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 Go to previous messageGo to next message
James Scott is currently offline James ScottFriend
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 #952521 is a reply to message #952338] Sun, 21 October 2012 14:42 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
Last time I checked, which was some time ago, JGit did not yet support .gitattributes. It does support core.autocrlf, at least in 2.2.
Re: Merge tool - repository merge view shows non-conflicting files [message #953114 is a reply to message #952521] Mon, 22 October 2012 02:21 Go to previous messageGo to next message
James Scott is currently offline James ScottFriend
Messages: 4
Registered: October 2012
Junior Member
R Shapiro wrote on Sun, 21 October 2012 10:42
Last 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.
Re: Merge tool - repository merge view shows non-conflicting files [message #974199 is a reply to message #953114] Tue, 06 November 2012 23:17 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Did you try with a recent nightly build ? There were a couple of patches recently to fix auto.crlf support.
Previous Topic:EGit imported repositories are not connected to Git once added
Next Topic:Move local git repository
Goto Forum:
  


Current Time: Tue Mar 19 07:50:45 GMT 2024

Powered by FUDForum. Page generated in 0.02515 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top