{"action":"created","comment":{"url":"https://api.github.com/repos/cake-build/cake/pulls/comments/31416843","id":31416843,"diff_hunk":"@@ -56,6 +56,19 @@ public Globber(IFileSystem fileSystem, ICakeEnvironment environment)\n         /// </returns>\n         public IEnumerable<Path> Match(string pattern)\n         {\n+            return Match(pattern, null);\n+        }\n+\n+        /// <summary>\n+        /// Returns <see cref=\"Path\" /> instances matching the specified pattern.\n+        /// </summary>\n+        /// <param name=\"pattern\">The pattern to match.</param>\n+        /// <param name=\"predicate\">The predicate used to filter directories based on file system information.</param>\n+        /// <returns>\n+        ///   <see cref=\"Path\" /> instances matching the specified pattern.\n+        /// </returns>\n+        public IEnumerable<Path> Match(string pattern, Func<IFileSystemInfo, bool> predicate)","path":"src/Cake.Core/IO/Globber.cs","position":15,"original_position":15,"commit_id":"36d5e54a1c5220730cd8f22653dc3e8d4bba7238","original_commit_id":"36d5e54a1c5220730cd8f22653dc3e8d4bba7238","user":{"login":"devlead","id":1647294,"avatar_url":"https://avatars.githubusercontent.com/u/1647294?v=3","gravatar_id":"","url":"https://api.github.com/users/devlead","html_url":"https://github.com/devlead","followers_url":"https://api.github.com/users/devlead/followers","following_url":"https://api.github.com/users/devlead/following{/other_user}","gists_url":"https://api.github.com/users/devlead/gists{/gist_id}","starred_url":"https://api.github.com/users/devlead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devlead/subscriptions","organizations_url":"https://api.github.com/users/devlead/orgs","repos_url":"https://api.github.com/users/devlead/repos","events_url":"https://api.github.com/users/devlead/events{/privacy}","received_events_url":"https://api.github.com/users/devlead/received_events","type":"User","site_admin":false},"body":"But then it's too late, it will already walked thru and gotten an exception or taken a long time.","created_at":"2015-06-01T11:20:34Z","updated_at":"2015-06-01T11:20:34Z","html_url":"https://github.com/cake-build/cake/pull/259#discussion_r31416843","pull_request_url":"https://api.github.com/repos/cake-build/cake/pulls/259","_links":{"self":{"href":"https://api.github.com/repos/cake-build/cake/pulls/comments/31416843"},"html":{"href":"https://github.com/cake-build/cake/pull/259#discussion_r31416843"},"pull_request":{"href":"https://api.github.com/repos/cake-build/cake/pulls/259"}}},"pull_request":{"url":"https://api.github.com/repos/cake-build/cake/pulls/259","id":36606509,"html_url":"https://github.com/cake-build/cake/pull/259","diff_url":"https://github.com/cake-build/cake/pull/259.diff","patch_url":"https://github.com/cake-build/cake/pull/259.patch","issue_url":"https://api.github.com/repos/cake-build/cake/issues/259","number":259,"state":"open","locked":false,"title":"Added filter predicate overloads to globber & clean directory methods","user":{"login":"devlead","id":1647294,"avatar_url":"https://avatars.githubusercontent.com/u/1647294?v=3","gravatar_id":"","url":"https://api.github.com/users/devlead","html_url":"https://github.com/devlead","followers_url":"https://api.github.com/users/devlead/followers","following_url":"https://api.github.com/users/devlead/following{/other_user}","gists_url":"https://api.github.com/users/devlead/gists{/gist_id}","starred_url":"https://api.github.com/users/devlead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devlead/subscriptions","organizations_url":"https://api.github.com/users/devlead/orgs","repos_url":"https://api.github.com/users/devlead/repos","events_url":"https://api.github.com/users/devlead/events{/privacy}","received_events_url":"https://api.github.com/users/devlead/received_events","type":"User","site_admin":false},"body":"Sometimes when working with recursive globbering it can lead into a rabbit hole of loads of folders, given at best bad performance and at worst hitting the .Net max path length limitation.\r\n\r\nThis PR proposes you to set a predicate for folders / files you know there's no need to explorer / include.\r\n\r\nSample DSL usage `GetFiles` with predicate:\r\n```csharp\r\nFunc<IFileSystemInfo, bool> exclude_node_modules =\r\n    fileSystemInfo=>!fileSystemInfo.Path.FullPath.EndsWith(\r\n                            \"node_modules\",\r\n                            StringComparison.OrdinalIgnoreCase);\r\n\r\nvar solutions = GetFiles(\"./**/*.sln\", exclude_node_modules);\r\n```\r\nSample DSL `CleanDirectories` with predicate:\r\n```csharp\r\nTask(\"Clean\")\r\n    .Does(() =>\r\n{\r\n    // Clean solution directories.\r\n    foreach(var path in solutionPaths)\r\n    {\r\n        Information(\"Cleaning {0}\", path);\r\n        CleanDirectories(path + \"/**/bin/\" + configuration, exclude_node_modules);\r\n        CleanDirectories(path + \"/**/obj/\" + configuration, exclude_node_modules);\r\n    }\r\n});\r\n```","created_at":"2015-06-01T08:06:17Z","updated_at":"2015-06-01T11:20:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b739214a0328e6a416121923f459f8208f9798f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cake-build/cake/pulls/259/commits","review_comments_url":"https://api.github.com/repos/cake-build/cake/pulls/259/comments","review_comment_url":"https://api.github.com/repos/cake-build/cake/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cake-build/cake/issues/259/comments","statuses_url":"https://api.github.com/repos/cake-build/cake/statuses/36d5e54a1c5220730cd8f22653dc3e8d4bba7238","head":{"label":"devlead:f/cleanpredicate","ref":"f/cleanpredicate","sha":"36d5e54a1c5220730cd8f22653dc3e8d4bba7238","user":{"login":"devlead","id":1647294,"avatar_url":"https://avatars.githubusercontent.com/u/1647294?v=3","gravatar_id":"","url":"https://api.github.com/users/devlead","html_url":"https://github.com/devlead","followers_url":"https://api.github.com/users/devlead/followers","following_url":"https://api.github.com/users/devlead/following{/other_user}","gists_url":"https://api.github.com/users/devlead/gists{/gist_id}","starred_url":"https://api.github.com/users/devlead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devlead/subscriptions","organizations_url":"https://api.github.com/users/devlead/orgs","repos_url":"https://api.github.com/users/devlead/repos","events_url":"https://api.github.com/users/devlead/events{/privacy}","received_events_url":"https://api.github.com/users/devlead/received_events","type":"User","site_admin":false},"repo":{"id":21160725,"name":"cake","full_name":"devlead/cake","owner":{"login":"devlead","id":1647294,"avatar_url":"https://avatars.githubusercontent.com/u/1647294?v=3","gravatar_id":"","url":"https://api.github.com/users/devlead","html_url":"https://github.com/devlead","followers_url":"https://api.github.com/users/devlead/followers","following_url":"https://api.github.com/users/devlead/following{/other_user}","gists_url":"https://api.github.com/users/devlead/gists{/gist_id}","starred_url":"https://api.github.com/users/devlead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devlead/subscriptions","organizations_url":"https://api.github.com/users/devlead/orgs","repos_url":"https://api.github.com/users/devlead/repos","events_url":"https://api.github.com/users/devlead/events{/privacy}","received_events_url":"https://api.github.com/users/devlead/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/devlead/cake","description":"Cake (C# Make) is a build automation system inspired by Fake.","fork":true,"url":"https://api.github.com/repos/devlead/cake","forks_url":"https://api.github.com/repos/devlead/cake/forks","keys_url":"https://api.github.com/repos/devlead/cake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devlead/cake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devlead/cake/teams","hooks_url":"https://api.github.com/repos/devlead/cake/hooks","issue_events_url":"https://api.github.com/repos/devlead/cake/issues/events{/number}","events_url":"https://api.github.com/repos/devlead/cake/events","assignees_url":"https://api.github.com/repos/devlead/cake/assignees{/user}","branches_url":"https://api.github.com/repos/devlead/cake/branches{/branch}","tags_url":"https://api.github.com/repos/devlead/cake/tags","blobs_url":"https://api.github.com/repos/devlead/cake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devlead/cake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devlead/cake/git/refs{/sha}","trees_url":"https://api.github.com/repos/devlead/cake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devlead/cake/statuses/{sha}","languages_url":"https://api.github.com/repos/devlead/cake/languages","stargazers_url":"https://api.github.com/repos/devlead/cake/stargazers","contributors_url":"https://api.github.com/repos/devlead/cake/contributors","subscribers_url":"https://api.github.com/repos/devlead/cake/subscribers","subscription_url":"https://api.github.com/repos/devlead/cake/subscription","commits_url":"https://api.github.com/repos/devlead/cake/commits{/sha}","git_commits_url":"https://api.github.com/repos/devlead/cake/git/commits{/sha}","comments_url":"https://api.github.com/repos/devlead/cake/comments{/number}","issue_comment_url":"https://api.github.com/repos/devlead/cake/issues/comments{/number}","contents_url":"https://api.github.com/repos/devlead/cake/contents/{+path}","compare_url":"https://api.github.com/repos/devlead/cake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devlead/cake/merges","archive_url":"https://api.github.com/repos/devlead/cake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devlead/cake/downloads","issues_url":"https://api.github.com/repos/devlead/cake/issues{/number}","pulls_url":"https://api.github.com/repos/devlead/cake/pulls{/number}","milestones_url":"https://api.github.com/repos/devlead/cake/milestones{/number}","notifications_url":"https://api.github.com/repos/devlead/cake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devlead/cake/labels{/name}","releases_url":"https://api.github.com/repos/devlead/cake/releases{/id}","created_at":"2014-06-24T10:25:04Z","updated_at":"2015-04-21T20:24:35Z","pushed_at":"2015-06-01T07:58:47Z","git_url":"git://github.com/devlead/cake.git","ssh_url":"git@github.com:devlead/cake.git","clone_url":"https://github.com/devlead/cake.git","svn_url":"https://github.com/devlead/cake","homepage":"","size":3472,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"cake-build:develop","ref":"develop","sha":"84a255392924865a2067020fa566acd3abd83694","user":{"login":"cake-build","id":7738262,"avatar_url":"https://avatars.githubusercontent.com/u/7738262?v=3","gravatar_id":"","url":"https://api.github.com/users/cake-build","html_url":"https://github.com/cake-build","followers_url":"https://api.github.com/users/cake-build/followers","following_url":"https://api.github.com/users/cake-build/following{/other_user}","gists_url":"https://api.github.com/users/cake-build/gists{/gist_id}","starred_url":"https://api.github.com/users/cake-build/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cake-build/subscriptions","organizations_url":"https://api.github.com/users/cake-build/orgs","repos_url":"https://api.github.com/users/cake-build/repos","events_url":"https://api.github.com/users/cake-build/events{/privacy}","received_events_url":"https://api.github.com/users/cake-build/received_events","type":"Organization","site_admin":false},"repo":{"id":20094029,"name":"cake","full_name":"cake-build/cake","owner":{"login":"cake-build","id":7738262,"avatar_url":"https://avatars.githubusercontent.com/u/7738262?v=3","gravatar_id":"","url":"https://api.github.com/users/cake-build","html_url":"https://github.com/cake-build","followers_url":"https://api.github.com/users/cake-build/followers","following_url":"https://api.github.com/users/cake-build/following{/other_user}","gists_url":"https://api.github.com/users/cake-build/gists{/gist_id}","starred_url":"https://api.github.com/users/cake-build/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cake-build/subscriptions","organizations_url":"https://api.github.com/users/cake-build/orgs","repos_url":"https://api.github.com/users/cake-build/repos","events_url":"https://api.github.com/users/cake-build/events{/privacy}","received_events_url":"https://api.github.com/users/cake-build/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cake-build/cake","description":"Cake (C# Make) is a build automation system.","fork":false,"url":"https://api.github.com/repos/cake-build/cake","forks_url":"https://api.github.com/repos/cake-build/cake/forks","keys_url":"https://api.github.com/repos/cake-build/cake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cake-build/cake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cake-build/cake/teams","hooks_url":"https://api.github.com/repos/cake-build/cake/hooks","issue_events_url":"https://api.github.com/repos/cake-build/cake/issues/events{/number}","events_url":"https://api.github.com/repos/cake-build/cake/events","assignees_url":"https://api.github.com/repos/cake-build/cake/assignees{/user}","branches_url":"https://api.github.com/repos/cake-build/cake/branches{/branch}","tags_url":"https://api.github.com/repos/cake-build/cake/tags","blobs_url":"https://api.github.com/repos/cake-build/cake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cake-build/cake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cake-build/cake/git/refs{/sha}","trees_url":"https://api.github.com/repos/cake-build/cake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cake-build/cake/statuses/{sha}","languages_url":"https://api.github.com/repos/cake-build/cake/languages","stargazers_url":"https://api.github.com/repos/cake-build/cake/stargazers","contributors_url":"https://api.github.com/repos/cake-build/cake/contributors","subscribers_url":"https://api.github.com/repos/cake-build/cake/subscribers","subscription_url":"https://api.github.com/repos/cake-build/cake/subscription","commits_url":"https://api.github.com/repos/cake-build/cake/commits{/sha}","git_commits_url":"https://api.github.com/repos/cake-build/cake/git/commits{/sha}","comments_url":"https://api.github.com/repos/cake-build/cake/comments{/number}","issue_comment_url":"https://api.github.com/repos/cake-build/cake/issues/comments{/number}","contents_url":"https://api.github.com/repos/cake-build/cake/contents/{+path}","compare_url":"https://api.github.com/repos/cake-build/cake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cake-build/cake/merges","archive_url":"https://api.github.com/repos/cake-build/cake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cake-build/cake/downloads","issues_url":"https://api.github.com/repos/cake-build/cake/issues{/number}","pulls_url":"https://api.github.com/repos/cake-build/cake/pulls{/number}","milestones_url":"https://api.github.com/repos/cake-build/cake/milestones{/number}","notifications_url":"https://api.github.com/repos/cake-build/cake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cake-build/cake/labels{/name}","releases_url":"https://api.github.com/repos/cake-build/cake/releases{/id}","created_at":"2014-05-23T09:26:54Z","updated_at":"2015-05-29T07:58:42Z","pushed_at":"2015-06-01T08:06:18Z","git_url":"git://github.com/cake-build/cake.git","ssh_url":"git@github.com:cake-build/cake.git","clone_url":"https://github.com/cake-build/cake.git","svn_url":"https://github.com/cake-build/cake","homepage":"http://cakebuild.net/","size":6259,"stargazers_count":169,"watchers_count":169,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":33,"forks":23,"open_issues":33,"watchers":169,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cake-build/cake/pulls/259"},"html":{"href":"https://github.com/cake-build/cake/pull/259"},"issue":{"href":"https://api.github.com/repos/cake-build/cake/issues/259"},"comments":{"href":"https://api.github.com/repos/cake-build/cake/issues/259/comments"},"review_comments":{"href":"https://api.github.com/repos/cake-build/cake/pulls/259/comments"},"review_comment":{"href":"https://api.github.com/repos/cake-build/cake/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cake-build/cake/pulls/259/commits"},"statuses":{"href":"https://api.github.com/repos/cake-build/cake/statuses/36d5e54a1c5220730cd8f22653dc3e8d4bba7238"}}}}