{"action":"closed","number":26,"pull_request":{"url":"https://api.github.com/repos/rust-lang/glob/pulls/26","id":27171038,"html_url":"https://github.com/rust-lang/glob/pull/26","diff_url":"https://github.com/rust-lang/glob/pull/26.diff","patch_url":"https://github.com/rust-lang/glob/pull/26.patch","issue_url":"https://api.github.com/repos/rust-lang/glob/issues/26","number":26,"state":"closed","locked":false,"title":"Error reporting","user":{"login":"blaenk","id":84680,"avatar_url":"https://avatars.githubusercontent.com/u/84680?v=3","gravatar_id":"","url":"https://api.github.com/users/blaenk","html_url":"https://github.com/blaenk","followers_url":"https://api.github.com/users/blaenk/followers","following_url":"https://api.github.com/users/blaenk/following{/other_user}","gists_url":"https://api.github.com/users/blaenk/gists{/gist_id}","starred_url":"https://api.github.com/users/blaenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blaenk/subscriptions","organizations_url":"https://api.github.com/users/blaenk/orgs","repos_url":"https://api.github.com/users/blaenk/repos","events_url":"https://api.github.com/users/blaenk/events{/privacy}","received_events_url":"https://api.github.com/users/blaenk/received_events","type":"User","site_admin":false},"body":"Instead of silently treating certain invalid patterns literally,\r\npotentially surprising users, this change adds error reporting.\r\n\r\nSpecifically, the `Pattern::new` method now yields a\r\n`Result<Pattern, Error>`, much like the `Regex::new` method.\r\nWhen an invalid pattern is encountered, an `Error` type is returned\r\nwhich contains an error message along with the approximate character\r\nposition of the error.\r\n\r\nThis error handling also bubbles up to the `glob` and `glob_with`\r\nfunctions which now also return a `Result`.\r\n\r\nThe documentation is updated to reflect these changes, as well as\r\ndescribe which patterns are invalid, which as of now include:\r\n\r\n* an unclosed opening bracket `[`. If they want a literal one, they\r\n  can escape it.\r\n\r\n* a sequence of more than 2 wildcards, e.g. `***`. wildcards must\r\n  either be regular `*` or recursive `**`, literal sequences of\r\n  more than 2 asterisks should be escaped using the `escape` method\r\n\r\n* a recursive wildcard that does not entirely form a single path\r\n  component. e.g. `a/**b/c` or `a/b**c/d`. it must be e.g. `a/**/b`\r\n\r\nThis also adds a `String` field to the `Pattern` which is used to store\r\nthe original glob pattern, like the `Regex` type does, along with an\r\n`as_str()` method to yield a slice to this field, as well as\r\n`fmt::String` and `fmt::Show` implementations which show this\r\noriginal glob pattern.","created_at":"2015-01-12T00:46:08Z","updated_at":"2015-01-13T17:36:11Z","closed_at":"2015-01-13T17:36:11Z","merged_at":null,"merge_commit_sha":"1f98a54aece1de29d23963d207970c030d54a57d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/glob/pulls/26/commits","review_comments_url":"https://api.github.com/repos/rust-lang/glob/pulls/26/comments","review_comment_url":"https://api.github.com/repos/rust-lang/glob/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rust-lang/glob/issues/26/comments","statuses_url":"https://api.github.com/repos/rust-lang/glob/statuses/d4a3e1597b2120e758b175f6ceac923fe92e92b7","head":{"label":"blaenk:error-reporting","ref":"error-reporting","sha":"d4a3e1597b2120e758b175f6ceac923fe92e92b7","user":{"login":"blaenk","id":84680,"avatar_url":"https://avatars.githubusercontent.com/u/84680?v=3","gravatar_id":"","url":"https://api.github.com/users/blaenk","html_url":"https://github.com/blaenk","followers_url":"https://api.github.com/users/blaenk/followers","following_url":"https://api.github.com/users/blaenk/following{/other_user}","gists_url":"https://api.github.com/users/blaenk/gists{/gist_id}","starred_url":"https://api.github.com/users/blaenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blaenk/subscriptions","organizations_url":"https://api.github.com/users/blaenk/orgs","repos_url":"https://api.github.com/users/blaenk/repos","events_url":"https://api.github.com/users/blaenk/events{/privacy}","received_events_url":"https://api.github.com/users/blaenk/received_events","type":"User","site_admin":false},"repo":{"id":28494511,"name":"glob","full_name":"blaenk/glob","owner":{"login":"blaenk","id":84680,"avatar_url":"https://avatars.githubusercontent.com/u/84680?v=3","gravatar_id":"","url":"https://api.github.com/users/blaenk","html_url":"https://github.com/blaenk","followers_url":"https://api.github.com/users/blaenk/followers","following_url":"https://api.github.com/users/blaenk/following{/other_user}","gists_url":"https://api.github.com/users/blaenk/gists{/gist_id}","starred_url":"https://api.github.com/users/blaenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blaenk/subscriptions","organizations_url":"https://api.github.com/users/blaenk/orgs","repos_url":"https://api.github.com/users/blaenk/repos","events_url":"https://api.github.com/users/blaenk/events{/privacy}","received_events_url":"https://api.github.com/users/blaenk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blaenk/glob","description":"Support for matching file paths against Unix shell style patterns.","fork":true,"url":"https://api.github.com/repos/blaenk/glob","forks_url":"https://api.github.com/repos/blaenk/glob/forks","keys_url":"https://api.github.com/repos/blaenk/glob/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blaenk/glob/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blaenk/glob/teams","hooks_url":"https://api.github.com/repos/blaenk/glob/hooks","issue_events_url":"https://api.github.com/repos/blaenk/glob/issues/events{/number}","events_url":"https://api.github.com/repos/blaenk/glob/events","assignees_url":"https://api.github.com/repos/blaenk/glob/assignees{/user}","branches_url":"https://api.github.com/repos/blaenk/glob/branches{/branch}","tags_url":"https://api.github.com/repos/blaenk/glob/tags","blobs_url":"https://api.github.com/repos/blaenk/glob/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blaenk/glob/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blaenk/glob/git/refs{/sha}","trees_url":"https://api.github.com/repos/blaenk/glob/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blaenk/glob/statuses/{sha}","languages_url":"https://api.github.com/repos/blaenk/glob/languages","stargazers_url":"https://api.github.com/repos/blaenk/glob/stargazers","contributors_url":"https://api.github.com/repos/blaenk/glob/contributors","subscribers_url":"https://api.github.com/repos/blaenk/glob/subscribers","subscription_url":"https://api.github.com/repos/blaenk/glob/subscription","commits_url":"https://api.github.com/repos/blaenk/glob/commits{/sha}","git_commits_url":"https://api.github.com/repos/blaenk/glob/git/commits{/sha}","comments_url":"https://api.github.com/repos/blaenk/glob/comments{/number}","issue_comment_url":"https://api.github.com/repos/blaenk/glob/issues/comments/{number}","contents_url":"https://api.github.com/repos/blaenk/glob/contents/{+path}","compare_url":"https://api.github.com/repos/blaenk/glob/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blaenk/glob/merges","archive_url":"https://api.github.com/repos/blaenk/glob/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blaenk/glob/downloads","issues_url":"https://api.github.com/repos/blaenk/glob/issues{/number}","pulls_url":"https://api.github.com/repos/blaenk/glob/pulls{/number}","milestones_url":"https://api.github.com/repos/blaenk/glob/milestones{/number}","notifications_url":"https://api.github.com/repos/blaenk/glob/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blaenk/glob/labels{/name}","releases_url":"https://api.github.com/repos/blaenk/glob/releases{/id}","created_at":"2014-12-26T00:22:17Z","updated_at":"2015-01-10T02:07:38Z","pushed_at":"2015-01-13T03:16:21Z","git_url":"git://github.com/blaenk/glob.git","ssh_url":"git@github.com:blaenk/glob.git","clone_url":"https://github.com/blaenk/glob.git","svn_url":"https://github.com/blaenk/glob","homepage":null,"size":870,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"8193645c55a554770a7c7ba738c870cf0e9b9fdd","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":23241722,"name":"glob","full_name":"rust-lang/glob","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/glob","description":"Support for matching file paths against Unix shell style patterns.","fork":false,"url":"https://api.github.com/repos/rust-lang/glob","forks_url":"https://api.github.com/repos/rust-lang/glob/forks","keys_url":"https://api.github.com/repos/rust-lang/glob/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/glob/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/glob/teams","hooks_url":"https://api.github.com/repos/rust-lang/glob/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/glob/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/glob/events","assignees_url":"https://api.github.com/repos/rust-lang/glob/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/glob/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/glob/tags","blobs_url":"https://api.github.com/repos/rust-lang/glob/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/glob/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/glob/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/glob/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/glob/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/glob/languages","stargazers_url":"https://api.github.com/repos/rust-lang/glob/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/glob/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/glob/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/glob/subscription","commits_url":"https://api.github.com/repos/rust-lang/glob/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/glob/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/glob/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/glob/issues/comments/{number}","contents_url":"https://api.github.com/repos/rust-lang/glob/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/glob/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/glob/merges","archive_url":"https://api.github.com/repos/rust-lang/glob/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/glob/downloads","issues_url":"https://api.github.com/repos/rust-lang/glob/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/glob/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/glob/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/glob/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/glob/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/glob/releases{/id}","created_at":"2014-08-22T22:22:51Z","updated_at":"2015-01-12T16:54:30Z","pushed_at":"2015-01-13T12:59:08Z","git_url":"git://github.com/rust-lang/glob.git","ssh_url":"git@github.com:rust-lang/glob.git","clone_url":"https://github.com/rust-lang/glob.git","svn_url":"https://github.com/rust-lang/glob","homepage":null,"size":1175,"stargazers_count":7,"watchers_count":7,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":15,"mirror_url":null,"open_issues_count":3,"forks":15,"open_issues":3,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/glob/pulls/26"},"html":{"href":"https://github.com/rust-lang/glob/pull/26"},"issue":{"href":"https://api.github.com/repos/rust-lang/glob/issues/26"},"comments":{"href":"https://api.github.com/repos/rust-lang/glob/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/glob/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/glob/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/glob/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/glob/statuses/d4a3e1597b2120e758b175f6ceac923fe92e92b7"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":7,"review_comments":0,"commits":2,"additions":336,"deletions":251,"changed_files":2}}