Provide extensibility for suggesting branch names

* Add new extension point for branch name suggestions
* Add new extension to provide branch name suggestion from Mylyn task

This change is needed to enable the automatic creation and
checkout of branches based on the active task.

Bug: 309578
Change-Id: I9e26d668617481026c81a05b6ea08b97e28f620b
AlsoBy: Steffen Pingel <steffen.pingel@tasktop.com>
AlsoBy: Manuel Doninger <manuel.doninger@googlemail.com>
Signed-off-by: Steffen Pingel <steffen.pingel@tasktop.com>
Signed-off-by: Gerd Zanker <gerd.zanker@web.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Push Branch: Pre-fill branch name of upstream config if available

In case branch.*.merge is already set, default to that branch name when
starting the wizard.

With that, if the branch is already configured, running the "Push
Branch..." wizard without changing anything should behave the same as
with "Push to Upstream".

Bug: 430454
Change-Id: I51312a4b638b24217c6280aa5d36f3339b11eca1
Signed-off-by: Robin Stocker <robin@nibor.org>
Enable "Push to Upstream" when default remote has push spec

In C Git "git push" also works when the current branch does not have a
upstream configuration, but the default remote ("origin") does have a
push spec. So behave the same in EGit's "Push to Upstream" action.

Also add tests for this and other "Push to Upstream" cases.

Bug: 429743
Change-Id: I306a3d17a556401f7aa2b2e9e0ab9fc3c11cfa89
Signed-off-by: Robin Stocker <robin@nibor.org>
Unregister RebaseInteractiveView from plan on view disposal

The view registers as a RebaseInteractivePlanChangeListener with the
plan, but it never unregistered. After closing the view on a running
interactive rebase and reopening it, it would notify the already
disposed old view, too. This resulted in a "Widget disposed" exception,
e.g. when using the buttons to move commits up or down in the rebase
view.

Also unregisters when another plan is shown.

Change-Id: I67b582e1add240bb4490e26c538f6e30c6c5e6e6
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Continue operation if status is clean

UIRepositoryUtils.handleUncommittedFiles() erraneously returned false if
status was already clean.

Change-Id: I9fe29f8962cc3aea4c7856428a2e94ba49fd8c82
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Add ability to edit a commit directly from the history view.

This adds a new menu item Modify > Edit to the context menu of the
history view. It can be used to edit a commit, then manually amending
the commit afterwards.

An error will be displayed if the selected commit cannot be reached
from the current HEAD commit. This is done so as to avoid the need
to checkout another commit automatically before executing the edit
procedure.

CQ: 8158
Bug: 431751
Change-Id: Idef404f2d712cccb862a7eb11571a7a4151badb8
Signed-off-by: Maik Schreiber <blizzy@blizzy.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Prevent race conditions when reloading StagingView

Clearing and resetting paths asynchronously may lead to NPEs caused by
race conditions.

Bug: 432090
Change-Id: Iddb640e4f7900da178956a4dc3de2b00dc766828
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Return null if element type can't be determined

Bug: 428380
Change-Id: I439bb68ad68c0313a8457eb43d1a4b106e7bf878
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Reload the staging view before setting amend option

This ensures that the staging view has the correct repository as input.

Bug: 432090
Change-Id: I8f16e060da7e8e85cacbda06b6000b0b113bcad4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
[reflogView] Offer to reset to a reflog entry via the context menu

Bug: 431471
Change-Id: Iaead94752d7a69cd4430447f5d1e78b40ba613ba
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Fix GitQuickDiffProvider creating multiple GitDocuments for resource

getReference didn't check whether a document was already created, and
just created a new one, overwriting the already existing one.

This resulted in the existing GitDocument never being disposed, which in
turn caused unnecessary work being done in GitDocument#onRefsChanged,
slowing down operations.

That GitQuickDiffProvider#getReference can be called multiple times can
be seen by adding a breakpoint and then doing this:

1. Show annotations in a tracked file -> first call
2. Edit the file
3. Commit the changes -> second call

The check for RepositoryProvider can be removed as it's done anyway in
GitDocument.create.

Bug: 413497
Change-Id: Iad7b39b85e365a7729316b6dbbbe99c25057147c
Signed-off-by: Robin Stocker <robin@nibor.org>