Fix "Compare with commit..." when project is root of working dir

Also extends Javadoc of getRepoRelativePath to mention that "" is
returned in that case.

Bug: 399266
Change-Id: I3b7a0da1cfaa31b2cea95a8754e270ac3340c719
Make sure cancel of INDEX_DIFF_CACHE_UPDATE job is finished

Otherwise the job could still be running when the workspace is closed.

Bug: 361096
Change-Id: I4b2c354c269f8e06572c440d9a68fd832528ddf8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Do not replace Change-Id in commit message in case of a conflict

When cherry-pick results in a conflict and the user adds the conflicting
file to the index egit replaced the existing Change-Id with an empty
one. This is not what the user expects.

Bug: 367416
Change-Id: I10837703f35dbc64a5b9e1a04fa38fd076b71ada
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Only return existing IFile from getFileForLocation

In a nested project layout, e.g.:

  root/
    .project
    sub/
      .project
      a.txt

"sub" is not necessarily excluded from root with resource filters.

So when calling ResourceUtil.getFileForLocation for a.txt,
IWorkspaceRoot#getFileForLocation (before this change) would return an
IFile belonging to the root project, even when it was closed. When the
project is closed, IFile returns false from exists() and later results
in the RepositoryMapping not being found.

One way to fix this would be to only return the IFile if it exists(),
and return null otherwise.

But in the above case, we can return an IFile that exists, from the sub
project. To find this, we call findFilesForLocationURI and then return
the first file which exists.

This fixes the reported problem while also including linked resources,
which is desired in the future.

Bug: 397396
Change-Id: I04cbcea45f110a60410229333c180fe997927c5b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Customize diff file headlines in diff tab of commit viewer

The font, foreground color and background color of the first line of a 
file diff can be customized for the diff tab in the commit viewer.
Default background color of the first line is set to RGB(170,170,170)

Depends on jgit's change: I9dd5eb964ed8b6869745c3162159b7425ac2c44a

Bug: 397723
Change-Id: Ia61398146c0336ab332234f24d341561292554db
Signed-off-by: Tobias Pfeifer <to.pfeifer@sap.com>
Look for a ChangeId in the footer, not in the body

Use the new util method from ChangeIdUtil to find the correct index of
the ChangeId entry in the commit message footer. 

Depends on jgit's change I87ecca009ca3bff1ca0de3c436ebd95736bf5a10.

Change-Id: I4b35236f6602ee5ef8a3fbc6c7f4ce56d1285a8a
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
EGit v2.3.0.201302060400-rc1

Change-Id: Ic39b61bc958c8ae1153725d9660f720641bc0599
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Prepare post 2.3 rc1 builds

Change-Id: I0d93402f50837b92dbea68f46f40c3b4b990cb83
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Prevent IO_FAILURE by checking for conflicts in ref name validation

E.g. "a/1" is a conflict if "a" already exists, "b" is a conflict if
"b/1" already exists.

With the JGit change that this depends on, we can even show the user
which existing refs cause the conflict.

Bug: 393914
JGit-Dependency: I11e0ba2f300adb8b3612943c304ba68bbe73db8a
Change-Id: Ibea9984121ae88c488858b8a8e73b593195b15e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Add checkbox to Import Projects page for nested project search

Sometimes it's useful to be able to disable this, so add a checkbox just
like in the normal Eclipse Import Projects page.

Bug: 399277
Change-Id: I819757023435caae803cdc209c01d271e5b1940c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
[historyView] Highlight filtered files in file diff viewer

The fix for bug 360073 changed the History view file diff viewer to show
all files of a commit, regardless of the resource filter. This made it
sometimes hard to find the files that the filter is focused on.

This change improves that by rendering the files that are not matched by
the filter in gray. The matching files are rendered in the same color as
before. With this, the files can be found at a glance instead of reading
through the paths.

Bug: 393610
JGit-Dependency: Icf911fe6fca131b2567514f54d66636a44561af1
Change-Id: I03da4b38d1591495cb290909f0e4c6e52270e97f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Mark .git team private when re-mapping a repository

EGit only marked the repository as team private when freshly sharing a
project with the git team provider but not when re-mapping an already
shared project after Eclipse restart.

Change-Id: Ied6c1d4698749e6d6f38e65362211df067f739ad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change table in commit dialog to filtered tree

A filtered tree improves the usability by allowing users to filter the
content of the changed files. A special filtered tree implementation
available in EGit is used in order to remember selections for filtered
elements.

Bug: 366175
Change-Id: I2ac762dd31890631e660cc588e8898941ec5e0e5
Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Show error to user if staging fails

Just logging is not enough

Bug 374695
Change-Id: I7db5417bcd86fbd3bbf0c1e4064130e8c54e2b99
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Remember "Search for nested projects" checkbox state in import wizards

Bug: 400202
Change-Id: Ia7b578b8e2fe79056159c5eef7af5045b173065f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Enable reuse of isIgnored(IPath) check

Change-Id: I05f427a6f6faab11438226fab3410ba78c753fc1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
Auto-ignore derived resources

Automatically ignore derived resources. Register a resource change
listener to detect resources marked as derived asynchronously.
Auto-ignore can be switched off using a new preference.

Bug: 297674
Change-Id: I02d0e12e9bee94b1121a1fa57eedfc268dd8e5ef
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
Unregister project auto-sharing listener on shutdown

Change-Id: I2e64b2835e39dc810e2f3ebc6c619e4b5a77f715
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
When staging a missing file only remove it from index

If a resource is in state MISSING there is no need to delete it from the
working tree. This maybe related to bug 400513.

Bug: 400513
Change-Id: Ic95c3e64310ead913420dffbd06152b3dcfcd798
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
Mark org.eclipse.debug.ui as optional dependency

Debug.ui dependency is used only for showing dialog with all available
properties for convenient configuration of default repository folder.
This also makes creating standalone EGit client harder and increase its
weight.

This patch mark this dependency as optional and will hide 'Variable...'
button when StringVariableSelectionDialog class cannot be found on
classpath.

Change-Id: Ifea5bd8b94f948af8a93842d28f273a8aa89098a
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>