DESCRIPTION

Add tagging support

Added tagging support to branch dialog. Now we can easily create new
tags and rename them using UI.

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


COMMENTS

author: Leslie Stephenson
date: 2010-04-20 05:46:45.000000000

Uploaded patch set 3.

-------------------------------------
author: Leslie Stephenson
date: 2010-04-20 05:48:21.000000000

Patch Set 3: No score

Patch set rebased.

-------------------------------------
author: Jaylon Avila
date: 2010-04-20 11:43:53.000000000

Patch Set 3: No score

It seems to me that TagInputDialog, which has code copy/pasted from BranchSelectionDialog, suffers from the same problem that's described change 580.
http://egit.eclipse.org/r/580

Also, I think it would make more sense if there were two separate actions for tagging and branching instead of stuffing them both in the same dialog. If they both need to go in the same dialog, then I think we need to put the branch/tag/rename buttons off to the right of the table instead of having all of them at the bottom. Five buttons is a lot for the bottom of a dialog and I don't think I've seen that anywhere in the Eclipse SDK.

-------------------------------------
author: Douglas Trujillo
date: 2010-04-20 11:44:23.000000000

Patch Set 3: I would prefer that you didn't submit this; No score

This implements tag -a, right ? Lightweight and signed tags are not yet supported.
I think you should mention that in the commit message.

The layout of the BranchSelectionDialog sucks, buttons have random size
and are distributed randomly on the dialog. Your new button "New tag" follows 
this bad tradition ...See http://egit.eclipse.org/r/#change,578
which intends to improve that. 

What about deleting a tag ?

Tagging of non-HEAD commits isn't yet possible, right ?

Wouldn't it be a good idea to also allow editing the tag message when renaming a tag ?
This would be something like tag -f from command line git.

Show Resource history is broken by your change :
- create a tag
- in package explorer select some file and Team > Show in Resource History
this throws :
java.lang.NumberFormatException: For input string: "1761820 +0200"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:458)
at java.lang.Integer.parseInt(Integer.java:499)
at org.eclipse.jgit.lib.PersonIdent.<init>(PersonIdent.java:220)
at org.eclipse.jgit.lib.Tag.decode(Tag.java:161)
at org.eclipse.jgit.lib.Tag.getTagger(Tag.java:242)
at org.eclipse.jgit.revplot.PlotWalk$PlotRefComparator.timeof(PlotWalk.java:135)
at org.eclipse.jgit.revplot.PlotWalk$PlotRefComparator.compare(PlotWalk.java:120)
at org.eclipse.jgit.revplot.PlotWalk$PlotRefComparator.compare(PlotWalk.java:1)
at java.util.Arrays.mergeSort(Arrays.java:1270)
at java.util.Arrays.sort(Arrays.java:1210)
at org.eclipse.jgit.revplot.PlotWalk.getTags(PlotWalk.java:109)
at org.eclipse.egit.ui.internal.history.SWTWalk.createCommit(SWTWalk.java:23)
at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:736)
at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:660)
at org.eclipse.egit.ui.internal.history.GitHistoryPage.inputSet(GitHistoryPage.java:908)
at org.eclipse.team.ui.history.HistoryPage.setInput(HistoryPage.java:59)
at org.eclipse.egit.ui.internal.history.GitHistoryPage.setInput(GitHistoryPage.java:831)
at org.eclipse.team.internal.ui.history.GenericHistoryView.showHistoryPageFor(GenericHistoryView.java:738)
at org.eclipse.team.internal.ui.history.GenericHistoryView.showHistory(GenericHistoryView.java:969)
at org.eclipse.team.internal.ui.history.GenericHistoryView.access$3(GenericHistoryView.java:965)
at org.eclipse.team.internal.ui.history.GenericHistoryView$3.selectionChanged(GenericHistoryView.java:433)
at org.eclipse.ui.internal.AbstractSelectionService.firePostSelection(AbstractSelectionService.java:179)
at org.eclipse.ui.internal.AbstractSelectionService.setActivePart(AbstractSelectionService.java:289)
at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:60)
at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:136)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3537)
at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:3077)
at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:279)
at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:237)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1050)

-------------------------------------
author: Leslie Stephenson
date: 2010-04-20 13:31:09.000000000

Patch Set 3:

@Jaylon Avila

Input validator was taken from BranchSelectionDialog.getRefNameInputDialog(), that is directly described in TagInputDialog source code.

I've also was wondering would it be better to have tag's and branches in one dialog or maybe split it into two separate dialog's/action's. As you see I've finally decided to keep it in one place, generally because branches and tag's ware already meshed up in one place. But maybe that is a good idea to separate it right now.

@Douglas Trujillo

Yes, this is only implementation for annotated, unsigned tags. Good point I'll add this information to commit message on next push.

> What about deleting a tag ?
It is unsupported, same as branch deleting. In case of adding this feature I'll suggest to separate support for branch and tag's into two different action, as already Jaylon Avila suggested. What do you think?

> Tagging of non-HEAD commits isn't yet possible, right ?
I don't understood what you mean by "non-HEAD commits", could you explain that ?

> Wouldn't it be a good idea to also allow editing the tag message when renaming a tag ? This would be something like tag -f from command line git.
Yes, this also a good idea same as tag deleting. But in my humble opinion it would be better if that two new features would be added to separate dialog. Implementing it in BranchSelectionDialog class will increase it complexity.

> Show Resource history is broken by your change

I've didn't check "Resource history", my fault. I'll fix it.

I'll work on that patch this evening!

-------------------------------------
author: Leslie Stephenson
date: 2010-04-20 18:43:26.000000000

Patch Set 3:

@Matthias

I can't reproduce this issue with NumberFormatException. Here is a list of steps that I've made (everything was done from EGti):
* create a new project
* initialized git repository
* add a file and commit it
* create a tag
* select that file and choose Team -> Show in Resource History
There was no exceptions, everything went well. I've even added two more tag's, and same as before there was no exceptions.

Then using git cat-file I've compare tag object created from eclipse with one created with CGit and there was no difference in semantics of that objects.

I've tested it on JGit v0.7.1-34-gf36df5d and EGit v0.7.1-67-gebbaf06 (in case of EGit this is version of master branch that was merged with my changes).

Maybe this issue exists only on specific system/configuration ?

-------------------------------------
author: Douglas Trujillo
date: 2010-04-25 22:47:27.000000000

Patch Set 3:

I started another try from a new fresh workspace:

- start test IDE containing your change
- clone egit from git://egit.eclipse.org/egit.git
- create a tag test-1 on egit
- select project org.eclipse.egit in package explorer
- Team > Show in Resource History

-> NumberFormatException in error log, this time the input string is  "2235249 +0200"

-------------------------------------
author: Anonymous Coward
date: 2010-04-26 09:49:18.000000000

Patch Set 3: No score

Dariusz, can you try changing your computer's time zone ? This is one possible cause of differences in formatting dates.

-------------------------------------
author: Douglas Trujillo
date: 2010-04-26 21:20:23.000000000

Patch Set 3: No score

I had a wrongly configured user.email setting having extra < > brackets around my email address which lead to parsing errors in the jgit code reading tags which is called when displaying resource history containing tags. I believe this caused the mentioned NumberFormatException. I will retry with correct configuration.

-------------------------------------
author: Malia Sampson
date: 2010-04-26 21:22:01.000000000

Patch Set 3: No score; No score

Someone will need to rebase the changes also.

-------------------------------------
author: Malia Sampson
date: 2010-04-26 21:22:28.000000000

Patch Set 3:

Matthias, we should probably open a bug to make sure EGit does some sanity checks about user.email

-------------------------------------
author: Leslie Stephenson
date: 2010-04-26 21:42:38.000000000

Patch Set 3:

I'll rebase it when I finish working on new patch set.

Now it'll be more like CVS tagging dialog. IMHO it would be more useful.

-------------------------------------
author: Malia Sampson
date: 2010-04-26 21:44:22.000000000

Patch Set 3:

Thanks, we should also have an explicit "Tag..." option in the menu :)

-------------------------------------
author: Leslie Stephenson
date: 2010-04-26 21:53:49.000000000

Patch Set 3:

Yes, this will also be included in next patch set.

-------------------------------------
author: Malia Sampson
date: 2010-04-27 17:52:58.000000000

Patch Set 3:

Ok, I look forward to your next patch :)

Is there a bug # associated with this feature?

If so, make sure to include it in the commit message.

-------------------------------------
author: Leslie Stephenson
date: 2010-04-27 18:02:26.000000000

Patch Set 3:

I've plan to push my changes before Saturday.

As far as I know there is no corresponding bug for this feature. I'll create one and add it co commit message as it should be ;).

-------------------------------------
author: Douglas Trujillo
date: 2010-04-27 22:32:38.000000000

Patch Set 3:

I created https://bugs.eclipse.org/bugs/show_bug.cgi?id=310735 to track the problems caused by incorrect user.email configuration.

-------------------------------------
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.

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