DESCRIPTION

Alleviate problems on case-insensitive file systems

We have _no_ foolproof way to correctly compare paths:

* IPath treats paths always case-sensitively, both in equals()
  and in isPrefixOf(), which can give rise to unexpected problems
  on case-insensitive file systems such as NTFS on Windows or HFS+
  on OS X.
* java.io.File considers HFS+ (Mac) a case-sensitive UnixFileSystem,
  which is incorrect. (HFS+ can be either, and by default on Macs
  is case-insensitive.) On Windows, File is indeed case-insensitive.
* java.nio.file.Path also uses a case-sensitive sun.nio.fs.UnixPath
  on HFS+. On Windows, it is case-insensitive.
* org.eclipse.jgit.util.FS_POSIX.isCaseSensitive() returns
  unconditionally false for Macs. However, HFS+ partitions _can_ be
  case-sensitive. Furthermore, org.eclipse.jgit.util.FS doesn't have
  operations for case-normalization.
* org.eclipse.core.internal.resources.Project sets the project location
  to the canonicalized file path. File.getCanonicalFile() does appear
  to normalize capitalization to the form actually used in the file
  system.
* Many places in EGit do path comparisons between Eclipse IResources
  and git working trees using any of the possibilities above.
  
Options to fix this are:
* Use java.io.File or java.nio.file.Path, but that would leave HFS+ out
  in the cold. Would require lots of changes throughout EGit to root
  out any uses of comparisons via IPath.
* Write our own comparison and prefix methods. Make sure only those are
  used. Any collections storing paths or files would need to be checked
  and adapted; or maybe we'd even need or own subclass of File...
* Ensure that we use for repositories only the canonical path, like
  Eclipse core does for IProjects, so that the same casing is used.

This change implements the latter. It ensures that EGit and the
Eclipse resource tree both have the same idea of where things are and
should thus resolve most case-sensitivity problems, even if IPath is
used.
  
Bug: 477281
Bug: 478877
Change-Id: I1d29203e678afb3fb43a6fcb334706c9473afc4e
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Alayna Houston
date: 2015-10-18 20:20:02.000000000

Uploaded patch set 3: Commit message was updated.

-------------------------------------
author: Brenden Conley
date: 2015-10-18 20:35:10.000000000

Patch Set 3:

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

-------------------------------------
author: Brenden Conley
date: 2015-10-18 20:58:36.000000000

Patch Set 3: Verified+1

Build Successful 

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

-------------------------------------
author: Jayvion Booth
date: 2015-10-22 05:30:51.000000000

Patch Set 3: Code-Review-1

(1 comment)

File Comment: org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileUtils.java -> I would prefer to see this method in jgit FileUtils class, to avoid explosion of FileUtil* classes in j/egit.
If you create a separated patch for this change, we can merge it upfront and then apply the rest from the patch in egit.
WDYT?

-------------------------------------
author: Alayna Houston
date: 2015-10-22 17:59:37.000000000

Patch Set 3:

(1 comment)

File Comment: org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileUtils.java -> Fine by me. I see that EGit version X does require JGit version X, so doing it that way should not cause trouble, right?

-------------------------------------
author: Jayvion Booth
date: 2015-10-22 18:17:15.000000000

Patch Set 3:

(1 comment)

File Comment: org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileUtils.java -> yes. This patch will first not compile but as soon as jgit change will be merged, it will compile again.

-------------------------------------
author: Jayvion Booth
date: 2015-10-22 18:18:55.000000000

Patch Set 3:

(1 comment)

Line:30, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileUtils.java -> honestly speaking I do not understand the ruturn javadoc. Is a comma or word in the middle missing?

-------------------------------------
author: Alayna Houston
date: 2015-10-22 19:26:57.000000000

Patch Set 3:

(1 comment)

Line:30, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileUtils.java -> Just typos. Hope you find it understandable at jgit: https://git.eclipse.org/r/#/c/58760/

First "of" should have been "or", second "of" was meant to read "or if".

-------------------------------------
author: Gerrit Johnathan Pham
date: 2015-10-22 20:42:34.000000000

Change has been successfully merged into the git repository by Jayvion Booth

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