login
Header Space

 
 

Re: [JGIT PATCH v2 14/24] Added the class IgnoreRuleListFactory.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Florian Koeberle <florianskarten@...>
Cc: <git@...>
Date: Monday, May 12, 2008 - 9:08 pm

Florian Koeberle <florianskarten@web.de> wrote:

Why go through all this work to buffer the lines we don't care about
(starting with # or are blank) when we could just discard them in the
inside of createIgnoreRuleList and then create the rule right away?


I suspect this code would be easier to follow if you just accepted
changing the method parameter, such as:

	private Rule createRule(String pattern) {
		boolean exclude = true;
		if (pattern.startsWith("!)) {
			pattern = pattern.substring(1);
			exclude = false;
		}


"foo/bar" will always end up in this code-path and will not match
in all levels of the tree if I follow your code correctly.

An ignore rule in the top level of "foo/bar" should ignore any entry
named "bar" within a directory "foo" at any level of the tree, even
if it is 35 directories down from the root.  Isn't ComplexFilePattern
about the absolute (starts with "/") cases only?


StringTokenizer is more-or-less replaced by String.split("/"), with
the split method being the more preferred method of doing this.

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [JGIT PATCH v2 04/24] Added path related constats to Con..., Florian Köberle, (Fri May 23, 11:46 am)
[JGIT PATCH v2 02/24] Formatted Repository class., Florian Koeberle, (Mon May 12, 4:13 pm)
[JGIT PATCH v2 09/24] Added the class Rule., Florian Koeberle, (Mon May 12, 4:13 pm)
[JGIT PATCH v2 08/24] Added the interface FilePattern., Florian Koeberle, (Mon May 12, 4:13 pm)
[JGIT PATCH v2 10/24] Added the iterface Rules., Florian Koeberle, (Mon May 12, 4:13 pm)
[JGIT PATCH v2 12/24] Added the class GlobalFilePattern, Florian Koeberle, (Mon May 12, 4:13 pm)
[JGIT PATCH v2 11/24] Added the class FNMatchPattern., Florian Koeberle, (Mon May 12, 4:13 pm)
Re: [JGIT PATCH v2 11/24] Added the class FNMatchPattern., Shawn O. Pearce, (Mon May 12, 8:38 pm)
[JGIT PATCH v2 19/24] Added the class AddRuleListFactory., Florian Koeberle, (Mon May 12, 4:13 pm)
Re: [JGIT PATCH v2 19/24] Added the class AddRuleListFactory., Florian Köberle, (Tue May 13, 7:24 am)
[JGIT PATCH v2 17/24] Added the class TreeFilePattern., Florian Koeberle, (Mon May 12, 4:13 pm)
Re: [JGIT PATCH v2 17/24] Added the class TreeFilePattern., Shawn O. Pearce, (Mon May 12, 9:22 pm)
[JGIT PATCH v2 20/24] Added class AddRulesFactory., Florian Koeberle, (Mon May 12, 4:13 pm)
[JGIT PATCH v2 22/24] Added class LightFileTreeIterable., Florian Koeberle, (Mon May 12, 4:13 pm)
[JGIT PATCH v2 03/24] Formatted Constats class., Florian Koeberle, (Mon May 12, 4:13 pm)
[JGIT PATCH v2 14/24] Added the class IgnoreRuleListFactory., Florian Koeberle, (Mon May 12, 4:13 pm)
Re: [JGIT PATCH v2 14/24] Added the class IgnoreRuleListFact..., Shawn O. Pearce, (Mon May 12, 9:08 pm)
[JGIT PATCH v2 13/24] Added the class ComplexFilePattern., Florian Koeberle, (Mon May 12, 4:13 pm)
speck-geostationary