Community
Participate
Working Groups
When creating a new synchronized project, if the remote directory already contains .git, then the initial sync will fail with: org.eclipse.ptp.rdt.sync.git.core.RemoteSyncException: at org.eclipse.ptp.rdt.sync.git.core.GitRemoteSyncConnection.syncLocalToRemote(GitRemoteSyncConnection.java:575) at org.eclipse.ptp.rdt.sync.git.core.GitServiceProvider.synchronize(GitServiceProvider.java:257) at org.eclipse.ptp.internal.rdt.sync.core.ResourceChangeListener$SynchronizeJob.run(ResourceChangeListener.java:73) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: org.eclipse.ptp.rdt.sync.git.core.RemoteExecutionException: Remote merge failed with message: at org.eclipse.ptp.rdt.sync.git.core.GitRemoteSyncConnection.syncLocalToRemote(GitRemoteSyncConnection.java:576) ... 3 more org.eclipse.ptp.rdt.sync.git.core.RemoteSyncException: at org.eclipse.ptp.rdt.sync.git.core.GitRemoteSyncConnection.syncLocalToRemote(GitRemoteSyncConnection.java:575) at org.eclipse.ptp.rdt.sync.git.core.GitServiceProvider.synchronize(GitServiceProvider.java:257) at org.eclipse.ptp.internal.rdt.sync.core.ResourceChangeListener$SynchronizeJob.run(ResourceChangeListener.java:73) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: org.eclipse.ptp.rdt.sync.git.core.RemoteExecutionException: Remote merge failed with message: fatal: 'merge' is not possible because you have unmerged files. Please, fix them up in the work tree, and then use 'git add/rm <file>' as appropriate to mark resolution and make a commit, or use 'git commit -a'. at org.eclipse.ptp.rdt.sync.git.core.GitRemoteSyncConnection.syncLocalToRemote(GitRemoteSyncConnection.java:576) ... 3 more
The sync also fails if the remote directory contains .settings. Even though I added it to FileFilter, it still seems to be trying to sync. Perhaps becuase it is a directory and not a file?
Yes, the code in the FileFilter is incorrect: fileName.endsWith(".settings") Since we are filtering a directory, we have to check for .settings anywhere in the file name, not just at the end.
I changed String#endsWith() to #equals() for .project and .cproject and #startsWith() for .settings. This seems to do the job now. The .git issue still remains though.
I think these merge conflicts could be legitimate. It depends on the state of the remote project. Sync does not and should not overwrite the git information already present in .git. So if the repo was already in the middle of a merge conflict, that will not change. As another example, a new managed project will cause a merge conflict if the remote already has a Makefile, because it is trying to overwrite the Makefile already there. If I create a new empty project, however, and point it to a project already containing a .git, it works fine. So, other than finding a way to handle merge conflicts better, I think this may not be a bug. Can you give more details about the contents of the existing project?
I'm sure the merge conflicts are correct. However, when creating a new sync project, it should at least check to see if the remote directory already contains .git and either a) refuse to sync or b) remove the .git (after asking the user to confirm). The presence of a .git directory either indicates the project was synchronized in the past, or was cloned from another repository. I don't think you want to keep the Git information in either of these cases.
(In reply to comment #5) > The presence of a .git directory either indicates the > project was synchronized in the past, or was cloned from another repository. I > don't think you want to keep the Git information in either of these cases. I think we should keep the Git information if it was clone from another repository. At the moment we cannot use that information very well, but in the long run it should be possible to keep the Git repository information (as revision control system) and have the synchronized information not interfere (e.g. separate branch).
Sync'ing is now done using a separate Git directory (.ptp-sync). So this is no longer a problem (.git directories are ignored).