Bug 543097 - Confusing Remote->Push... workflow
Summary: Confusing Remote->Push... workflow
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-31 04:59 EST by Ed Willink CLA
Modified: 2019-01-01 09:50 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2018-12-31 04:59:12 EST
From the GIT Repositores View, Remote->Push... puts up the "Push to Another Repository" dialog.

"Another" is confusing/meaningless. Please change to "Push to Repository."

Then, the "Preview" button advances to the "Push to: origin" dialog. The label is less helpful than it might be since, once a user has numerous GIT repos, there are many origins and masters. Please change to "Push to: 'repo-path'".

"Preview" is confusing. A few releases ago it was "Next" which was eminently sensible, since it is the normal next step in the workflow. No way is it a preview, since it advances to a selection dialog not a preview of an imminent action. Please change back to "Next".

Also "Push" is available. I have no idea what is going to be pushed. I have accidentally clicked it a few times rather than "Preview". Fortunately it always results in an error and so no harm is done. Perhaps it is attempting to do "Push All", or "Push Current". Please remove it or give it a meaningful label that works.
Comment 1 Matthias Sohn CLA 2018-12-31 20:31:12 EST
(In reply to Ed Willink from comment #0)
> From the GIT Repositores View, Remote->Push... puts up the "Push to Another
> Repository" dialog.
> 
> "Another" is confusing/meaningless. Please change to "Push to Repository."

ok

> Then, the "Preview" button advances to the "Push to: origin" dialog. The
> label is less helpful than it might be since, once a user has numerous GIT
> repos, there are many origins and masters. Please change to "Push to:
> 'repo-path'".

depending on what you selected on the first wizard page this label shows either the
name of the remote you selected from the dropdown of remotes configured in the selected
repository's git config file or it is the manually entered destination URL.
This is equivalent to what you type in command line git:

git push <remote> <refspec>

or

git push <URL> <refspec>

> "Preview" is confusing. A few releases ago it was "Next" which was eminently
> sensible, since it is the normal next step in the workflow. No way is it a
> preview, since it advances to a selection dialog not a preview of an
> imminent action. Please change back to "Next".

The second wizard page shows which push refspecs are configured in your repository's git config file.
If these refspecs match what you want to push you can just click "Push" and the corresponding push
command is executed. Otherwise you can tweak the push refspecs and optionally persist them in
.git/config.

I could agree to change the label of the "Preview" button on the first wizard page to something like
"Configure Refspecs". I think the "Preview" button on the second wizard page is named correctly since
it's running a push command with option --dry-run [1], so it really talks to the remote repository to evaluate
what the outcome of the push command would be, the result is displayed on the next wizard page. 

> Also "Push" is available. I have no idea what is going to be pushed. I have
> accidentally clicked it a few times rather than "Preview". Fortunately it
> always results in an error and so no harm is done. Perhaps it is attempting
> to do "Push All", or "Push Current". Please remove it or give it a
> meaningful label that works.

If you press "Push" on the first wizard page it uses the selected remote or URL with the push refspecs
configured in .git/config. On the second wizard page it uses the selected remote or URL and the
refspecs configured on this second page (which might be different from the refspecs in .git/config
since you may have tweaked it on this page. Effectively this skips the --dry-run option you can
execute by clicking "Preview" on the second wizard page.

Finally on the third wizard page you can repeat the push preview you did on the second page without using
the --dry-run option.

[1] https://git-scm.com/docs/git-push#git-push---dry-run
Comment 2 Matthias Sohn CLA 2018-12-31 20:39:31 EST
"Push" can fail e.g. if you lack permissions in the remote repository to push to the refs selected by the configured refspecs. 

E.g. if your .git/config for your clone of jgit looks like this

[remote "origin"]
	url = https://git.eclipse.org/r/a/jgit/jgit.git
	fetch = +refs/heads/*:refs/remotes/origin/*
	fetch = +refs/notes/review:refs/notes/review
	fetch = refs/notes/*:refs/notes/*
	push = HEAD:refs/heads/master

then "Push" will fail since the jgit repository does not allow direct push to the master branch but only push for review for the master branch which would be the push refspec

push = HEAD:refs/for/master

If you configured the remote for Gerrit (select remote "origin" in the repositories view and click "Gerrit Configuration") this should be preconfigured already in your .git/config.
Comment 3 Ed Willink CLA 2019-01-01 04:40:46 EST
(In reply to Matthias Sohn from comment #1)
> Please change to "Push to: 'repo-path'".
> 
> depending on what you selected on the first wizard page this label shows
> either the
> name of the remote you selected from the dropdown of remotes configured in
> the selected
> repository's git config file or it is the manually entered destination URL.
> This is equivalent to what you type in command line git:
> 
> git push <remote> <refspec>
> 
> or
> 
> git push <URL> <refspec>

Yes, but from the command line, I would need to use the 'right' repo, and I can see the previous command to check. In the UI you cannot so there is no way of checking whether the adjacent repo was accidentally selected. While "Push to: origin" echoes the "origin" from 

origin: ssh://...@git.eclipse.org:29418/ocl/org.eclipse.ocl

it leaves me with no way of knowing whether I accidentally selected a different repo and am operating with

origin: ssh://...@git.eclipse.org:29418/ocl/org.eclipse.qvtd

Much better to display at least the /ocl/org.eclipse.ocl part somewhere, possibly as

"Push to: origin /ocl/org.eclipse.ocl"

> 
> > "Preview" is confusing. A few releases ago it was "Next" which was eminently
> > sensible, since it is the normal next step in the workflow. No way is it a
> > preview, since it advances to a selection dialog not a preview of an
> > imminent action. Please change back to "Next".
> 
> I could agree to change the label of the "Preview" button on the first
> wizard page to something like
> "Configure Refspecs". I think the "Preview" button on the second wizard page
> is named correctly since
> it's running a push command with option --dry-run [1], so it really talks to
> the remote repository to evaluate
> what the outcome of the push command would be, the result is displayed on
> the next wizard page. 

No problem with "Preview" on the "Push Ref Specifications" page.

"Configure Ref Specs" is a little better that "Preview" on the "Destination Git Repository" page, but since the 99% use case is to next stage in workflow "Next" seems so much better.
 
> > Also "Push" is available. I have no idea what is going to be pushed. I have
> > accidentally clicked it a few times rather than "Preview". Fortunately it
> > always results in an error and so no harm is done. Perhaps it is attempting
> > to do "Push All", or "Push Current". Please remove it or give it a
> > meaningful label that works.
> 
> If you press "Push" on the first wizard page it uses the selected remote or
> URL with the push refspecs
> configured in .git/config. On the second wizard page it uses the selected
> remote or URL and the
> refspecs configured on this second page (which might be different from the
> refspecs in .git/config
> since you may have tweaked it on this page. Effectively this skips the
> --dry-run option you can
> execute by clicking "Preview" on the second wizard page.

Ouch! I wouldn't have guessed that. Surely then "Push" should be removed and the pre-configured push ref specs should provide the initial state of the "Push Ref Specifications" page. Else "Push" should be relabelled as "Push Branch xxxx" just as in the main menu.

(Trying it again, the reason "Push" fails for me is that I do not know how to configure refspecs, so I have no branch configured and just get a cannot connect to repo popup.).

Since I work with branches my usage is often
- Remote->Push... (on the repo of interest)
- Preview ("Next" please")
- select branch
- Add Spec
- Push
- Oops not fast forward, and "Back" is no longer useful
- Cancel
- Remote->Push... (on the repo of interest)
- Preview ("Next" please")
- select branch
- Add Spec
- Force Update
- Push
Comment 4 Michael Keppler CLA 2019-01-01 08:55:34 EST
One more observation: The dialog behaves differently regarding Next/Preview, depending on whether it is invoked via
* git repos view -> remote -> push... (Preview)
* package explorer -> team -> remote -> push... (Next)

Does that make sense?
Comment 5 Ed Willink CLA 2019-01-01 09:50:08 EST
(In reply to Michael Keppler from comment #4)
> Does that make sense?

No.

package explorer -> team -> remote -> push... git repos view -> remote -> push... has a selected, but changeable repo, so "Next" is sensible

git repos view -> remote -> push... has a selected, but changeable repo, so why "Preview"

In both cases, since the user has already selected a repo, it seems like a waste of clicks to have to go past a dialog that allows a change at all. (Better to go straight to the configure push ref specs dialog where a "Change repo..." button might back up if really needed.) This might also fix the confusion whereby the ssh passphrase is not requested until the second dialog when the user thinks the connection has already been established.