Bug 341076 - simplify pushing of tags
Summary: simplify pushing of tags
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 0.12   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
: 358103 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-28 05:21 EDT by Edwin Kempin CLA
Modified: 2013-12-01 09:27 EST (History)
10 users (show)

See Also:


Attachments
Picture of current wizard (25.85 KB, image/png)
2012-04-23 05:33 EDT, Dani Megert CLA
no flags Details
screenshot of new "Push Tags" wizard (64.71 KB, image/png)
2013-12-01 09:27 EST, Robin Stocker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edwin Kempin CLA 2011-03-28 05:21:13 EDT
To push a certain tag I currently need to open the push dialog (with 'Push...' from the context menu of the repository) and manually specify 'refs/tags/myTag:refs/tags/myTag' as push ref specification.

I would find it more convenient if I could simply choose 'Push...' in the context menu on a tag (in the Repositories View on the tags shown under <repository> -> 'Tags'). Then a very simply push dialog could be shown, which just has 3 prefilled fields:
1. the push URL (prefilled with the push URL from the configured push specification, maybe drop-down list if several push URLs are configured)
2. the source ref (prefilled and fixed with the tag ref of the tag on which the push is done, e.g. 'refs/tags/myTag')
3. destination ref (prefilled with the tag ref of the tag on which the push is done, e.g. 'refs/tags/myTag')

With this it would be pretty easy to push a tag: find the tag -> 'Push...' -> confirm the dialog with 'OK' :-)

Maybe something similar could be even done for branches!?
Comment 1 Markus Duft CLA 2012-01-26 07:30:20 EST
i have proposed a fix for this:

 http://egit.eclipse.org/r/#/c/4999/

it probably needs some more love to make it great, bu still it already works
Comment 2 Stephan Herrmann CLA 2012-02-05 11:34:01 EST
After a few months of pushing to Eclipse git repos I'm already guilty of producing bogus pushes of two opposite kinds: 
- push a local branch which was supposed to remain private and
- push the content of a local featurebranch into origin/master instead of origin/featurebranch

I believe a nice solution in this bug could significantly help me and others to avoid such embarrassing mistakes in the future!

(In reply to comment #0)
> Maybe something similar could be even done for branches!?

Are branches already covered by the proposed fix?

What exactly will be the workflow?
I'd assume after selecting the tag/branch to be pushed, it just needs max 2 more options:
- push to master or the equivalent branch/tag on origin?
- should a dry-run be performed?
For branches it would be interesting, how the dialog would connect to storing refspecs in the remote configuration. Maybe, the dialog could indeed simply distinguish private vs. public branches? Private ones would go to master, when pushed, public ones to their corresponding branch on the remote. And then this choice could be persisted using a matching refspec. Makes sense?

I think starting from a selected tag/branch will greatly improve usability. If the next step is simple and easy, too, a lot fewer mistakes will be made, I hope.
Comment 3 Markus Duft CLA 2012-02-06 04:50:23 EST
(In reply to comment #2)
> What exactly will be the workflow?

in the current proposal, just right-click a branch/tag in repo view or a commit in history view, and select Push... you're presented with a wizard, which allows to choose the remote to push to, and after that just a very (very very) simple wizard page that allows you to enter the target ref name to push to. Nothing is persisted for now.

> I'd assume after selecting the tag/branch to be pushed, it just needs max 2
> more options:
> - push to master or the equivalent branch/tag on origin?
> - should a dry-run be performed?

just at first, the target remote is selected, and dry-run is not there (yet?)

> For branches it would be interesting, how the dialog would connect to storing
> refspecs in the remote configuration. Maybe, the dialog could indeed simply
> distinguish private vs. public branches? Private ones would go to master, when
> pushed, public ones to their corresponding branch on the remote. And then this
> choice could be persisted using a matching refspec. Makes sense?

hm. i don't think that such kind of super-duper intelligent  logic is good. it may fit some cases, but may not in other cases. how would you, for example, determine whether a branch is private? just because it was never pushed? That would already be easy, if the dialog would offer the possibility to persist the spec. just have no spec to start with, and persist those you push, and you're there.

> 
> I think starting from a selected tag/branch will greatly improve usability. If
> the next step is simple and easy, too, a lot fewer mistakes will be made, I
> hope.

true :) thats why i wanted this to happen.
Comment 4 Stephan Herrmann CLA 2012-02-06 12:42:52 EST
(In reply to comment #3)
> just at first, the target remote is selected, and dry-run is not there (yet?)

I'm very much in favor of dry-run, it's another great tool to avoid wrong pushes...
 
> how would you, for example, determine whether a branch is private?

I was thinking that for some users it might be appropriate to just have
an explicit selection in this dialog (and maybe other dialogs, too):

   The current branch is: (o) private ( ) public

and the target refspec would be pre-set from that selection:
 private : push to master
 public : push to branch

If refspecs are stored, the dialog could remember the private/public
selection from those refspecs.

This could perhaps enable Joe-the-programmer to safely use branches without
even understanding refspecs? But I won't insist on this :)
Emphasis is on: simple to understand and simple to use.
How this is achieved is secondary for me.
Comment 5 Matthias Sohn CLA 2012-03-22 19:01:32 EDT
Markus: please confirm the following contribution statements which are required to be answered for IP approval:

1.  Did you author 100% of the content you are contributing?
2.  Do you have the rights to contribute the content to Eclipse?
3.  Is the content being contributed under the EPL?
Comment 6 Markus Duft CLA 2012-03-23 03:38:20 EDT
(In reply to comment #5)
> Markus: please confirm the following contribution statements which are required
> to be answered for IP approval:
> 
> 1.  Did you author 100% of the content you are contributing?
yes
> 2.  Do you have the rights to contribute the content to Eclipse?
yes
> 3.  Is the content being contributed under the EPL?
yes

:)
Comment 7 Matthias Sohn CLA 2012-04-02 05:32:26 EDT
merged as 82b60e5aff1bd4ee9e8413806ab491d4da4302fa
Comment 8 Markus Keller CLA 2012-04-02 13:52:29 EDT
Compile error in SimplePushSpecPage.java if compiled against proper JRE (1.5):

The method isEmpty() is undefined for the type String
Comment 9 Markus Keller CLA 2012-04-03 08:01:24 EDT
> Compile error in SimplePushSpecPage.java if compiled against proper JRE 

Tomasz fixed the compile error, but added a useless null check.
Comment 10 Tomasz Zarna CLA 2012-04-03 08:09:20 EDT
(In reply to comment #9)
> Tomasz (...) added a useless null check.

Right, I admit, I haven't read the javadoc for Text#getText(). If I had I would have known it doesn't return null.
Comment 11 Dani Megert CLA 2012-04-23 04:58:09 EDT
Fixed the remaining issue with  https://git.eclipse.org/r/5643
Comment 12 Dani Megert CLA 2012-04-23 05:25:09 EDT
I verified the behavior in 2.0.0.201204191915 and it's not simple to use

1. The remote ref is not pre-filled with my tag.
2. The remote ref content assist shows branches instead of tags which I think
   is wrong.

See attached screenshot.

I would expect that I can simply select the tag, invoke the action and press 'Finish' (or 'Next' + 'Finish').
Comment 13 Dani Megert CLA 2012-04-23 05:33:10 EDT
Created attachment 214375 [details]
Picture of current wizard
Comment 14 Stephan Herrmann CLA 2012-05-17 14:42:22 EDT
(In reply to comment #12)
> I verified the behavior in 2.0.0.201204191915 and it's not simple to use
> 
> 1. The remote ref is not pre-filled with my tag.
> 2. The remote ref content assist shows branches instead of tags which I think
>    is wrong.
> 
> See attached screenshot.
> 
> I would expect that I can simply select the tag, invoke the action and press
> 'Finish' (or 'Next' + 'Finish').

I finally had a chance to try this feature and I agree with Dani that it is not as easy as hoped. While the wizard has only few elements, filling in the text field with only wrong content assist requires more attention / understanding what you are doing than I'd hoped.
Comment 15 Dani Megert CLA 2012-05-21 01:29:14 EDT
*** Bug 358103 has been marked as a duplicate of this bug. ***
Comment 16 Robin Stocker CLA 2013-08-26 09:46:34 EDT
See also the following question:

http://stackoverflow.com/questions/18396182/egit-push-tag-broken

IMO the wizard should only allow selecting a remote and then show a confirmation page, that's it. I plan to have a stab at implementing this soon.
Comment 17 Stephan Herrmann CLA 2013-08-26 09:56:05 EDT
(In reply to comment #16)
> IMO the wizard should only allow selecting a remote and then show a
> confirmation page, that's it. I plan to have a stab at implementing this
> soon.

Hurray! :)
Comment 18 Robin Stocker CLA 2013-11-22 08:36:21 EST
Pushed changes to implement this:

https://git.eclipse.org/r/18723 (remove some duplication)
https://git.eclipse.org/r/18724 ("Push Tags" wizard)
Comment 19 Matthias Sohn CLA 2013-11-22 17:20:05 EST
(In reply to Robin Stocker from comment #18)
> Pushed changes to implement this:
> 
> https://git.eclipse.org/r/18723 (remove some duplication)

merged as dd15ed98779b602d49c71cc3f13a7fb7989d68c6
Comment 20 Matthias Sohn CLA 2013-11-30 20:11:18 EST
(In reply to Robin Stocker from comment #18)
> Pushed changes to implement this:
> https://git.eclipse.org/r/18724 ("Push Tags" wizard)

merged as 4db03b082f5cb7884ae4710e763cef8f5845e1fb
Comment 21 Robin Stocker CLA 2013-12-01 09:27:02 EST
Created attachment 237886 [details]
screenshot of new "Push Tags" wizard

For reference, here's how the wizard looks with the above change for EGit 3.2.