Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351440 - '+' in refspecs seems to not be respected during push/fetch operations
Summary: '+' in refspecs seems to not be respected during push/fetch operations
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Git (show other bugs)
Version: 0.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 0.3 M1   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard: gsoc2011
Keywords:
Depends on:
Blocks: 351458
  Show dependency tree
 
Reported: 2011-07-07 09:00 EDT by Szymon Brandys CLA
Modified: 2012-01-19 11:46 EST (History)
1 user (show)

See Also:
tomasz.zarna: review+
Szymon.Brandys: review+


Attachments
mylyn/context/zip (3.50 KB, application/octet-stream)
2011-07-20 06:23 EDT, Tomasz Zarna CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Brandys CLA 2011-07-07 09:00:33 EDT
I work with a contributor who frequently rebases his branches. To be able to push changes and fetch them we need to handle '+' properly. Moreover there should be an easy way in UI to do push/fetch --force when spec does not have '+'. At this point, assuming that '+' is fixed, we would need to modify the clone configuration.
Comment 1 Piotr Janik CLA 2011-07-13 13:30:04 EDT
Fix:
https://github.com/pjanik/orion.server/tree/bug351440
https://github.com/pjanik/orion.client/tree/bug351440

I wrote all this code and have the rights to contribute it to Eclipse under the
eclipse.org web site terms of use.

Git REST API now supports forced push (and fetch). I've added Forced Push All command in the log view for now.

We talked earlier that forced push can be done using repo configuration - I was wrong, not in Orion. All push operations in Orion use some defined refspec, like pushing HEAD to some remote etc. So, default value from config is never read. Because of that I implemented such forced push/fetch.
Comment 2 Tomasz Zarna CLA 2011-07-14 11:22:42 EDT
Looking good. There is no way to do a forced fetch in the client right now, is there? That plus more tests and I'm fine with releasing the fix.
Comment 3 Piotr Janik CLA 2011-07-14 11:29:41 EDT
No, there isn't. Ofc I can update UI if it's useful.
Comment 4 Szymon Brandys CLA 2011-07-14 12:45:47 EDT
(In reply to comment #3)
> No, there isn't. Ofc I can update UI if it's useful.

Shouldn't we consult the config for push/fetch too? In EGit for instance, if there is push refspec like 'remote.pjanik.push	+refs/heads/master:refs/heads/master' and we are pushing pjanik master, it will suggest to do force push. If the spec is 'refs/heads/master:refs/heads/master', it will not use force. Of course push/fetch with force flag is fine, but it would be handy to consult configuration too. For instance when I'm working with you Piotrek i would just use a spec with + always and I would not check the force flag during each fetch operation.
Comment 5 Szymon Brandys CLA 2011-07-15 04:35:21 EDT
I chatted with Piotrek a bit and it seems that what we really need is git push on remote. I asked him to raise a separate bug for it. We already have fetch for remotes, but no push.

Regarding this bug, we need force for push and fetch. I'll look at your fix when you add UI. So far you could just add an extra icon for fetch/push force, however we would need something smarter in UI to parameterize actions.

Moreover it seems that I can't push newly created local branches, if there is no 'origin' remote. Piotrek, if you confirm this, please raise a bug.
Comment 6 Piotr Janik CLA 2011-07-15 07:56:15 EDT
fixed
https://github.com/pjanik/orion.server/tree/bug351440
https://github.com/pjanik/orion.client/tree/bug351440

1. UI is updated - there are both forced push and forced fetch in the Log/Remote view.
2. I've also fixed small bug - when fetch without force flag was rejected, no information about that was provided. UI showed just OK, so user could not come up withe the idea, that he needs forced fetch in that case. It was caused by FetchJob, which ignored results of fetch operation.
3. I've added tests (forced fetch).

So, I think that this bug is more or less complete.
Comment 7 Szymon Brandys CLA 2011-07-19 04:22:24 EDT
The UI part looks fine. I think we should look closer at bug 342739. Finally there should be only one Fetch (and Push) action and 'force' checkbox should be part of the command UI. But it is a separate bug blocked by bug 342739.

Tomek, could you look at the server side again? Looks like your comments are addressed. Once it is done I'll handle the UI part.
Comment 8 Tomasz Zarna CLA 2011-07-19 06:11:30 EDT
(In reply to comment #7)
> Tomek, could you look at the server side again? 

Piotrek, please take a look at my comments here: https://github.com/pjanik/orion.server/commit/bc7ea500304019ebb433565133bf48a3826a1785
Comment 9 Piotr Janik CLA 2011-07-19 15:50:34 EDT
(In reply to comment #8)
> Piotrek, please take a look at my comments here:
> https://github.com/pjanik/orion.server/commit/bc7ea500304019ebb433565133bf48a3826a1785
Ok, I've answered there.
Fixed version: https://github.com/pjanik/orion.server/commits/bug351440
Comment 10 Tomasz Zarna CLA 2011-07-20 06:22:57 EDT
Server side fixed with http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=85a59817b9f379e4ce823f3d17a44b10cd9b698d. Back to you, Szymon.
Comment 11 Tomasz Zarna CLA 2011-07-20 06:23:12 EDT
Created attachment 199970 [details]
mylyn/context/zip
Comment 12 Szymon Brandys CLA 2011-07-21 06:27:27 EDT
UI fixed with 89852ce9bed47890c2dd6365381d46e3032bcf8d.