DESCRIPTION

Improve simple push dialog

This dialog now shows which commit, from which branch is about to be
pushed. It fits both use cases of pushing HEAD from resource, or pushing
a single branch.

Bug: 436669
Change-Id: Ibd8d75d6cece181657210fba73c9f2be90ea077b
Signed-off-by: Isis Velasquez xxx@xxx.xxx
Signed-off-by: Douglas Trujillo xxx@xxx.xxx


COMMENTS

author: Isis Velasquez
date: 2014-07-03 14:23:21.000000000

Uploaded patch set 17.

-------------------------------------
author: Isis Velasquez
date: 2014-07-03 14:26:12.000000000

Patch Set 17:

Patch set 17 should fix some tests.

-------------------------------------
author: Brenden Conley
date: 2014-07-03 14:30:57.000000000

Patch Set 17:

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

-------------------------------------
author: Brenden Conley
date: 2014-07-03 14:45:41.000000000

Patch Set 17: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2014-07-04 13:42:34.000000000

Patch Set 17: Code-Review-1

> Another comment: When the thing we are pushing is not a branch, the
> "Configure upstream" part must be hidden, because it's not possible to
> configure anything for a commit.
> This is one more reason why it may be better to leave the old 
> "ref push wizard" in place for pushing a commit, see inline comments.
> When we do that, we could instead show the "ref push wizard" on 
> "Team > Push HEAD...", which should be easy with the dynamic menu.
> Matthias, what do you think about this?

I would prefer to enhance the SimplePushRefWizard instead of using the old wizard since the UI of the new wizard looks cleaner. I think we should teach it to not show "configure upstream" if no branch is checked out, add content assist for existing branches and accept refs starting with "refs/" but not with "refs/remotes/" literally to allow pushing to non-standard refs. The latter two changes could go in separate changes.

The tests succeed now, thanks

-------------------------------------
author: Isis Velasquez
date: 2014-07-04 14:16:19.000000000

Patch Set 17:

@Matthias: The current patch doesn't seem to contain changes related to Robin's suggestion and hiding "confgure upstream".
What's still to do in this change to be approved?

-------------------------------------
author: Danika Greer
date: 2014-07-04 14:59:23.000000000

Patch Set 17:

@Matthias: How would you decide when it's a short branch name and when it's a ref name? E.g. "foo" vs "refs/for/foo"? Detect a "refs/" prefix and switch the "Branch:" to "Ref:" to show that it will be interpreted like that? What if the branch is called "refs/foo" (refs/heads/refs/foo)? I still think there should be a manual way to trigger/undo this.

@Mickael: Would you mind adding the hiding of "Configure Upstream" with this patch set? I get this error related to that with the current patch set when starting a push of a commit and entering the branch name:

java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.push.PushBranchPage.hasDifferentUpstreamConfiguration(PushBranchPage.java:419)
	at org.eclipse.egit.ui.internal.push.PushBranchPage.checkPage(PushBranchPage.java:373)
	at org.eclipse.egit.ui.internal.push.PushBranchPage.access$1(PushBranchPage.java:357)
	at org.eclipse.egit.ui.internal.push.PushBranchPage$5.modifyText(PushBranchPage.java:301)

-------------------------------------
author: Douglas Trujillo
date: 2014-07-04 22:07:04.000000000

Patch Set 17:

native git rejects pushing to refs/foo if there is no branch refs/heads/refs/foo in the remote repository:

 [HelloWorld (master)]$ git push origin HEAD:refs/foo
 Counting objects: 9, done.
 Delta compression using up to 8 threads.
 Compressing objects: 100% (2/2), done.
 Writing objects: 100% (3/3), 277 bytes | 0 bytes/s, done.
 Total 3 (delta 1), reused 0 (delta 0)
 remote: error: refusing to create funny ref 'refs/foo' remotely
 To https://github.com/msohn/HelloWorld.git
 ! [remote rejected] HEAD -> refs/foo (funny refname)
 error: failed to push some refs to 'https://github.com/msohn/HelloWorld.git'

If a branch refs/heads/refs/foo exists in the remote repository the push refspec refs/foo is accepted. I think we should disambiguate these cases in the same way. I would accept pushing to refs/for/... only if the repository is configured for Gerrit.

-------------------------------------
author: Isis Velasquez
date: 2014-07-07 09:04:14.000000000

Patch Set 17:

About the configure upstream, I'd like to advocate in favour of one of these 2 options:
* make it unchecked and disabled when we are on a detached HEAD, or
* Just remove the Configure upstream section from this page since at this time, we are configure Push, not Pull.

-------------------------------------
author: Danika Greer
date: 2014-07-07 10:01:22.000000000

Patch Set 17:

@Matthias: Didn't know that C Git is so strict :).

Ok then, as long as Mickael implements this in another change for 3.5, I'm ok with removing this for now. I just don't want users complaining that this functionality was removed without having a replacement.

(Would have been better to replace this in a separate change when the replacement is ready, but it's already done now.)

@Mickael: I would go with "make it unchecked and hidden when we are on a detached HEAD". Not sure if this is your second option. It should definitely stay for the branch case (upstream configuration is used for both push and pull).

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