{"action":"created","comment":{"url":"https://api.github.com/repos/git-lfs/wildmatch/pulls/comments/200711789","pull_request_review_id":135084346,"id":200711789,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDcxMTc4OQ==","diff_hunk":"@@ -164,6 +180,12 @@ func (w *Wildmatch) Match(t string) bool {\n // returns a slice of remaining directory paths, and whether or not there was a\n // disagreement while matching.\n func (w *Wildmatch) consume(t string) ([]string, bool) {\n+\tif w.basename {\n+\t\t// If the receiving Wildmatch has basename set, the pattern\n+\t\t// matches only the basename of the given \"t\".\n+\t\tt = filepath.Base(t)","path":"wildmatch.go","position":53,"original_position":53,"commit_id":"4bfd29c391c1ba475624b48a103649d5ee36232a","original_commit_id":"4bfd29c391c1ba475624b48a103649d5ee36232a","user":{"login":"PastelMobileSuit","id":37254014,"node_id":"MDQ6VXNlcjM3MjU0MDE0","avatar_url":"https://avatars2.githubusercontent.com/u/37254014?v=4","gravatar_id":"","url":"https://api.github.com/users/PastelMobileSuit","html_url":"https://github.com/PastelMobileSuit","followers_url":"https://api.github.com/users/PastelMobileSuit/followers","following_url":"https://api.github.com/users/PastelMobileSuit/following{/other_user}","gists_url":"https://api.github.com/users/PastelMobileSuit/gists{/gist_id}","starred_url":"https://api.github.com/users/PastelMobileSuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PastelMobileSuit/subscriptions","organizations_url":"https://api.github.com/users/PastelMobileSuit/orgs","repos_url":"https://api.github.com/users/PastelMobileSuit/repos","events_url":"https://api.github.com/users/PastelMobileSuit/events{/privacy}","received_events_url":"https://api.github.com/users/PastelMobileSuit/received_events","type":"User","site_admin":true},"body":"Nice! ✨ ","created_at":"2018-07-06T16:54:55Z","updated_at":"2018-07-06T16:55:38Z","html_url":"https://github.com/git-lfs/wildmatch/pull/8#discussion_r200711789","pull_request_url":"https://api.github.com/repos/git-lfs/wildmatch/pulls/8","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/git-lfs/wildmatch/pulls/comments/200711789"},"html":{"href":"https://github.com/git-lfs/wildmatch/pull/8#discussion_r200711789"},"pull_request":{"href":"https://api.github.com/repos/git-lfs/wildmatch/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/git-lfs/wildmatch/pulls/8","id":199632489,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NjMyNDg5","html_url":"https://github.com/git-lfs/wildmatch/pull/8","diff_url":"https://github.com/git-lfs/wildmatch/pull/8.diff","patch_url":"https://github.com/git-lfs/wildmatch/pull/8.patch","issue_url":"https://api.github.com/repos/git-lfs/wildmatch/issues/8","number":8,"state":"open","locked":false,"title":"wildmatch: teach Basename to match against basename only","user":{"login":"ttaylorr","id":443245,"node_id":"MDQ6VXNlcjQ0MzI0NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/443245?v=4","gravatar_id":"","url":"https://api.github.com/users/ttaylorr","html_url":"https://github.com/ttaylorr","followers_url":"https://api.github.com/users/ttaylorr/followers","following_url":"https://api.github.com/users/ttaylorr/following{/other_user}","gists_url":"https://api.github.com/users/ttaylorr/gists{/gist_id}","starred_url":"https://api.github.com/users/ttaylorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttaylorr/subscriptions","organizations_url":"https://api.github.com/users/ttaylorr/orgs","repos_url":"https://api.github.com/users/ttaylorr/repos","events_url":"https://api.github.com/users/ttaylorr/events{/privacy}","received_events_url":"https://api.github.com/users/ttaylorr/received_events","type":"User","site_admin":true},"body":"In Git's attr.c, patterns found in a repository's .gitattributes\r\nfile(s) are matched on basename alone if and only if the pattern\r\ncontains no directory separators [1], [2].\r\n\r\nThis behavior allows a line such as:\r\n\r\n    *.txt filter=lfs -text\r\n\r\nin the repository's root .gitattributes (or .git/info/attributes) to\r\napply the filter=lfs and text=false attributes to a.txt, and\r\n/path/to/a.txt. In general terms, this treats patterns as having a\r\nprefixed `**/` in this case.\r\n\r\nTo simulate this behavior, we introduce the wildmatch.Basename\r\noption to truncate incoming paths to their basename (using\r\nfilepath.Base from package path/filepath) if and only if the given\r\npattern contains only 1 ``split'', i.e., does not contain directory\r\nseparators.\r\n\r\nFor instance, given the wildmatch.Basename option, the following\r\npatterns match:\r\n\r\n  - *.txt matches foo.txt\r\n  - *.txt matches foo/bar.txt\r\n  - foo/*.txt matches foo/bar.txt\r\n  - foo/*.txt does not match baz/foo/bar.txt\r\n  - foo/*.txt does not match foo/bar/baz/woot.txt\r\n\r\nThis option suits a tree-like representation of a repository's\r\n.gitattribute file(s) nicely, by giving wildmatch.Basename, we mirror\r\nthe correct behavior for paths relative to the directory in which they\r\nare expressed in a .gitattributes file.\r\n\r\n[1]: https://github.com/git/git/blob/v2.18.0/attr.c#L1005-L1010\r\n[2]: https://github.com/git/git/blob/v2.18.0/dir.c#L608-L613\r\n\r\n## \r\n\r\n/cc @git-lfs/core ","created_at":"2018-07-06T02:51:21Z","updated_at":"2018-07-06T16:55:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79c3724ffb0fcaa7dbfa13530c463a5bbfa789fa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/git-lfs/wildmatch/pulls/8/commits","review_comments_url":"https://api.github.com/repos/git-lfs/wildmatch/pulls/8/comments","review_comment_url":"https://api.github.com/repos/git-lfs/wildmatch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/git-lfs/wildmatch/issues/8/comments","statuses_url":"https://api.github.com/repos/git-lfs/wildmatch/statuses/4bfd29c391c1ba475624b48a103649d5ee36232a","head":{"label":"git-lfs:wm-basename","ref":"wm-basename","sha":"4bfd29c391c1ba475624b48a103649d5ee36232a","user":{"login":"git-lfs","id":20246716,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjQ2NzE2","avatar_url":"https://avatars2.githubusercontent.com/u/20246716?v=4","gravatar_id":"","url":"https://api.github.com/users/git-lfs","html_url":"https://github.com/git-lfs","followers_url":"https://api.github.com/users/git-lfs/followers","following_url":"https://api.github.com/users/git-lfs/following{/other_user}","gists_url":"https://api.github.com/users/git-lfs/gists{/gist_id}","starred_url":"https://api.github.com/users/git-lfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-lfs/subscriptions","organizations_url":"https://api.github.com/users/git-lfs/orgs","repos_url":"https://api.github.com/users/git-lfs/repos","events_url":"https://api.github.com/users/git-lfs/events{/privacy}","received_events_url":"https://api.github.com/users/git-lfs/received_events","type":"Organization","site_admin":false},"repo":{"id":117059048,"node_id":"MDEwOlJlcG9zaXRvcnkxMTcwNTkwNDg=","name":"wildmatch","full_name":"git-lfs/wildmatch","owner":{"login":"git-lfs","id":20246716,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjQ2NzE2","avatar_url":"https://avatars2.githubusercontent.com/u/20246716?v=4","gravatar_id":"","url":"https://api.github.com/users/git-lfs","html_url":"https://github.com/git-lfs","followers_url":"https://api.github.com/users/git-lfs/followers","following_url":"https://api.github.com/users/git-lfs/following{/other_user}","gists_url":"https://api.github.com/users/git-lfs/gists{/gist_id}","starred_url":"https://api.github.com/users/git-lfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-lfs/subscriptions","organizations_url":"https://api.github.com/users/git-lfs/orgs","repos_url":"https://api.github.com/users/git-lfs/repos","events_url":"https://api.github.com/users/git-lfs/events{/privacy}","received_events_url":"https://api.github.com/users/git-lfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/git-lfs/wildmatch","description":"Wildmatch is a pattern matching language for filepaths compatible with Git.","fork":false,"url":"https://api.github.com/repos/git-lfs/wildmatch","forks_url":"https://api.github.com/repos/git-lfs/wildmatch/forks","keys_url":"https://api.github.com/repos/git-lfs/wildmatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/git-lfs/wildmatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/git-lfs/wildmatch/teams","hooks_url":"https://api.github.com/repos/git-lfs/wildmatch/hooks","issue_events_url":"https://api.github.com/repos/git-lfs/wildmatch/issues/events{/number}","events_url":"https://api.github.com/repos/git-lfs/wildmatch/events","assignees_url":"https://api.github.com/repos/git-lfs/wildmatch/assignees{/user}","branches_url":"https://api.github.com/repos/git-lfs/wildmatch/branches{/branch}","tags_url":"https://api.github.com/repos/git-lfs/wildmatch/tags","blobs_url":"https://api.github.com/repos/git-lfs/wildmatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/git-lfs/wildmatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/git-lfs/wildmatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/git-lfs/wildmatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/git-lfs/wildmatch/statuses/{sha}","languages_url":"https://api.github.com/repos/git-lfs/wildmatch/languages","stargazers_url":"https://api.github.com/repos/git-lfs/wildmatch/stargazers","contributors_url":"https://api.github.com/repos/git-lfs/wildmatch/contributors","subscribers_url":"https://api.github.com/repos/git-lfs/wildmatch/subscribers","subscription_url":"https://api.github.com/repos/git-lfs/wildmatch/subscription","commits_url":"https://api.github.com/repos/git-lfs/wildmatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/git-lfs/wildmatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/git-lfs/wildmatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/git-lfs/wildmatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/git-lfs/wildmatch/contents/{+path}","compare_url":"https://api.github.com/repos/git-lfs/wildmatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/git-lfs/wildmatch/merges","archive_url":"https://api.github.com/repos/git-lfs/wildmatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/git-lfs/wildmatch/downloads","issues_url":"https://api.github.com/repos/git-lfs/wildmatch/issues{/number}","pulls_url":"https://api.github.com/repos/git-lfs/wildmatch/pulls{/number}","milestones_url":"https://api.github.com/repos/git-lfs/wildmatch/milestones{/number}","notifications_url":"https://api.github.com/repos/git-lfs/wildmatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/git-lfs/wildmatch/labels{/name}","releases_url":"https://api.github.com/repos/git-lfs/wildmatch/releases{/id}","deployments_url":"https://api.github.com/repos/git-lfs/wildmatch/deployments","created_at":"2018-01-11T06:20:32Z","updated_at":"2018-01-30T01:59:18Z","pushed_at":"2018-07-06T02:54:39Z","git_url":"git://github.com/git-lfs/wildmatch.git","ssh_url":"git@github.com:git-lfs/wildmatch.git","clone_url":"https://github.com/git-lfs/wildmatch.git","svn_url":"https://github.com/git-lfs/wildmatch","homepage":"","size":25,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"git-lfs:master","ref":"master","sha":"8a0518641565a619e62a2738c7d4498fc345daf6","user":{"login":"git-lfs","id":20246716,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjQ2NzE2","avatar_url":"https://avatars2.githubusercontent.com/u/20246716?v=4","gravatar_id":"","url":"https://api.github.com/users/git-lfs","html_url":"https://github.com/git-lfs","followers_url":"https://api.github.com/users/git-lfs/followers","following_url":"https://api.github.com/users/git-lfs/following{/other_user}","gists_url":"https://api.github.com/users/git-lfs/gists{/gist_id}","starred_url":"https://api.github.com/users/git-lfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-lfs/subscriptions","organizations_url":"https://api.github.com/users/git-lfs/orgs","repos_url":"https://api.github.com/users/git-lfs/repos","events_url":"https://api.github.com/users/git-lfs/events{/privacy}","received_events_url":"https://api.github.com/users/git-lfs/received_events","type":"Organization","site_admin":false},"repo":{"id":117059048,"node_id":"MDEwOlJlcG9zaXRvcnkxMTcwNTkwNDg=","name":"wildmatch","full_name":"git-lfs/wildmatch","owner":{"login":"git-lfs","id":20246716,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjQ2NzE2","avatar_url":"https://avatars2.githubusercontent.com/u/20246716?v=4","gravatar_id":"","url":"https://api.github.com/users/git-lfs","html_url":"https://github.com/git-lfs","followers_url":"https://api.github.com/users/git-lfs/followers","following_url":"https://api.github.com/users/git-lfs/following{/other_user}","gists_url":"https://api.github.com/users/git-lfs/gists{/gist_id}","starred_url":"https://api.github.com/users/git-lfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-lfs/subscriptions","organizations_url":"https://api.github.com/users/git-lfs/orgs","repos_url":"https://api.github.com/users/git-lfs/repos","events_url":"https://api.github.com/users/git-lfs/events{/privacy}","received_events_url":"https://api.github.com/users/git-lfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/git-lfs/wildmatch","description":"Wildmatch is a pattern matching language for filepaths compatible with Git.","fork":false,"url":"https://api.github.com/repos/git-lfs/wildmatch","forks_url":"https://api.github.com/repos/git-lfs/wildmatch/forks","keys_url":"https://api.github.com/repos/git-lfs/wildmatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/git-lfs/wildmatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/git-lfs/wildmatch/teams","hooks_url":"https://api.github.com/repos/git-lfs/wildmatch/hooks","issue_events_url":"https://api.github.com/repos/git-lfs/wildmatch/issues/events{/number}","events_url":"https://api.github.com/repos/git-lfs/wildmatch/events","assignees_url":"https://api.github.com/repos/git-lfs/wildmatch/assignees{/user}","branches_url":"https://api.github.com/repos/git-lfs/wildmatch/branches{/branch}","tags_url":"https://api.github.com/repos/git-lfs/wildmatch/tags","blobs_url":"https://api.github.com/repos/git-lfs/wildmatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/git-lfs/wildmatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/git-lfs/wildmatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/git-lfs/wildmatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/git-lfs/wildmatch/statuses/{sha}","languages_url":"https://api.github.com/repos/git-lfs/wildmatch/languages","stargazers_url":"https://api.github.com/repos/git-lfs/wildmatch/stargazers","contributors_url":"https://api.github.com/repos/git-lfs/wildmatch/contributors","subscribers_url":"https://api.github.com/repos/git-lfs/wildmatch/subscribers","subscription_url":"https://api.github.com/repos/git-lfs/wildmatch/subscription","commits_url":"https://api.github.com/repos/git-lfs/wildmatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/git-lfs/wildmatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/git-lfs/wildmatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/git-lfs/wildmatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/git-lfs/wildmatch/contents/{+path}","compare_url":"https://api.github.com/repos/git-lfs/wildmatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/git-lfs/wildmatch/merges","archive_url":"https://api.github.com/repos/git-lfs/wildmatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/git-lfs/wildmatch/downloads","issues_url":"https://api.github.com/repos/git-lfs/wildmatch/issues{/number}","pulls_url":"https://api.github.com/repos/git-lfs/wildmatch/pulls{/number}","milestones_url":"https://api.github.com/repos/git-lfs/wildmatch/milestones{/number}","notifications_url":"https://api.github.com/repos/git-lfs/wildmatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/git-lfs/wildmatch/labels{/name}","releases_url":"https://api.github.com/repos/git-lfs/wildmatch/releases{/id}","deployments_url":"https://api.github.com/repos/git-lfs/wildmatch/deployments","created_at":"2018-01-11T06:20:32Z","updated_at":"2018-01-30T01:59:18Z","pushed_at":"2018-07-06T02:54:39Z","git_url":"git://github.com/git-lfs/wildmatch.git","ssh_url":"git@github.com:git-lfs/wildmatch.git","clone_url":"https://github.com/git-lfs/wildmatch.git","svn_url":"https://github.com/git-lfs/wildmatch","homepage":"","size":25,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/git-lfs/wildmatch/pulls/8"},"html":{"href":"https://github.com/git-lfs/wildmatch/pull/8"},"issue":{"href":"https://api.github.com/repos/git-lfs/wildmatch/issues/8"},"comments":{"href":"https://api.github.com/repos/git-lfs/wildmatch/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/git-lfs/wildmatch/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/git-lfs/wildmatch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/git-lfs/wildmatch/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/git-lfs/wildmatch/statuses/4bfd29c391c1ba475624b48a103649d5ee36232a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"PastelMobileSuit"}}