Shawn O. Pearce wrote:I did this to reduce complexity and to increase modularity. The method createIgnoreRuleList(Iterable<String> lineIterable) can now be tested without the need to create files. Also it is so possible to read the patterns from different sources. If you worry about memory usuage I could create some kind of RulesBuilder class: public class RulesBuilder { private final List<Rule> rules; private RuleListToObjectConverter converter; // method used by tests: public void addIgnoreRule(String ignoreRuleLine) { } public void addIgnoreRuleFile(File) { // reads file and calls addIgnoreRule } public void addIncludeRuleOfAddCommand(String pattern) { } public void addIgnoreGitDirectoryRule() { } public Rules buildRules() { return converter.convertToObject(rules); } } This would have the advantages: * all Rule creating code at one place. * There is no need to keep the original lines in memory. * It's easy to create rules for testing purposes. * It's easy to create Factories like AddRulesFactory. If I remember correctly Intellij IDEA marks per default cases where you change a parameter. So it looks like that there are style guides which are against the practice of changing the values of parameters. That and the fact that you can't make exclude final now where the reason why I wrote it the otherway. Yes, ComplexFilePattern is about that cases only. I implemented it that way, becasue git behave the same way: * create the follwing file: a/a/b/test.txt * add the line "a/b" to .gitignore * add a and notice that it adds the test.txt file. Ok -- 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
| Linus Torvalds | Linux 2.6.27-rc8 |
| Greg KH | [patch 00/71] 2.6.26-stable review |
| Dmitry Torokhov | 2.6.27-rc8+ - first impressions |
| jimmy bahuleyan | Re: Hibernation considerations |
git: | |
| Petr Baudis | [FYI][PATCH] Customizing the WinGit installer |
| Jan Hudec | Re: [PATCH] Move all dashed form git commands to libexecdir |
| Jay Soffian | Re: [PATCH] gitweb: Support caching projects list |
| Mark Levedahl | Allowing override of the default "origin" nickname |
| Richard Stallman | Real men don't attack straw men |
| Leon Dippenaar | New tcp stack attack |
| Luca Dell'Oca | Authenticate squid in Active Directory |
| Todd Pytel | IDE or SCSI virtual disks for VMWare image? |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Matthew Dharm | Re: [RFC] Patch to option HSO driver to the kernel |
| Ingo Molnar | Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+ |
| David Miller | Re: [GIT PULL] [IPV6] COMPAT: Fix SSM applications on 64bit kernels. |
