Community
Participate
Working Groups
0.3 RC2 - Start with an existing repository that has various branches, cloned in Orion - Create a new empty remote repository somewhere - Attempt to figure out how to push your current branch to the new remote -> It turns out that you can do this by setting the "branch.<yourbranchname>.remote" property to be the name of your new remote, but this is not obvious. I was looking for either: 1) Some action on my current active branch like "Switch Remote" 2) Some action on the remote like "Make Current" or simply "Switch" Without thinking about it too much, I think 2) is the simplest. It would change the remote for the local active branch to be the selected remote. Under the covers it would just set the repository configuration property for the active branch.
Another option here would be allowing user to select a remote and ref specs to be used when pushing. Currently, the spec is always resolved to something like this: "HEAD:refs/head/{branch name from URL}", remote is also read from the URL requested by POST. This would be a more general solution but not necessarily simpler, comparing to what John suggested.
My solution: https://github.com/edytaprzymus/orion.client/commit/3dafdb470c4f580e7d127dbf9a1356e18edee1d1
I would add "New branch" to each remote. So far it is just for the first one in the tree. Moreover, as you already noticed, using 'New Branch' text field to push does not work. please fill a separate bug and look at it.
Here are two possible solutions for this problem: https://github.com/edytaprzymus/orion.client/commit/2d3baa416d277859dff2d40e36cb4b45f393ef78 --> when pushing a dialog with possibility to change remote to push https://github.com/edytaprzymus/orion.client/commit/7d81821afb522f3dfa94549137030ba25b94a3b8 --> new "levelItemCommand", visible for an active branch. Missing server part of this solution, but it's possible to compare workflow of both solution and choose the better one to implement
(In reply to comment #4) > Here are two possible solutions for this problem: > > https://github.com/edytaprzymus/orion.client/commit/2d3baa416d277859dff2d40e36cb4b45f393ef78 > --> when pushing a dialog with possibility to change remote to push Looks promising. I would change the wording to 'Click More to push to another remote or OK to push to default' and maybe put 'More' just next to 'OK' e.g. [More][OK] aligned to the right. > > https://github.com/edytaprzymus/orion.client/commit/7d81821afb522f3dfa94549137030ba25b94a3b8 > --> new "levelItemCommand", visible for an active branch. Missing server part of > this solution, but it's possible to compare workflow of both solution and choose > the better one to implement Could you paste a screenshot showing where the icon is? I was not able to see it.
Created attachment 218437 [details] Switch remote
I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use.
(In reply to comment #5) > (In reply to comment #4) > > Here are two possible solutions for this problem: > > > > > https://github.com/edytaprzymus/orion.client/commit/2d3baa416d277859dff2d40e36cb4b45f393ef78 > > --> when pushing a dialog with possibility to change remote to push > > Looks promising. I would change the wording to 'Click More to push to another > remote or OK to push to default' > and maybe put 'More' just next to 'OK' e.g. [More][OK] aligned to the right. I think this looks better. Please improve the dialog and make sure that this case works: Steps: 1) have two remotes e.g. 'origin' and 'test' 2) create a new local branch and make it active 3) push changes to 'origin' 4) try to push to 'test' now and remember that, so the next time you are trying to push it uses 'test/[branch]'
The fix: https://github.com/edytaprzymus/orion.client/commit/b587611be44f7bad9e2f945b864b4f479978d6c8 Please notice, that this commit fix also problem with hand-typed new branch name.
The latest fix seems to work. Couple comments: 1. Try to not craft locations manually, like: var remoteLocation = "/gitapi/remote/file/" + parts[4]; var locationToChange = "/gitapi/config/clone/file/" + parts[4]; I would call GET on CloneLocation and get locations from the response 2. fix indents, for instance see the code around line 1508 in gitCommands.js 3. I would extract the code to edit config property to a separate method. 4. I think that var target; in line 1116 in gitCommands.js should be moved to callback methods 5. I would update configuration also when we push a branch for the first time and please rebase on top of 'master' branch.
(In reply to comment #10) > 3. I would extract the code to edit config property to a separate method. Maybe gitClient#editCloneConfigurationProperty method could have 'create' param meaning that if the key doesn't exist, it should be created.
https://github.com/edytaprzymus/orion.client/commit/4d461e42f5bef894fc371671127c5df1db722b53 here I fixed almost all remarks. I only didn't get the point 3. Could you please tell me more detailed which code should I extract as a separate method?
(In reply to comment #12) > here I fixed almost all remarks. I only didn't get the point 3. Could you please > tell me more detailed which code should I extract as a separate method? Refreshing explorers/pages for instance. 2. indents are not fixed 4. var target is left unused in line 1186
https://github.com/edytaprzymus/orion.client/commit/a4bd96634b2f5cbd0405f27e9888b50b77d7450c
Edyta I merged your commit to master on eclipse.org. However I had to simplify the code what is released in a separate commit.