DESCRIPTION

Bug 485124: A wizard to configure pull operation

This is accessible on project's context menu, as "Pull..." just below
"Pull"

Change-Id: I88122d3fedf10de35a0c1c233b7dd9920bb8c0c7
Signed-off-by: Isis Velasquez xxx@xxx.xxx
Also-By: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Isis Velasquez
date: 2016-01-12 11:43:18.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2016-01-12 11:43:24.000000000

Patch Set 4:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/8017/

-------------------------------------
author: Isis Velasquez
date: 2016-01-12 11:44:07.000000000

Patch Set 4:

Patch set 4 adds Thomas' icon and uses it for the toolbar.

-------------------------------------
author: Brenden Conley
date: 2016-01-12 12:07:44.000000000

Patch Set 4: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/8017/ : SUCCESS

-------------------------------------
author: Alayna Houston
date: 2016-01-12 20:40:18.000000000

Patch Set 4: Code-Review-1

Started playing with this and noticed the following:

1. After adding a new remote, the remotes combo in the PullWizard is set
   to the new remote and becomes read-only. What if I change my mind and
   want to pull from one of the exiting remotes, though? I have to cancel
   and re-open the dialog. (And then the newly added remote is gone, see
   below.) Please don't make the combo read-only.
2. Not sure if I like the behavior of adding a new remote. When I add a
   new remote (finishing the AddRemote dialog) and then cancel the PullWizard,
   the new remote is not in the repository. On the one hand, that's kind of
   logical--after all I canceled the wizard. On the other hand, I had
   confirmed the creation of the new remote before... unclear to me what
   is least confusing for users. My spontaneous reaction after having done
   this and then having re-opened the wizard was "WTF? I just added a remote,
   so why doesn't it show up in the remote combo now?"...
3. When I start typing in the reference field, the wizard contacts the
   currently chosen remote. However, it then lets me happily specify a non-
   existing reference to pull from, which results in an error dialog later
   on. (The error is also logged.) Content assist via Ctrl-space only
   displays something if the text in the field is a prefix of a valid remote
   reference. There is no visual error indicator (just a beep when I type
   Ctrl-space and there's no match), and the "Finish" button is not disabled
   on invalid reference names. The Lightbulb tooltip is wrong; Ctrl-Space
   does not show "a filtered list of previously used values", and wildcards
   don't work.
4. The first pull operation I performed was on the non-existing reference
   "foo" (which failed). Since then and even after a restart, the wizard
   always opens with "foo" pre-filled for that remote, even though I had
   performed pulls from valid references afterwards. That's hyper-annoying.
   Didn't look whether it's just that the wizard remembers only the first
   reference ever used or whether it has something to do with it having
   been an invalid reference. If pre-filled, I would expect the reference
   field to be pre-filled with the last used (valid) reference.
5. That "foo" is even the pre-set in the "Push Branch" wizard now!
6. On a repo with two remotes A and B, I selected A and chose a valid branch.
   Then I changed the remote in the combo to B, which doesn't have this
   branch. I got no warning, no error, and of course upon clicking "Finish"
   got an error dialog (and log entry). Remote B was only contacted when I
   clicked "Finish", when the actual pull operation was attempted.

So, overall: looks promising, but needs a bit of work to give a good user experience.
For power users it may already be useful, but in its current state there's too many
rough edges that will confuse people who are not so experienced with git.

-------------------------------------
author: Alayna Houston
date: 2016-01-12 20:43:43.000000000

Patch Set 4:

Oh, and this new wizard *really* needs UI tests.

-------------------------------------
author: Isis Velasquez
date: 2016-01-13 07:50:13.000000000

Patch Set 4:

1, 2 & 6. Ok, I'll fix those
3. We can put a warning for unknown remote reference. However, many Git services such as GitHub allow to pull references that are not declared, such as pull/123/head; or Gerrit allows refs/changes/42/63842/4. So this has to be a freetext to support such cases. The content assist only works for references that are declared remotely, those are only a subset of what can actually be pulled
4 & 5. Where you on a deteched HEAD? Did you have access to the "Configure upstream for push & pull" checkbox? By default it's hidden for commits that aren't associated to the top of a branch, but maybe it should always be shown.

-------------------------------------
author: Alayna Houston
date: 2016-01-13 07:57:18.000000000

Patch Set 4:

> 4 & 5. Where you on a deteched HEAD? Did you have access to the
 > "Configure upstream for push & pull" checkbox? By default it's
 > hidden for commits that aren't associated to the top of a branch,
 > but maybe it should always be shown.

No detached HEAD, and yes, the "Configure..." checkbox was available.

-------------------------------------
author: Isis Velasquez
date: 2016-01-13 08:05:52.000000000

Patch Set 4:

4 & 5. It seems to me that EGit always store the configuration of 1st operation if none is already available for current branch (independently of whether the operation succeeds or not). It would most likely do the same if you use the "Push branch" wizard. If you want to override it, you have to tick the checkbox. So as far as I understand your comments, it's mostly that you'd like the checkbox to be ticked and the remote configuration overwritten by default?

-------------------------------------
author: Alayna Houston
date: 2016-01-13 08:18:38.000000000

Patch Set 4:

> 4 & 5. It seems to me that EGit always store the configuration of
 > 1st operation if none is already available for current branch
 > (independently of whether the operation succeeds or not). It would
 > most likely do the same if you use the "Push branch" wizard. If you
 > want to override it, you have to tick the checkbox. So as far as I
 > understand your comments, it's mostly that you'd like the checkbox
 > to be ticked and the remote configuration overwritten by default?

I thought I did that on a branch that was already set up to track origin/master, and I left that checkbox unchecked, so the attempt to pull from "foo" should not have overwritten the existing upstream config. I'll have to check more closely what's up.

And it makes no sense for EGit to store an upstream config that cannot be pulled from. So no, I don't want that checkbox be ticked by default. If EGit really unconditionally stores the first remote ref a fetch is attempted from as upstream even if that fetch fails, then that's maybe a separate bug. But again, I'll have to re-examine this case more closely to see what exactly happened.

-------------------------------------
author: Isis Velasquez
date: 2016-01-13 08:24:24.000000000

Patch Set 4:

> And it makes no sense for EGit to store an upstream config that cannot be pulled from. So no, I don't want that checkbox be ticked by default. If EGit really unconditionally stores the first remote ref a fetch is attempted from as upstream even if that fetch fails, then that's maybe a separate bug. But again, I'll have to re-examine this case more closely to see what exactly happened.

I disagree on that. It's not because it doesn't work (at that time) that there is no interest in storing it if user has decided so.
Let's assume users have the checkbox ticked, and simply don't have a connection at that time, or that you whole configuration fails for a typo; then I believe they expect it to be saved anyway and to be able to fix this later rather than having to rewrite everything.

-------------------------------------
author: Isis Velasquez
date: 2016-01-13 08:56:49.000000000

Patch Set 4:

Next patch set fixes 1&2.
About 3&6, I believe we need to think more about this. I'm not sure warning user of something possible is doable. Actually, the error shown in case of wrong reference is clear enough to present it to users IMO.
About 4&5, I gave a few tries and couldn't reproduce the issue you mentioned. I have the impression that the handling of the default upstream config is consistent.

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-02-13 12:59:54.000000000

Change has been successfully merged into the git repository by Alayna Houston

-------------------------------------
