Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317371

Summary: Synchronize: Outgoing change found despite all changes pushed previously
Product: [Technology] EGit Reporter: Matthias Sohn <matthias.sohn>
Component: UIAssignee: Matthias Sohn <matthias.sohn>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dariusz.luksza, mn, robin, stefan.lay
Version: 0.9.0   
Target Milestone: 2.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 317411    
Bug Blocks:    
Attachments:
Description Flags
Synchronize-SelectSynchronize.png
none
Synchronize-Dialog.png none

Description Matthias Sohn CLA 2010-06-19 18:21:06 EDT
- unzip bare repo HelloWorld.git attached to bug 317369

from EGit
- clone it again to HelloWorld-fred
- import project

- on HelloWorld-fred select Team -> Synchronize
- source : local .git, HEAD
- destination: origin, master
- no changes found, good :-)
- in HelloWorld-fred change the hello text to "Hello Git world - Fred!" and commit this change
- again run Team > Synchronize
- the change we committed is shown as outgoing change and the delta is what we expect
- select synchronize from Synchronize View toolbar (Synchronize-SelectSynchronize.png)
- Git > next
- the dialog (Synchronize-Dialog.png) shows HelloWorld-fred and HelloWorld-hugo but not the upstream HelloWorld
- Next and Finish buttons are disabled ??? Dead end ???
- ok here we are stuck

- from HelloWorld-fred Team > Push to push the change we committed to upstream
  origin
- select configure remote repository origin > next
- Add all branches spec > Next > Finish 
- our change reached upstream HelloWorld.git

- from HelloWorld-fred project Team > Synchronize to see that there are no changes anymore (that's what I would expect)
- still there is an outgoing change and it's the one we pushed few minutes before ??? Something is wrong here
Comment 1 Matthias Sohn CLA 2010-06-19 18:22:01 EDT
Created attachment 172279 [details]
Synchronize-SelectSynchronize.png
Comment 2 Matthias Sohn CLA 2010-06-19 18:22:26 EDT
Created attachment 172280 [details]
Synchronize-Dialog.png
Comment 3 Dariusz Luksza CLA 2010-06-19 20:23:30 EDT
(In reply to comment #0)
> - on HelloWorld-fred select Team -> Synchronize
> - source : local .git, HEAD
> - destination: origin, master
> - no changes found, good :-)
> - in HelloWorld-fred change the hello text to "Hello Git world - Fred!" and
> commit this change
> - again run Team > Synchronize
> - the change we committed is shown as outgoing change and the delta is what we
> expect
> - select synchronize from Synchronize View toolbar
> (Synchronize-SelectSynchronize.png)
> - Git > next
> - the dialog (Synchronize-Dialog.png) shows HelloWorld-fred and HelloWorld-hugo
> but not the upstream HelloWorld
> - Next and Finish buttons are disabled ??? Dead end ???
> - ok here we are stuck

Yes, you stuck ... in second column you must select branch name with one you want sychronize. Then finish button should enabled.

Rest of this scenario I'll inspect tomorrow morning.
Comment 4 Dariusz Luksza CLA 2010-06-20 05:50:42 EDT
(In reply to comment #0)
> - from HelloWorld-fred project Team > Synchronize to see that there are no
> changes anymore (that's what I would expect)
> - still there is an outgoing change and it's the one we pushed few minutes
> before ??? Something is wrong here

In deed there is something wrong but I don't think that this is a problem in Synchronization view. First of all I've check using CGit what diff should look like. In project HelloWorld-fred I've run:

$ git diff HEAD..origin/master

and got same diff as in Synchronize view. Secondly I've check on with commit points refs/remotes/origin/master and got: b8551543c5925efca69fb74fc048afb0d10c8bf7 with is name of previous commit. It seams that this is a but in EGit/JGit because after push operation they don't move pointer in refs/remotes/origin/master
Comment 5 Matthias Sohn CLA 2010-06-21 04:21:05 EDT
(In reply to comment #3)
> (In reply to comment #0)
> > - on HelloWorld-fred select Team -> Synchronize
> > - source : local .git, HEAD
> > - destination: origin, master
> > - no changes found, good :-)
> > - in HelloWorld-fred change the hello text to "Hello Git world - Fred!" and
> > commit this change
> > - again run Team > Synchronize
> > - the change we committed is shown as outgoing change and the delta is what we
> > expect
> > - select synchronize from Synchronize View toolbar
> > (Synchronize-SelectSynchronize.png)
> > - Git > next
> > - the dialog (Synchronize-Dialog.png) shows HelloWorld-fred and HelloWorld-hugo
> > but not the upstream HelloWorld
> > - Next and Finish buttons are disabled ??? Dead end ???
> > - ok here we are stuck
> 
> Yes, you stuck ... in second column you must select branch name with one you
> want sychronize. Then finish button should enabled.

This is not obvious, maybe the dialog should come up with a reasonable default branch already preselected ? E.g. for local .git preselect HEAD and for origin preselect master branch or even better if defined use the remote HEAD (refs/remotes/origin/HEAD) which is pointing to the branch the remote repository considers to be its default branch [1].

In a similar way the alternate dialog coming up on "Team" > "Synchronize..." should also do the same preselection. BTW why do we need two different dialogs here ?

[1] http://www.kernel.org/pub/software/scm/git/docs/git-remote.html search for command "set-head".
Comment 6 Dariusz Luksza CLA 2010-06-21 06:40:19 EDT
(In reply to comment #5)
> This is not obvious, maybe the dialog should come up with a reasonable default
> branch already preselected ? E.g. for local .git preselect HEAD and for origin
> preselect master branch or even better if defined use the remote HEAD
> (refs/remotes/origin/HEAD) which is pointing to the branch the remote
> repository considers to be its default branch [1].
>
> In a similar way the alternate dialog coming up on "Team" > "Synchronize..."
> should also do the same preselection. BTW why do we need two different dialogs
> here ?

Yes, we can implement preselecting in both places. This should improve user experience.

I think that "Synchronize" (from Synchronization View menu) and "Team -> Synchornize..." has different nature. First one is a wizard where you can not only select source and destination branch, but also one or more repository that you want to synchronize. Second is a "simple" dialog window where you can only set source and destination points.

Thinks are getting more complicated when user select couple projects that are connected with different repositories and choose "Team -> Synchronize...". Currently we would show him as much synchronize dialogs as there are git repositories in his selection. This can be improved but for now I don't know how it can be done.

I think that it would be great, if we can have (some how) similar view in theres two places, so that user that knows how to use dialog from "Team" -> "Synchronize" would also know how to use "Synchronization wizard". Any ideas how we can achieve that ?
Comment 7 Matthias Sohn CLA 2010-06-21 06:56:56 EDT
(In reply to comment #4)
> (In reply to comment #0)
> > - from HelloWorld-fred project Team > Synchronize to see that there are no
> > changes anymore (that's what I would expect)
> > - still there is an outgoing change and it's the one we pushed few minutes
> > before ??? Something is wrong here
> 
> In deed there is something wrong but I don't think that this is a problem in
> Synchronization view. First of all I've check using CGit what diff should look
> like. In project HelloWorld-fred I've run:
> 
> $ git diff HEAD..origin/master
> 
> and got same diff as in Synchronize view. Secondly I've check on with commit
> points refs/remotes/origin/master and got:
> b8551543c5925efca69fb74fc048afb0d10c8bf7 with is name of previous commit. It
> seams that this is a but in EGit/JGit because after push operation they don't
> move pointer in refs/remotes/origin/master

If I run
$ git pull origin
after pushing the change to the upstream HelloWorld.git and then re-run synchronize on HelloWorld-fred I get the expected result : "No changes found."
So it seems pushing a change does not update the corresponding remote tracking branch in HelloWorld-fred.

I tried the same scenario using msysgit and there push does also update the corresponding remote tracking branch. So it seems this is a bug in egit/jgit.
I created bug 317411 to track this problem.
Comment 8 Mykola Nikishov CLA 2012-03-03 11:12:10 EST
[Batch change] Remove passed Target Milestones

If anyone on CC list is going to fix/implement this, feel free to assign a new, post-1.3/2.0, target milestone.
Comment 9 Robin Stocker CLA 2012-12-16 09:36:09 EST
This should now be fixed in 2.2 as part of bug 317411.