DESCRIPTION

Add tagging UI support

Implements UI for unsigned and annotated tags. This implementation
allows user to select with commit object should be associated with
created tag. List of all commits is available in 'Advanced' section of
dialog. There is a special combo widget that can suggest commits based
on typed in commit SHA-1 or part from first line of commit message. User
can also edit/overwrite message or associated commit of existing tag by
selecting it from existing tag list (this list can be found in 'Details'
section) and marking 'Overwrite existing tag' check box.

By default tag is created for current HEAD, this can be changed in
'Advanced' section.

Tag dialog is available in project's context menu ('Team->Tag...').

CQ: 4073
Bug: 311262

Signed-off-by: Leslie Stephenson xxx@xxx.xxx
Change-Id: Icb30655845d1e1198e59992a10148421ab9f9bd5


COMMENTS

author: Leslie Stephenson
date: 2010-05-08 09:33:38.000000000

Uploaded patch set 6.

-------------------------------------
author: Jaylon Avila
date: 2010-05-08 16:48:26.000000000

Patch Set 6: No score

There are some issues with the dialog's margins. I've attached a screenshot to bug 311262.

Line:64, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> I am not sure subclassing InputDialog for such a complicated user interface is such a great idea.

Line:145, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> The dialog is not resizable.

Line:318, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> This has the same eager enablement problem that I described before.

1. Make a tag.
2. Select an existing tag.
3. Check the 'Force replace existing tag.' checkbox.
4. Delete the name.
5. Uncheck the 'Force replace existing tag.' checkbox.
6. Check the 'Force replace existing tag.' checkbox.
7. The 'OK' button is now enabled, click it.

org.eclipse.team.core.TeamException: Tag  creation failed
	at org.eclipse.egit.core.op.TagOperation.updateRepo(TagOperation.java:83)
	at org.eclipse.egit.core.op.TagOperation.execute(TagOperation.java:64)
	at org.eclipse.egit.ui.internal.actions.TagAction$1.run(TagAction.java:111)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Line:368, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> What is there to gain by introducing columns when there is only one column? See change 597 for a previous bug caused by the introduction of columns.

Line:689, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> Don't end with a period in this case.

-------------------------------------
author: Leslie Stephenson
date: 2010-05-08 20:15:40.000000000

Patch Set 6: No score



Line:64, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> Good hint!

This is an "old" part from second or third patch set. Subclassing InputDialog give us only tag name validation and displaying message when it isn't valid. Now when this dialog is already complicated we can also implement validation not even for tag name but also for tag message.

Line:145, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> I'm not quite sure does it should be resizable. We don't have here much data to present so that we need to resize this dialog to have better overview.

Line:318, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> I'll check that.

Line:368, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> Done

Line:689, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> Done

-------------------------------------
author: Juliet Cantu
date: 2010-05-08 20:33:48.000000000

Patch Set 6: No score; No score

Quite close now.

Start considering automatic unit tests. We are short of them. Separating the operation and UI tests is /probably/ a good idea, but this varies from case to case.

Line:55, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> These three classes (above) are not in Eclipse 3.4

Line:143, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java -> Does it have to be public?

Line:147, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java -> perhaps we should use revCommit.abbreviate() here, though it yields 8 digits

Line:156, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java -> index of item in check box

Line:189, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java -> Why not the more straightforward objectId == null? (this isn't C)

Line:51, org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java -> spelling: which

Line:31, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> nitpick: extra empy line

Line:42, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> We usually write something trivial nice looking here. "Construct TagOperation" or something very brief

Line:45, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> "<code>true</code> top replace existing tag with same name

Line:50, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> tagName is redundant.  Use local variablesl later on if necessary

Line:52, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> refName is redundant. Use local variablesl later on if necessary

Line:77, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Hmm. do we log tags? Probably a good idea but C Git doesn't.

Line:84, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Some hint about why the operation failed would be nice to the user.

Line:165, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagAction.java -> Not sure what happens here. Hopes it makes sense to skip error handling

-------------------------------------
author: Juliet Cantu
date: 2010-05-08 20:34:30.000000000

Patch Set 6: I would prefer that you didn't submit this



-------------------------------------
author: Malia Sampson
date: 2010-05-08 20:47:11.000000000

Patch Set 6: No score; No score

Hey guys, not to be the evil pragmatic guy here, but can we get a minimum level of functionality that's acceptable and then get the CQ moving on this feature? Ideally I'd like to get this in for 0.8.0 and would prefer the CQ started soon. We can always polish this feature in the future without the need of a CQ :)

-------------------------------------
author: Juliet Cantu
date: 2010-05-08 20:48:52.000000000

Patch Set 6:

Chris: I think we can merge it without unit tests, if that is what you are thinking about.

-------------------------------------
author: Leslie Stephenson
date: 2010-05-08 21:00:53.000000000

Patch Set 6:

In my humble opinion writing UI unit tests before we establish how UI should look like, behavior and what features should be implemented is worthless. Because that I haven't implement them as well as documentation for this dialog but I have both of them in my mind. I'll move on with documentation and junits when this dialog will be concrete.

-------------------------------------
author: Jaylon Avila
date: 2010-05-08 21:07:45.000000000

Patch Set 6:

EGit team, merge it whenever you all feel like it's good to go.

As an outsider, I will always, and continue to, comment with '0 no score' so it doesn't "skew" the system and make it seem like something was delivered with a -1 vote.

-------------------------------------
author: Douglas Trujillo
date: 2010-05-08 22:59:34.000000000

Patch Set 6: No score; No score

- if trying to replace an existing tag the OK button is only enabled if the tag name is changed, but if I just want to amend the tag message or move the tag to another commit the button should be also enabled, right ?

I would say: fix the remaining issues which have been raised and we are ready to go for the CQ. The remaining stuff, especially tests (not only UI but also EGit core tests are maybe an option here) can be taken up in the next step.

Line:145, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> I saw repositories with tons of tags, so the list of existing tags could be very long.

-------------------------------------
author: Leslie Stephenson
date: 2010-05-08 23:17:25.000000000

Patch Set 6:

I'm almost done with "OK" button. Issue mentioned by Remy is now fixed, but one that Matthias picked up is still existing. I'll work on it tomorrow and I think that until tomorrow evening I'll send new patch set.

Right now I'm not quite sure what done with ExpandableComposite and Expansion(Event/Adapter), I don't want to implement on my own, and copying them inside EGit is also not an option. Maybe someone has some ideas or suggestions in this case ?

Line:64, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> Done

Line:145, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> In this case there should appear a scroll bar so that user can scroll list of existing tags.

Line:318, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> Done

Line:143, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java -> If we want to reuse this widget somewhere else then yes, it should be public.

Line:147, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java -> I don't want to mix up UI code with operation's on repository. Proposed revCommit.abbreviate() takes repository as a parameter so in this case I don't want to use it here. But we can substring commit SHA-1 to 8 characters instead of 6.

Line:156, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java -> Done

Line:189, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java -> OK

Line:51, org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java -> Done

Line:31, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Done

Line:42, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Done

Line:45, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Done

Line:50, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Done

Line:52, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Done

Line:77, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Right, if C Git doesn't log that we also shouldn't.
Line removed.
Done.

Line:84, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Yes, it would be nice, but right now I don't see simple solution to achieve that. Here we have only enum value without any 'human readable' message.

Line:165, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagAction.java -> Yes this piece of code is strange ... I've removed this method.

-------------------------------------
author: Douglas Trujillo
date: 2010-05-09 00:01:39.000000000

Patch Set 6:

some more language nits

Line:679, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> s/Tagging/tagging/

Line:681, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> s/occurs/occurred/

Line:693, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> better: 
In the advanced section you may choose the commit to be tagged.

Line:695, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> s/filer/filter/

-------------------------------------
author: Jaylon Avila
date: 2010-05-09 00:13:11.000000000

Patch Set 6:

Those classes should've been around since 3.0. I certainly see them in 3.4's javadocs anyway.
http://help.eclipse.org/ganymede/nftopic/org.eclipse.platform.doc.isv/reference/api/index.html

-------------------------------------
author: Juliet Cantu
date: 2010-05-09 07:46:27.000000000

Patch Set 6:

Dariusz wrote: In my humble opinion writing UI unit tests before we establish how UI should look like, behavior and what features should be implemented is worthless. Because that I haven't implement them as well as documentation for this dialog but I have both of them in my mind. I'll move on with documentation and junits when this dialog will be concrete.

That's why I used the term "consider" :)

-------------------------------------
author: Juliet Cantu
date: 2010-05-09 08:35:43.000000000

Patch Set 6:

Issue#1: I see no buttons in the dialog. Could it bee that it starts out taller than my screen (lots of build tags). When I resize the window there are still no buttons.

Issue#2: Clicking on an un-annotated tag gives an error
java.lang.IllegalArgumentException: Argument cannot be null
at org.eclipse.swt.SWT.error(SWT.java:3761)
at org.eclipse.swt.SWT.error(SWT.java:3695)
at org.eclipse.swt.SWT.error(SWT.java:3666)
at org.eclipse.swt.widgets.Widget.error(Widget.java:446)
at org.eclipse.swt.widgets.Text.setText(Text.java:1894)
at org.eclipse.egit.ui.internal.dialogs.CreateTagDialog.setTagImpl(CreateTagDialog.java:422)
at org.eclipse.egit.ui.internal.dialogs.CreateTagDialog.fillTagDialog(CreateTagDialog.java:416)
at org.eclipse.egit.ui.internal.dialogs.CreateTagDialog.access$7(CreateTagDialog.java:402)
at org.eclipse.egit.ui.internal.dialogs.CreateTagDialog$5.selectionChanged(CreateTagDialog.java:375)

-------------------------------------
author: Juliet Cantu
date: 2010-05-09 08:41:29.000000000

Patch Set 6:

I didn't resize the the dialog, I just assumed I did. Most dialogs in Eclipse are resizable. Why not this one?

The only thing I see in the dialog is some internal borders and a long list of tags (to the right).

-------------------------------------
author: Leslie Stephenson
date: 2010-05-09 18:45:39.000000000

Patch Set 6:

@Robin:
Issue#1: Very strange. I never had such situation and I doubt that I could reproduce that. Could you be more specific how it can be reproduce ?

Issue#2: I never consider editing or reviewing un-annotated tags, so this is main cause why it does not working. Fixing this will be very easy ;)

Line:55, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> Done

Line:84, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> Done

Line:64, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagAction.java -> I can't agree with you, current repository state (see line 67) is attached to message content. So in this case we inform user what is wrong. But I'm open for any proposition how we can do this better.

Line:136, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagAction.java -> Done

Line:154, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagAction.java -> Done

Line:25, org.eclipse.egit.ui/META-INF/MANIFEST.MF -> Done

Line:679, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> Done

Line:681, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> Done

Line:693, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> Done

Line:695, org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties -> Done

-------------------------------------
author: Gerrit Johnathan Pham
date: 2010-05-12 22:06:46.000000000

Your change could not be merged due to a path conflict.

Please merge (or rebase) the change locally and upload the resolution for review.

-------------------------------------
author: Juliet Cantu
date: 2010-05-09 08:24:36.000000000

MISMATCHED INLINE COMMENT
Line:147, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java -> Ok

-------------------------------------
author: Juliet Cantu
date: 2010-05-09 08:24:36.000000000

MISMATCHED INLINE COMMENT
Line:84, org.eclipse.egit.core/src/org/eclipse/egit/core/op/TagOperation.java -> the name of the result is better than nothing

-------------------------------------
author: Juliet Cantu
date: 2010-05-09 08:24:36.000000000

MISMATCHED INLINE COMMENT
Line:64, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagAction.java -> The underlying error is not displayed or logged.

-------------------------------------
author: Juliet Cantu
date: 2010-05-09 08:24:36.000000000

MISMATCHED INLINE COMMENT
Line:136, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagAction.java -> The underlying error is not displayed or logged.

-------------------------------------
author: Juliet Cantu
date: 2010-05-09 08:24:36.000000000

MISMATCHED INLINE COMMENT
Line:154, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagAction.java -> The underlying error is not displayed or logged.

-------------------------------------
author: Juliet Cantu
date: 2010-05-09 08:24:36.000000000

MISMATCHED INLINE COMMENT
Line:25, org.eclipse.egit.ui/META-INF/MANIFEST.MF -> Here is the problem with the missing classes in 3.4.  This bundle is exported as 3.3.100 in Eclipse 3.4

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