{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/gettext/pulls/comments/42311366","id":42311366,"diff_hunk":"@@ -238,10 +240,28 @@ defmodule Gettext.PO do\n     Enum.map(comments, &[&1, ?\\n])\n   end\n \n+  defp dump_references([]) do\n+    \"\"\n+  end\n+\n   defp dump_references(references) do\n-    for {file, line} <- references do\n-      \"#: #{file}:#{line}\\n\"\n+    # This function outputs a bunch of #: comments with as many references on\n+    # each line as there can be under @reference_wrapping_column columns.\n+    # In the flat_map_reduce, we insert newlines and comment delimiters (#:)\n+    # when references wrap, building an iolist. At the end, we need to insert\n+    # the first comment delimiter and the last newline.\n+    wrapping_column = @reference_wrapping_column - String.length(\"#:\")\n+    {iolist, _} = Enum.flat_map_reduce references, 0, fn({file, line}, line_length) ->","path":"lib/gettext/po.ex","position":26,"original_position":26,"commit_id":"fdd11a44a2d544cf1aafbd5ca3e409261a1c9362","original_commit_id":"fdd11a44a2d544cf1aafbd5ca3e409261a1c9362","user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"body":"Just an idea, this may be simpler if you first group the times that fit a single line and then generate the lines. But maybe not. :)","created_at":"2015-10-17T17:02:51Z","updated_at":"2015-10-17T17:02:51Z","html_url":"https://github.com/elixir-lang/gettext/pull/47#discussion_r42311366","pull_request_url":"https://api.github.com/repos/elixir-lang/gettext/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/gettext/pulls/comments/42311366"},"html":{"href":"https://github.com/elixir-lang/gettext/pull/47#discussion_r42311366"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/gettext/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/gettext/pulls/47","id":47986059,"html_url":"https://github.com/elixir-lang/gettext/pull/47","diff_url":"https://github.com/elixir-lang/gettext/pull/47.diff","patch_url":"https://github.com/elixir-lang/gettext/pull/47.patch","issue_url":"https://api.github.com/repos/elixir-lang/gettext/issues/47","number":47,"state":"open","locked":false,"title":"References","user":{"login":"whatyouhide","id":3890250,"avatar_url":"https://avatars.githubusercontent.com/u/3890250?v=3","gravatar_id":"","url":"https://api.github.com/users/whatyouhide","html_url":"https://github.com/whatyouhide","followers_url":"https://api.github.com/users/whatyouhide/followers","following_url":"https://api.github.com/users/whatyouhide/following{/other_user}","gists_url":"https://api.github.com/users/whatyouhide/gists{/gist_id}","starred_url":"https://api.github.com/users/whatyouhide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whatyouhide/subscriptions","organizations_url":"https://api.github.com/users/whatyouhide/orgs","repos_url":"https://api.github.com/users/whatyouhide/repos","events_url":"https://api.github.com/users/whatyouhide/events{/privacy}","received_events_url":"https://api.github.com/users/whatyouhide/received_events","type":"User","site_admin":false},"body":"@josevalim I'm not proud of the implementation, but the feature works: parsing multiple references on the same line and dumping PO with all the references joined in one line and then wrapped.\r\n\r\nOn IRC the problem of spaces in file names arrived. I looked at `xgettext` and with this:\r\n\r\n```\r\nxgettext \"foo bar.c\" foo.c\r\n```\r\n\r\nyou get\r\n\r\n```po\r\n# foo bar.c:1 foo.c:1\r\nmsgid \"foo\"\r\nmsgstr \"bar\"\r\n```\r\n\r\nSo I pretty much decided to use line numbers to separate filenames. So after a line number, everything up to the next line number is the file name. Let me know what you think!\r\n\r\nThis would close #46.\r\n\r\n/cc @tmjoen","created_at":"2015-10-17T12:55:46Z","updated_at":"2015-10-17T17:02:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9df688531832a10f570730eb5aadf63883a5c7de","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/gettext/pulls/47/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/gettext/pulls/47/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/gettext/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/gettext/issues/47/comments","statuses_url":"https://api.github.com/repos/elixir-lang/gettext/statuses/fdd11a44a2d544cf1aafbd5ca3e409261a1c9362","head":{"label":"elixir-lang:references","ref":"references","sha":"fdd11a44a2d544cf1aafbd5ca3e409261a1c9362","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":31918746,"name":"gettext","full_name":"elixir-lang/gettext","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/gettext","description":"gettext-based implementation for Elixir","fork":false,"url":"https://api.github.com/repos/elixir-lang/gettext","forks_url":"https://api.github.com/repos/elixir-lang/gettext/forks","keys_url":"https://api.github.com/repos/elixir-lang/gettext/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/gettext/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/gettext/teams","hooks_url":"https://api.github.com/repos/elixir-lang/gettext/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/gettext/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/gettext/events","assignees_url":"https://api.github.com/repos/elixir-lang/gettext/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/gettext/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/gettext/tags","blobs_url":"https://api.github.com/repos/elixir-lang/gettext/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/gettext/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/gettext/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/gettext/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/gettext/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/gettext/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/gettext/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/gettext/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/gettext/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/gettext/subscription","commits_url":"https://api.github.com/repos/elixir-lang/gettext/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/gettext/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/gettext/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/gettext/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/gettext/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/gettext/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/gettext/merges","archive_url":"https://api.github.com/repos/elixir-lang/gettext/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/gettext/downloads","issues_url":"https://api.github.com/repos/elixir-lang/gettext/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/gettext/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/gettext/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/gettext/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/gettext/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/gettext/releases{/id}","created_at":"2015-03-09T19:41:44Z","updated_at":"2015-10-16T02:38:17Z","pushed_at":"2015-10-17T12:55:47Z","git_url":"git://github.com/elixir-lang/gettext.git","ssh_url":"git@github.com:elixir-lang/gettext.git","clone_url":"https://github.com/elixir-lang/gettext.git","svn_url":"https://github.com/elixir-lang/gettext","homepage":null,"size":721,"stargazers_count":32,"watchers_count":32,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":32,"default_branch":"master"}},"base":{"label":"elixir-lang:master","ref":"master","sha":"5e83081a81b2755487e3d6004e3c349e5a3fcf1d","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":31918746,"name":"gettext","full_name":"elixir-lang/gettext","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/gettext","description":"gettext-based implementation for Elixir","fork":false,"url":"https://api.github.com/repos/elixir-lang/gettext","forks_url":"https://api.github.com/repos/elixir-lang/gettext/forks","keys_url":"https://api.github.com/repos/elixir-lang/gettext/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/gettext/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/gettext/teams","hooks_url":"https://api.github.com/repos/elixir-lang/gettext/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/gettext/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/gettext/events","assignees_url":"https://api.github.com/repos/elixir-lang/gettext/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/gettext/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/gettext/tags","blobs_url":"https://api.github.com/repos/elixir-lang/gettext/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/gettext/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/gettext/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/gettext/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/gettext/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/gettext/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/gettext/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/gettext/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/gettext/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/gettext/subscription","commits_url":"https://api.github.com/repos/elixir-lang/gettext/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/gettext/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/gettext/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/gettext/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/gettext/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/gettext/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/gettext/merges","archive_url":"https://api.github.com/repos/elixir-lang/gettext/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/gettext/downloads","issues_url":"https://api.github.com/repos/elixir-lang/gettext/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/gettext/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/gettext/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/gettext/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/gettext/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/gettext/releases{/id}","created_at":"2015-03-09T19:41:44Z","updated_at":"2015-10-16T02:38:17Z","pushed_at":"2015-10-17T12:55:47Z","git_url":"git://github.com/elixir-lang/gettext.git","ssh_url":"git@github.com:elixir-lang/gettext.git","clone_url":"https://github.com/elixir-lang/gettext.git","svn_url":"https://github.com/elixir-lang/gettext","homepage":null,"size":721,"stargazers_count":32,"watchers_count":32,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/gettext/pulls/47"},"html":{"href":"https://github.com/elixir-lang/gettext/pull/47"},"issue":{"href":"https://api.github.com/repos/elixir-lang/gettext/issues/47"},"comments":{"href":"https://api.github.com/repos/elixir-lang/gettext/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/gettext/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/gettext/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/gettext/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/gettext/statuses/fdd11a44a2d544cf1aafbd5ca3e409261a1c9362"}}}}