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

Bug 399671

Summary: Fetch, Push from Git Status Page gives an error, when the command succeed
Product: [ECD] Orion Reporter: Anton McConville <antonm>
Component: ClientAssignee: Szymon Brandys <Szymon.Brandys>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw, simon_kaegi, Szymon.Brandys
Version: 2.0   
Target Milestone: 2.0 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Anton McConville CLA 2013-01-31 14:03:27 EST
If I fetch from the Git Status page, I see an error 'Fetch Rejected, not a fast forward'.

I don't normally see this error for fetching. When I refresh the page, if there are commits, I see them in the list for master.

I experience similar when pushing.

My password is not stored, I enter it for each request.
Comment 1 Simon Kaegi CLA 2013-01-31 17:46:01 EST
This is similar to the last problem where the user password dialog prevented us from getting to the next step. We again need to refresh to see the entries we just fetched.

To be honest I think this particular error has been present for ages however we're not just seeing it for the first time in the status area and not handling things correctly.
Comment 2 Malgorzata Janczarska CLA 2013-02-01 03:09:09 EST
This is because we generally don't do refresh when there are errors assuming that if fetch is failed then no changes are made. But I think you're right, we should refresh the status, because in situations like this the fetch is almost correct and there are some changes.
Comment 3 Szymon Brandys CLA 2013-02-01 03:23:42 EST
(In reply to comment #1)
> To be honest I think this particular error has been present for ages however
> we're not just seeing it for the first time in the status area and not
> handling things correctly.

Indeed the status area tells more now. So as Simon said the problem was there, but probably unnoticeable.

(In reply to comment #2)
> This is because we generally don't do refresh when there are errors assuming
> that if fetch is failed then no changes are made. But I think you're right,
> we should refresh the status, because in situations like this the fetch is
> almost correct and there are some changes.

Right, we have to make sure that the status is refreshed and the message is still visible.
Comment 4 Szymon Brandys CLA 2013-02-01 05:58:08 EST
(In reply to comment #0)
> If I fetch from the Git Status page, I see an error 'Fetch Rejected, not a
> fast forward'.

What are your steps to have fetch ended up with 'Fetch Rejected, not a fast forward'? I think that's doable for Pull, but that's available only on Git Repository page.
Comment 5 Szymon Brandys CLA 2013-02-01 09:21:36 EST
(In reply to comment #4)
> What are your steps to have fetch ended up with 'Fetch Rejected, not a fast
> forward'? I think that's doable for Pull, but that's available only on Git
> Repository page.

Anyway I pushed a fix which should address the problem. When Merge, Rebase, Fetch or Push "fails" the content of the page is updated.
Comment 6 libing wang CLA 2013-02-01 09:38:08 EST
I pulled the latest code and tried on my self hosting, on both Chrome (25.0.1364.45 beta-m) and firefox(18.0.1).
I cleared both browser cache and localStorage.
I still got the same error.
My steps was simple:
1.Go to git status page.
2.Click on Fetch.
3.Type password.
4.The error showed up.
5.Refresh the page.
Then I got the incoming commits.
Comment 7 Szymon Brandys CLA 2013-02-01 10:06:47 EST
(In reply to comment #6)
> I still got the same error.
> My steps was simple:
> 1.Go to git status page.
> 2.Click on Fetch.
> 3.Type password.
> 4.The error showed up.
> 5.Refresh the page.
> Then I got the incoming commits.

Right, but what error? Could you paste a screenshot?
Comment 8 Szymon Brandys CLA 2013-02-01 10:26:24 EST
Have a short chat with Libing. We have two things here:
1) refreshing the commits list even if a problem occurs
2) the 'Fetch Rejected, not a fast forward' error itself

I confirmed with Libing that 1) is fixed. For 2) the problem should not occur and it looks like a problem with JGit for me. Libing will reclone the repo and check if the problem persists.
Comment 9 libing wang CLA 2013-02-01 10:32:25 EST
After talking to Simon and recloned the orion repo and tested on the new repo, the fetch worked without the errors.
Simon doubted the old work space was corrupted and jgit failed on that.
But I will keep the old repo for tracking the jgit bug.
Comment 10 libing wang CLA 2013-02-01 11:01:14 EST
Sent Szymon the old repo zip by email.