]> source.dussan.org Git - jgit.git/commit
Reimplementation of ignore rule parser 66/31366/8
authorAndrey Loskutov <loskutov@gmx.de>
Mon, 11 Aug 2014 07:28:52 +0000 (09:28 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 27 Oct 2014 18:26:42 +0000 (19:26 +0100)
commit2f5a08798eb29e8141c452c0dc2622bc8fe90dd0
treec719668c07c7bb8740251789e0bac95ff8008fd9
parent6eca51923f49026d6e91052bc959472732332560
Reimplementation of ignore rule parser

The current IgnoreRule/FileNameMatcher implementation scales not well
with huge repositories - it is both slow and memory expensive while
parsing glob expressions (bug 440732). Addtitionally, the "double star"
pattern (/**/) is not understood by the old parser (bug 416348).

The proposed implementation is a complete clean room rewrite of the
gitignore parser, aiming to add missing double star pattern support and
improve the performance and memory consumption.

The glob expressions from .gitignore rules are converted to Java regular
expressions (java.util.regex.Pattern). java.util.regex.Pattern code can
evaluate expression from gitignore rules considerable faster (and with
less memory consumption) as the old FileNameMatcher implementation.

CQ: 8828
Bug: 416348
Bug: 440732
Change-Id: Ibefb930381f2f16eddb9947e592752f8ae2b76e1
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
18 files changed:
org.eclipse.jgit.test/META-INF/MANIFEST.MF
org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/BasicRuleTest.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/FastIgnoreRuleTest.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/IgnoreMatcherParametrizedTest.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/IgnoreMatcherTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/IgnoreRuleSpecialCasesTest.java [new file with mode: 0644]
org.eclipse.jgit/META-INF/MANIFEST.MF
org.eclipse.jgit/src/org/eclipse/jgit/ignore/FastIgnoreRule.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreRule.java
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/AbstractMatcher.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildCardMatcher.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java