Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363173 - Advanced synchronization a no-op with certain destination references
Summary: Advanced synchronization a no-op with certain destination references
Status: ASSIGNED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Dariusz Luksza CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 350804 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-08 09:15 EST by R Shapiro CLA
Modified: 2013-01-31 15:03 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description R Shapiro CLA 2011-11-08 09:15:56 EST
EGit version: 1.2.0.201111080302

References created by svn bridging cannot be used as the 'Destination' of an advanced synchronization operation. I know that jgit/egit does not support bridging itself, but once the references are created with command-line Git, they look like any other remote reference, just a file whose content is a SHA.

These references are listed in the dialog that comes up via

  Team -> Advanced -> Synchronize

and also in the 'Destination' pull-down menu of the the 'Synchronize' dialog that comes up if "Custom..." is selected in the initial dialog.

In either case, selecting such a destination is a no-op: no synchronization is performed and no error is reported.


Steps to replicate:

1. Create a Git bridge to any standard SVN repository using command line Git.
2. Verify the bridged 'trunk' reference in command line Git by running 'git log refs/remotes/trunk'.
3. In an Eclipse workspace that includes the bridge clone, right-click any project in and run Team -> Advanced -> Synchronize.
4. Select any bridge reference that appears in the initial list, ie, any item under refs/remotes.  Observe that nothing happens.
5. Repeat step (4) but this time select the "Custom..." option.
6. In the dialog that pops up, click and hold in the 'Destination' column and when the pull-down menu appears, select 'refs/remotes/trunk'.
7. Click 'Finish'.  Observe that nothing happens.
Comment 1 R Shapiro CLA 2011-11-08 09:34:15 EST
Note also that the egit  'Compare With'  operation works with bridge references.  For example if I right-click a file, select 'Compare With -> Branch, Tag or Reference...', the bridge references appear under 'Remote Tracking', as expected, and selecting any of these entries does the diff, as expected.

So in general egit/jigit seem fine with using SVN bridge references like any other Git reference.
Comment 2 Dariusz Luksza CLA 2011-11-09 13:50:41 EST
It turns out that synchronize assumes that all remote branches belongs to remote repository (eg. refs/remotes/origin/master). Looks like this assumption isn't true for repositories created by git-svn bridge.

In couple of minutes I'll push change set for review that should fix this bug.
Comment 3 Dariusz Luksza CLA 2011-11-09 14:01:13 EST
Change set 4582[1] is fixing this issue

[1] http://egit.eclipse.org/r/4582
Comment 4 R Shapiro CLA 2011-11-13 08:55:21 EST
As Dariusz notes, the bug (and it really is a bug) is in the assumption that any reference under refs/remotes must be a remote-reference:  Git does not require references under .git/refs/remotes to have this form.

Testing his fix is very simple: just add a file to .git/refs/remotes called "advance-sync-test"  whose contents is a valid SHA, then run advanced synchronization and select that reference.  Assuming this works, run advanced synchronization on a true remote-reference to ensure that still works.

That's it.
Comment 5 R Shapiro CLA 2011-11-15 09:30:27 EST
Let me emphasize again just how trivial it is to test this:

1) cp .git/refs/remotes/origin/master .git/refs/remotes/test-363173

2) Run Team - Advanced -> Synchronize  -> refs/remotes/test-363173.


That's it. The whole process should take under a minute.
Comment 6 Dariusz Luksza CLA 2011-11-18 18:34:03 EST
*** Bug 350804 has been marked as a duplicate of this bug. ***