DESCRIPTION

Fix 'Init Git Flow' appearing when it shouldn't

The menu entry in the team menu was visible on closed projects, or also
on projects not shared with git at all.

Bug: 476821
Change-Id: I32368c95ae4be0975ca5860a25763cc30c20095b
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2015-12-08 08:30:50.000000000

Uploaded patch set 4: Patch Set 3 was rebased.

-------------------------------------
author: Brenden Conley
date: 2015-12-08 08:30:56.000000000

Patch Set 4:

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

-------------------------------------
author: Douglas Trujillo
date: 2015-12-08 08:31:18.000000000

Patch Set 4: Code-Review+2

-------------------------------------
author: Alayna Houston
date: 2015-12-08 08:54:53.000000000

Patch Set 4:

(1 comment)

Line:591, org.eclipse.egit.gitflow.ui/plugin.xml -> Oops? Matthias, I'm away from my computer now, so I can't check myself: does the "Init Git Flow" command not just display correctly but also actually _work_ on a Java project? Occurred to me just now... and I'm not sure anymore.

I changed this so that the menu entry would display correctly also for IJavaProject elements in the project explorer, but I suspect this needs a change in GitFlowHandlerUtil. Something like

  Repository repository = AdapterUtils.adapt(firstElement,
				Repository.class);
  if (repository == null) {
    // Try harder :-)
    IResource resource = AdapterUtils.adapt(firstElement, IResource.class);
    if (resource != null) {
       repository = AdapterUtils.adapt(resource, Repository.class);
    }
  }

The point is that the GitFlowAdapterFactory won't adapt an IJavaProject. Could you check, please? If not, I'll re-check tonight and if necessary post a follow-up change.

-------------------------------------
author: Brenden Conley
date: 2015-12-08 08:55:39.000000000

Patch Set 4: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2015-12-08 09:22:13.000000000

Patch Set 4: Code-Review-1

gitflow init works from project explorer and repositories view but not from package explorer hence changing my vote to -1

-------------------------------------
author: Jamarion Hunt
date: 2015-12-08 10:12:08.000000000

Patch Set 4:

(1 comment)

Line:591, org.eclipse.egit.gitflow.ui/plugin.xml xxx@xxx.xxx thanks for your patch!
Please don't put too much effort into this particular issue, though. I currently have 5 outgoing commits which will fix this and several other issues regarding command enablement.
I yet have to test it thouroughly though.
I'll push until the end of the week.

-------------------------------------
author: Alayna Houston
date: 2015-12-08 19:57:29.000000000

Patch Set 4:

(1 comment)

Line:591, org.eclipse.egit.gitflow.ui/plugin.xml -> Ok, I'll leave it alone now. Looking forward to your patches. Stumbled over this in another context and had seen it was assigned to you since September, but still unresolved...

I just couldn't leave this particular fix in a buggy state, so I did the change I had outlined above. Works nicely, and should be safe, since all GitFlow handlers (and only those) call this GitFlowHandlerUtil.

Just a minor additional point (not fixed): "Init Git Flow" opens a dialog; the menu entry should thus IMO be "Init Git Flow...", and likewise for any other menu entries that result in dialogs requiring further user input.

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