{"action":"created","comment":{"url":"https://api.github.com/repos/google/protobuf/pulls/comments/75384343","id":75384343,"diff_hunk":"@@ -1026,22 +1026,55 @@ bool ValidateObjCClassPrefix(const FileDescriptor* file,\n     return true;\n   }\n \n-  // Check: Error - Make sure the prefix wasn't expected for a different\n-  // package (overlap is allowed, but it has to be listed as an expected\n-  // overlap).\n+  // Look for any other package that uses the same prefix.\n+  string other_package_for_prefix;\n   for (map<string, string>::iterator i = expected_package_prefixes.begin();\n        i != expected_package_prefixes.end(); ++i) {\n     if (i->second == prefix) {\n-      *out_error =\n-          \"error: Found 'option objc_class_prefix = \\\"\" + prefix +\n-          \"\\\";' in '\" + file->name() +\n-          \"'; that prefix is already used for 'package \" + i->first +\n-          \";'. It can only be reused by listing it in the expected file (\" +\n-          generation_options.expected_prefixes_path + \").\";\n-      return false;  // Only report first usage of the prefix.\n+      other_package_for_prefix = i->first;\n+      break;\n     }\n   }\n \n+  // Check: Warning - If the file does not have a package, check whether\n+  // the prefix declared is being used by another package or not.\n+  if (package.length() == 0) {\n+    // The file does not have a package and ...\n+    if (other_package_for_prefix.length() > 0) {\n+      // ... another package has declared the same prefix.\n+      cerr << endl\n+           << \"protoc:0: warning: File '\" << file->name() << \"' has no package \"\n+           << \"and package '\" << other_package_for_prefix << \"' already uses '\"\n+           << prefix << \"' as its prefix. Consider either adding a new package \"\n+           << \"to the proto, or reusing one of the packages already using this \"\n+           << \"prefix in the expected prefixes file (\"\n+           << generation_options.expected_prefixes_path << \").\" << endl;\n+      cerr.flush();\n+    } else {\n+      // ... no other package has declared that prefix.\n+      cerr << endl\n+           << \"protoc:0: warning: File '\" << file->name() << \"' has no \"\n+           << \"package. Consider adding a new package to the proto and adding '\"\n+           << \"new.package = \" << prefix << \"' to the expected prefixes file (\"\n+           << generation_options.expected_prefixes_path << \").\" << endl;\n+      cerr.flush();\n+    }\n+  }\n+\n+  // Check: Error - Make sure the prefix wasn't expected for a different\n+  // package (overlap is allowed, but it has to be listed as an expected\n+  // overlap).\n+  if (package.length() > 0 && other_package_for_prefix.length() > 0) {","path":"src/google/protobuf/compiler/objectivec/objectivec_helpers.cc","position":null,"original_position":52,"commit_id":"4ad64d6c519ddfa882240bd61c6b1af096b0af30","original_commit_id":"81f39fbc74801e99d2441e880625e824edf5b6ba","user":{"login":"sergiocampama","id":689198,"avatar_url":"https://avatars.githubusercontent.com/u/689198?v=3","gravatar_id":"","url":"https://api.github.com/users/sergiocampama","html_url":"https://github.com/sergiocampama","followers_url":"https://api.github.com/users/sergiocampama/followers","following_url":"https://api.github.com/users/sergiocampama/following{/other_user}","gists_url":"https://api.github.com/users/sergiocampama/gists{/gist_id}","starred_url":"https://api.github.com/users/sergiocampama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergiocampama/subscriptions","organizations_url":"https://api.github.com/users/sergiocampama/orgs","repos_url":"https://api.github.com/users/sergiocampama/repos","events_url":"https://api.github.com/users/sergiocampama/events{/privacy}","received_events_url":"https://api.github.com/users/sergiocampama/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2016-08-18T20:37:00Z","updated_at":"2016-08-18T20:37:00Z","html_url":"https://github.com/google/protobuf/pull/1979#discussion_r75384343","pull_request_url":"https://api.github.com/repos/google/protobuf/pulls/1979","_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments/75384343"},"html":{"href":"https://github.com/google/protobuf/pull/1979#discussion_r75384343"},"pull_request":{"href":"https://api.github.com/repos/google/protobuf/pulls/1979"}}},"pull_request":{"url":"https://api.github.com/repos/google/protobuf/pulls/1979","id":81880670,"html_url":"https://github.com/google/protobuf/pull/1979","diff_url":"https://github.com/google/protobuf/pull/1979.diff","patch_url":"https://github.com/google/protobuf/pull/1979.patch","issue_url":"https://api.github.com/repos/google/protobuf/issues/1979","number":1979,"state":"open","locked":false,"title":"Adds better support for protos without packages ","user":{"login":"sergiocampama","id":689198,"avatar_url":"https://avatars.githubusercontent.com/u/689198?v=3","gravatar_id":"","url":"https://api.github.com/users/sergiocampama","html_url":"https://github.com/sergiocampama","followers_url":"https://api.github.com/users/sergiocampama/followers","following_url":"https://api.github.com/users/sergiocampama/following{/other_user}","gists_url":"https://api.github.com/users/sergiocampama/gists{/gist_id}","starred_url":"https://api.github.com/users/sergiocampama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergiocampama/subscriptions","organizations_url":"https://api.github.com/users/sergiocampama/orgs","repos_url":"https://api.github.com/users/sergiocampama/repos","events_url":"https://api.github.com/users/sergiocampama/events{/privacy}","received_events_url":"https://api.github.com/users/sergiocampama/received_events","type":"User","site_admin":false},"body":"and more warnings on possible improvements","created_at":"2016-08-18T20:16:56Z","updated_at":"2016-08-18T20:37:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0223520662fd4bc7b78d54ce3f91efc66293da44","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/protobuf/pulls/1979/commits","review_comments_url":"https://api.github.com/repos/google/protobuf/pulls/1979/comments","review_comment_url":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/protobuf/issues/1979/comments","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/4ad64d6c519ddfa882240bd61c6b1af096b0af30","head":{"label":"sergiocampama:package","ref":"package","sha":"4ad64d6c519ddfa882240bd61c6b1af096b0af30","user":{"login":"sergiocampama","id":689198,"avatar_url":"https://avatars.githubusercontent.com/u/689198?v=3","gravatar_id":"","url":"https://api.github.com/users/sergiocampama","html_url":"https://github.com/sergiocampama","followers_url":"https://api.github.com/users/sergiocampama/followers","following_url":"https://api.github.com/users/sergiocampama/following{/other_user}","gists_url":"https://api.github.com/users/sergiocampama/gists{/gist_id}","starred_url":"https://api.github.com/users/sergiocampama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergiocampama/subscriptions","organizations_url":"https://api.github.com/users/sergiocampama/orgs","repos_url":"https://api.github.com/users/sergiocampama/repos","events_url":"https://api.github.com/users/sergiocampama/events{/privacy}","received_events_url":"https://api.github.com/users/sergiocampama/received_events","type":"User","site_admin":false},"repo":{"id":53077826,"name":"protobuf","full_name":"sergiocampama/protobuf","owner":{"login":"sergiocampama","id":689198,"avatar_url":"https://avatars.githubusercontent.com/u/689198?v=3","gravatar_id":"","url":"https://api.github.com/users/sergiocampama","html_url":"https://github.com/sergiocampama","followers_url":"https://api.github.com/users/sergiocampama/followers","following_url":"https://api.github.com/users/sergiocampama/following{/other_user}","gists_url":"https://api.github.com/users/sergiocampama/gists{/gist_id}","starred_url":"https://api.github.com/users/sergiocampama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergiocampama/subscriptions","organizations_url":"https://api.github.com/users/sergiocampama/orgs","repos_url":"https://api.github.com/users/sergiocampama/repos","events_url":"https://api.github.com/users/sergiocampama/events{/privacy}","received_events_url":"https://api.github.com/users/sergiocampama/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sergiocampama/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":true,"url":"https://api.github.com/repos/sergiocampama/protobuf","forks_url":"https://api.github.com/repos/sergiocampama/protobuf/forks","keys_url":"https://api.github.com/repos/sergiocampama/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sergiocampama/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sergiocampama/protobuf/teams","hooks_url":"https://api.github.com/repos/sergiocampama/protobuf/hooks","issue_events_url":"https://api.github.com/repos/sergiocampama/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/sergiocampama/protobuf/events","assignees_url":"https://api.github.com/repos/sergiocampama/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/sergiocampama/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/sergiocampama/protobuf/tags","blobs_url":"https://api.github.com/repos/sergiocampama/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sergiocampama/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sergiocampama/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/sergiocampama/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sergiocampama/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/sergiocampama/protobuf/languages","stargazers_url":"https://api.github.com/repos/sergiocampama/protobuf/stargazers","contributors_url":"https://api.github.com/repos/sergiocampama/protobuf/contributors","subscribers_url":"https://api.github.com/repos/sergiocampama/protobuf/subscribers","subscription_url":"https://api.github.com/repos/sergiocampama/protobuf/subscription","commits_url":"https://api.github.com/repos/sergiocampama/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/sergiocampama/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/sergiocampama/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/sergiocampama/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/sergiocampama/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/sergiocampama/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sergiocampama/protobuf/merges","archive_url":"https://api.github.com/repos/sergiocampama/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sergiocampama/protobuf/downloads","issues_url":"https://api.github.com/repos/sergiocampama/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/sergiocampama/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/sergiocampama/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/sergiocampama/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sergiocampama/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/sergiocampama/protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/sergiocampama/protobuf/deployments","created_at":"2016-03-03T19:39:47Z","updated_at":"2016-03-03T19:39:58Z","pushed_at":"2016-08-18T20:33:02Z","git_url":"git://github.com/sergiocampama/protobuf.git","ssh_url":"git@github.com:sergiocampama/protobuf.git","clone_url":"https://github.com/sergiocampama/protobuf.git","svn_url":"https://github.com/sergiocampama/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":34531,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"549dde19282767af6ba875ace06644ab5cfd14e2","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":23357588,"name":"protobuf","full_name":"google/protobuf","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":false,"url":"https://api.github.com/repos/google/protobuf","forks_url":"https://api.github.com/repos/google/protobuf/forks","keys_url":"https://api.github.com/repos/google/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/protobuf/teams","hooks_url":"https://api.github.com/repos/google/protobuf/hooks","issue_events_url":"https://api.github.com/repos/google/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/google/protobuf/events","assignees_url":"https://api.github.com/repos/google/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/google/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/google/protobuf/tags","blobs_url":"https://api.github.com/repos/google/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/google/protobuf/languages","stargazers_url":"https://api.github.com/repos/google/protobuf/stargazers","contributors_url":"https://api.github.com/repos/google/protobuf/contributors","subscribers_url":"https://api.github.com/repos/google/protobuf/subscribers","subscription_url":"https://api.github.com/repos/google/protobuf/subscription","commits_url":"https://api.github.com/repos/google/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/google/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/protobuf/merges","archive_url":"https://api.github.com/repos/google/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/protobuf/downloads","issues_url":"https://api.github.com/repos/google/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/google/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/google/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/google/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/google/protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/google/protobuf/deployments","created_at":"2014-08-26T15:52:15Z","updated_at":"2016-08-18T20:06:39Z","pushed_at":"2016-08-18T20:33:05Z","git_url":"git://github.com/google/protobuf.git","ssh_url":"git@github.com:google/protobuf.git","clone_url":"https://github.com/google/protobuf.git","svn_url":"https://github.com/google/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":62495,"stargazers_count":11307,"watchers_count":11307,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3348,"mirror_url":null,"open_issues_count":466,"forks":3348,"open_issues":466,"watchers":11307,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/1979"},"html":{"href":"https://github.com/google/protobuf/pull/1979"},"issue":{"href":"https://api.github.com/repos/google/protobuf/issues/1979"},"comments":{"href":"https://api.github.com/repos/google/protobuf/issues/1979/comments"},"review_comments":{"href":"https://api.github.com/repos/google/protobuf/pulls/1979/comments"},"review_comment":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/protobuf/pulls/1979/commits"},"statuses":{"href":"https://api.github.com/repos/google/protobuf/statuses/4ad64d6c519ddfa882240bd61c6b1af096b0af30"}}}}
{"actor":{"display_login":"sergiocampama"}}