DESCRIPTION

Assume path not found by the treewalk as ignored path

RepositoryUtil.isIgnored(path) is used to check if the resource should
be added to the .gitignore by IgnoreDerivedResources and
IgnoreOperation.

However if the TreeWalk can't *find* the path "isIgnored" returns
"false", but probably should return "true" in the same way as if the
mapping were missing.

Bug: 470820
Change-Id: Id732684999da1561bc3812fdb2daeee7a5fae369
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Jayvion Booth
date: 2015-06-28 19:09:04.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2015-06-28 19:09:11.000000000

Patch Set 2:

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

-------------------------------------
author: Brenden Conley
date: 2015-06-28 19:40:40.000000000

Patch Set 2: Verified-1

Build Failed 

https://hudson.eclipse.org/egit/job/egit.gerrit/7200/ : ABORTED

-------------------------------------
author: Brenden Conley
date: 2015-06-28 20:38:08.000000000

Patch Set 2: -Verified

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

-------------------------------------
author: Brenden Conley
date: 2015-06-28 20:57:18.000000000

Patch Set 2: Verified+1

Build Successful 

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

-------------------------------------
author: Zachary Orozco
date: 2015-06-29 07:44:26.000000000

Patch Set 2:

What happens if I have a project and I delete the subtree src/test. Previously there have been versioned resources underneath that, e.g. src/test/A.java. After this deletion I ask for isIgnored("src/test/A.java"). Since the walk we are using is looking at the working tree (and not also at Index or HEAD) this path will not be found anymore. But I wouldn't say this path "src/test/A.java" should be ignored from now on. What happens if a minute later I recreate the file "src/test/A.java". I would expect that it appears again in staging view as modified resource. If we add that path to .gitignore we wouldn't see this behaviour.

-------------------------------------
author: Jayvion Booth
date: 2015-06-29 08:03:44.000000000

Patch Set 2:

RepositoryUtil.isIgnored(path) currently is used by two clients, both of them are using it to check if the path is included in the ignore rules - and if it is not included, they add this path to the .gitignore.

I think that the method should be renamed and signature changed to something like:
Boolean RepositoryUtil.isInIgnoredRules(path)
where the boolean would be a tri-state:
 * null: no idea, decide by yourself
 * true: definitely in .gitignore
 * false: definitely not in .gitignore

-------------------------------------
author: Zachary Orozco
date: 2015-06-29 09:06:34.000000000

Patch Set 2:

Which semantic do you expect if the working tree contains only one single file. A file name ".gitignore" with a single line of content: "/src/test/*". There is no folder "/src" currently in the workingtree. If you now ask for RepositoryUtil.isInIgnoredRules("src/test/A.java") what should it return. Should tell "true" because the path is in the ignore rules although the path can't be found by a workingtreeiterator. What do you think?

-------------------------------------
author: Douglas Trujillo
date: 2015-07-02 14:58:40.000000000

Patch Set 2: Code-Review-1

(1 comment)

Line:499, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> I am ok with that if it's fixing the problem, though this behavior should be mentioned in the javadoc for this method

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