DESCRIPTION

Provide access to the absolute path of the git storages

We've implemented IStorage#getFullPath() in such a way that the
underlying resource is unresolveable for any client not aware of git
innards. This opens a new API to allow such clients a workaround so
that they may access the path if the needs arises.

Change-Id: I70724413c79f4756cdaffaa4229f4d9a1d8082e5
Signed-off-by: Gustavo Green xxx@xxx.xxx


COMMENTS

author: Gustavo Green
date: 2014-11-19 11:31:26.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2014-11-19 11:31:32.000000000

Patch Set 4:

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

-------------------------------------
author: Brenden Conley
date: 2014-11-19 11:46:48.000000000

Patch Set 4: Verified+1

Build Successful 

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

-------------------------------------
author: Juliet Cantu
date: 2014-11-29 17:09:04.000000000

Patch Set 4:

(2 comments)

Line:47, org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java -> why not keep the name blobId, since this will always refer to a blob?

Line:10, /COMMIT_MSG -> Do you have any background info on the problem?

-------------------------------------
author: Gustavo Green
date: 2014-12-01 09:24:37.000000000

Patch Set 4:

(2 comments)

Line:47, org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java -> This is a refactoring from my side that sneaked in when I split the commit. I'll revert this asap since it adds nothing to this change.

Line:10, /COMMIT_MSG -> Well... when a "full path" to a resource looks like "file.ext Index" or "file.ext <commit SHA1>", it is obvious that a third-party client won't be able to tell that what's after the whitespace is not part of the path, but just an info EGit has appended to it. So there is "something" at the end of the path that needs be trimmed to make it resolveable.

Furthermore, there is also "something" at the beginning of the path that needs to be trimmed : the IndexBlobStorage and CommitBlobStorage paths look like "<repo name>/<workspace relative path> <SHA-1 or "Index">". A third-party plugin, rooted in the "eclipse" environment and aware of the workspace, can only resolve workspace relative paths. Knownledge of anything outside of that (the repository's folder name) or a git-specific kind of path (with the SHA appended) isn't available to them.

I haven't changed the "fullpath" implementation though, since the commit message of when those were created indicates that it was done to avoid issues with the compare editor's dirty state. Furthermore, EGit has knowledge about files that aren't in the workspace, for which a workspace-relative path makes no sense (which is probably why the repo name is used as the starting point for the storages).

You can see a few example of what clumsy workarounds a third-party plugins needs to go through in order to make sense of these fullpaths on my change in EMF Compare that uses this one: https://git.eclipse.org/r/#/c/36025/ . For example in https://git.eclipse.org/r/#/c/36025/4/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/RevisionedURIConverter.java or https://git.eclipse.org/r/#/c/36025/4/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/utils/ResourceUtil.java ... that were far from being fool-proof anyway.

You can see another example of a third-party plugin trying to resolve (and failing to do so) such paths on bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=354801.

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