Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317411 - Push does not update remote tracking branch with Synchronize view, "Push Branch...", "Push..."
Summary: Push does not update remote tracking branch with Synchronize view, "Push Bran...
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 major with 8 votes (vote)
Target Milestone: 2.2   Edit
Assignee: Robin Stocker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 333618 334031 337329 353286 395556 (view as bug list)
Depends on:
Blocks: 317371 328138
  Show dependency tree
 
Reported: 2010-06-21 05:35 EDT by Matthias Sohn CLA
Modified: 2012-12-16 09:25 EST (History)
24 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Sohn CLA 2010-06-21 05:35:26 EDT
used versions:
egit 062f4eebf2
jgit 33ae23b8b9
on helios 3.6.0.I20100520-1744

This was discovered while investigating bug 317371.

- unzip bare repo HelloWorld.git attached to bug 317369

from EGit
- clone it to HelloWorld-fred via file:///your/path/to/HelloWorld.git
- 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

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

- from HelloWorld-fred project Team > Synchronize 
- source : local .git, HEAD
- destination: origin, master
  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
- found that the SHA1 value in HelloWorld-fred/.git/refs/remotes/origin/master still points to the previous commit

-> so it looks like jgit is not updating the remote tracking branch here
Comment 1 zhoun CLA 2010-06-25 02:25:51 EDT
confirm this bug.
i have to fetch again after every push, to ensure the origin/master branch updated.
Comment 2 Chris Smart CLA 2010-07-12 01:39:22 EDT
We also came across this bug after fixing another (bug 317389 "Can't connect to any URI").

After a local commit, pushing to the remote host does not seem to update local repository (although the push does work correctly on the remote). That is, the local branch thinks it's ahead of origin by 1 commit, when in fact it is at the same level. A fetch from the Eclipse corrects this problem, as described by Matthias.

By contrast, a push to the remote master from the command line using the system's git command works correctly, and the history in Eclipse is updated straight away.

Eclipse Helios version 1.3.0.20100617-0520
eGit version 0.8.4
jGit version 0.8.4
Comment 3 Chris Smart CLA 2010-07-12 01:56:02 EDT
I can also confirm that this problem also exists on the latest nightly build as of 2010-07-12. Of course, I could be doing something wrong :-)

eGit version 0.9.0.201007091513
jGit version 0.9.0.201007090918
Comment 4 Chris Aniszczyk CLA 2011-01-12 10:02:29 EST
*** Bug 334031 has been marked as a duplicate of this bug. ***
Comment 5 Chris Aniszczyk CLA 2011-01-12 10:02:52 EST
Bumping issue severity
Comment 6 Severin Gehwolf CLA 2011-01-12 10:51:49 EST
This really isn't just a Windows XP bug :) I'm on Fedora.
Comment 7 Bernard Leach CLA 2011-02-17 16:25:28 EST
*** Bug 333618 has been marked as a duplicate of this bug. ***
Comment 8 Stefan Lay CLA 2011-02-21 09:21:34 EST
*** Bug 337329 has been marked as a duplicate of this bug. ***
Comment 9 Frank Jakop CLA 2011-03-02 02:10:42 EST
I can confirm this is still happening with JGit version 0.12.0.201102282021.
Comment 10 Robin Stocker CLA 2011-03-03 16:29:00 EST
After some investigation, I can say that the problem is not in JGit.

JGit updates the tracking branch just fine if you hand it the remote name (e.g. "origin") on push. I have a successful test case for PushCommand (will upload to Gerrit).

The problem is in EGit, which only hands the URI to the PushCommand. This can be seen in PushOperation, which only gets URIishes from the PushOperationSpecification that is passed to it.

I have a local change which changes the URIish to String in PushOperationSpecification, thus allowing it to contain a remote name. It works, but it's pretty hacky at this point.
Comment 11 Robin Stocker CLA 2011-05-14 05:42:03 EDT
The component of this bug should be changed to EGit, see this commit:

http://egit.eclipse.org/w/?p=jgit.git;a=commit;h=4fb185ab67bcea83c16855fc7e777faeb25ffd60
Comment 12 Matthias Sohn CLA 2011-05-22 04:07:47 EDT
moving this to EGit as Robin suggested
Comment 13 Marc Khouzam CLA 2011-06-27 23:15:49 EDT
We're seeing this problem every time we push to the CDT eclipse.org git repo.  I'm on Linux.  It is kind of annoying, although not blocking.
Comment 14 Jens Baumgart CLA 2011-07-05 11:50:59 EDT
Fix proposed: http://egit.eclipse.org/r/#change,3817
Comment 15 Matthias Sohn CLA 2011-07-06 16:58:40 EDT
merged as c6dd6790970fd5a030490260f4574585637a41cf
Comment 16 Matthias Sohn CLA 2011-08-02 07:19:40 EDT
*** Bug 353286 has been marked as a duplicate of this bug. ***
Comment 17 Robert Munteanu CLA 2011-08-02 07:51:54 EDT
The target milestone should be corrected to reduce confusion. This fix is not in 1.0 .
Comment 18 David Mansfield CLA 2012-03-01 14:24:54 EST
this bug is back in indigo sr2.  just updated yesterday.
Comment 19 Sergey Prigogin CLA 2012-03-01 14:34:44 EST
I'm also seeing it in EGit 2.0.0.201202261814.
Comment 20 David Mansfield CLA 2012-03-01 15:39:58 EST
forgot to mention my version details.  i have   

Eclipse EGit	1.3.0.201202151440-r	org.eclipse.egit.feature.group	Eclipse EGit

from indigo sr2.
Comment 21 Mykola Nikishov CLA 2012-03-03 11:12:15 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 22 Kamil Sobon CLA 2012-11-28 07:41:25 EST
What is a status of this issue ?
Are there plans to fix this bug ?
Comment 23 Robin Stocker CLA 2012-11-29 13:14:06 EST
Just to clarify: When using "Push to Upstream" from the team menu or the toolbar, it works (I'm using this every day).

So the remaining problem is that it does not work when pushing from the Synchronize view.

Fix for that pushed to review:

https://git.eclipse.org/r/8940
Comment 24 Karen Butzke CLA 2012-11-29 13:23:29 EST
It does not work when right-clicking on a branch in the 'Git Repositories' view and using 'Push Branch...'. I always then have to do 'Fetch from Upstream'
Comment 25 Sergey Prigogin CLA 2012-11-29 13:34:45 EST
(In reply to comment #23)
> Just to clarify: When using "Push to Upstream" from the team menu or the
> toolbar, it works (I'm using this every day).

It doesn't work when using "Push..." command from the context menu of the Git Repositories view.
Comment 26 Robin Stocker CLA 2012-11-30 08:37:55 EST
Thanks for the feedback, pushed changes to review for also fixing these:

(In reply to comment #24)
> It does not work when right-clicking on a branch in the 'Git Repositories'
> view and using 'Push Branch...'. I always then have to do 'Fetch from
> Upstream'

https://git.eclipse.org/r/8950

(In reply to comment #25)
> It doesn't work when using "Push..." command from the context menu of the
> Git Repositories view.

https://git.eclipse.org/r/8951
Comment 27 Robin Stocker CLA 2012-12-03 06:46:26 EST
*** Bug 395556 has been marked as a duplicate of this bug. ***
Comment 28 Dariusz Luksza CLA 2012-12-08 06:51:52 EST
fix merged as commit 5fdb4e38c515f0ecce546b9267e8c349c0cf0cff
Comment 29 Robin Stocker CLA 2012-12-16 09:25:31 EST
All 3 changes were merged into 2.2:

http://git.eclipse.org/c/egit/egit.git/commit/?h=stable-2.2&id=1afed28c44cfaa632bf4b9f0361f1ee4d4d0bdbb