{"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/pick/pulls/comments/71064178","id":71064178,"diff_hunk":"@@ -0,0 +1,220 @@\n+#include <sys/ioctl.h>\n+#include <sys/select.h>\n+#include <sys/wait.h>\n+\n+#include <err.h>\n+#include <errno.h>\n+#include <fcntl.h>\n+#include <signal.h>\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <unistd.h>\n+\n+static char\t**pickargv;\n+static int\t  gotsig;\n+\n+static char *\n+parsekeys(const char *s)\n+{\n+\tchar\t*buf;\n+\tsize_t\t len = 0;\n+\tsize_t\t size = 16;\n+\tint\t c;\n+\n+\tif ((buf = malloc(size)) == NULL)\n+\t\terr(1, NULL);\n+\n+\tfor (; (c = *s) != '\\0'; s++) {\n+\t\tif (c == '\\\\') {\n+\t\t\tswitch (*++s) {\n+\t\t\tcase 'n':\n+\t\t\t\tc = '\\n';\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tc = *s;\n+\t\t\t}\n+\t\t} else if (c == ' ') {\n+\t\t\tcontinue;\n+\t\t}\n+\t\tbuf[len++] = c;\n+\n+\t\tif (size <= len) {\n+\t\t\tif ((buf = realloc(buf, 2*size)) == NULL)\n+\t\t\t\terr(1, NULL);\n+\t\t\tsize *= 2;\n+\t\t}\n+\t}\n+\tbuf[len] = '\\0';\n+\n+\treturn buf;\n+}\n+\n+static void\n+sighandler(int sig)\n+{\n+\tgotsig = sig == SIGCHLD;\n+}\n+\n+static void\n+child(int master, int slave)\n+{\n+\tstruct winsize\tws;\n+\tint\t\tfd;\n+\n+\tclose(master);\n+\n+\t/* Disconnect the controlling tty. */\n+\tif ((fd = open(\"/dev/tty\", O_RDWR|O_NOCTTY)) == -1)\n+\t\terr(1, \"open\");","path":"tests/pick-test.c","position":null,"original_position":69,"commit_id":"948c01ba9f84b2e5139d36493962745e33cdbfa3","original_commit_id":"5993ac0839de003d36175d11d918626c56e085eb","user":{"login":"mike-burns","id":4550,"avatar_url":"https://avatars.githubusercontent.com/u/4550?v=3","gravatar_id":"","url":"https://api.github.com/users/mike-burns","html_url":"https://github.com/mike-burns","followers_url":"https://api.github.com/users/mike-burns/followers","following_url":"https://api.github.com/users/mike-burns/following{/other_user}","gists_url":"https://api.github.com/users/mike-burns/gists{/gist_id}","starred_url":"https://api.github.com/users/mike-burns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike-burns/subscriptions","organizations_url":"https://api.github.com/users/mike-burns/orgs","repos_url":"https://api.github.com/users/mike-burns/repos","events_url":"https://api.github.com/users/mike-burns/events{/privacy}","received_events_url":"https://api.github.com/users/mike-burns/received_events","type":"User","site_admin":false},"body":"That path is a great improvement -- keep that!","created_at":"2016-07-16T10:13:57Z","updated_at":"2016-07-16T10:13:57Z","html_url":"https://github.com/thoughtbot/pick/pull/148#discussion_r71064178","pull_request_url":"https://api.github.com/repos/thoughtbot/pick/pulls/148","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/pick/pulls/comments/71064178"},"html":{"href":"https://github.com/thoughtbot/pick/pull/148#discussion_r71064178"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/pick/pulls/148"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/pick/pulls/148","id":76869516,"html_url":"https://github.com/thoughtbot/pick/pull/148","diff_url":"https://github.com/thoughtbot/pick/pull/148.diff","patch_url":"https://github.com/thoughtbot/pick/pull/148.patch","issue_url":"https://api.github.com/repos/thoughtbot/pick/issues/148","number":148,"state":"open","locked":false,"title":"Rewrite tests","user":{"login":"mptre","id":43914,"avatar_url":"https://avatars.githubusercontent.com/u/43914?v=3","gravatar_id":"","url":"https://api.github.com/users/mptre","html_url":"https://github.com/mptre","followers_url":"https://api.github.com/users/mptre/followers","following_url":"https://api.github.com/users/mptre/following{/other_user}","gists_url":"https://api.github.com/users/mptre/gists{/gist_id}","starred_url":"https://api.github.com/users/mptre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mptre/subscriptions","organizations_url":"https://api.github.com/users/mptre/orgs","repos_url":"https://api.github.com/users/mptre/repos","events_url":"https://api.github.com/users/mptre/events{/privacy}","received_events_url":"https://api.github.com/users/mptre/received_events","type":"User","site_admin":false},"body":"Work in progress of rewriting the tests. Notable changes:\r\n\r\n- Using the Automake Log Compiler[1] feature improves the output of\r\n  `make check` and parallelism can be utilized (`make check -jN`)\r\n\r\n- Rename `tests/test.c -> tests/pick-test.c` and adopt `style(9)`\r\n\r\n- Change test-case file format, everything is now a field\r\n\r\n- The rewrite highlighted an issue with `OXTABS` on Linux\r\n\r\n- Tested on OpenBSD, Ubuntu and OS X\r\n\r\nQuestion for @mike-burns and all others: can the `TESTS` variable[2] be\r\ninitialized using a wildcard `tests/*.t` without using any GNU-ism?\r\n\r\n[1] https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html\r\n[2] https://github.com/thoughtbot/pick/blob/2ccace20a9ddfe44fc1d0b1e11e4373a089dde23/Makefile.am#L10-L14","created_at":"2016-07-10T10:09:30Z","updated_at":"2016-07-16T10:13:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07241e31c7bdea0847ed578a536e13a7b9f2090d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/pick/pulls/148/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/pick/pulls/148/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/pick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thoughtbot/pick/issues/148/comments","statuses_url":"https://api.github.com/repos/thoughtbot/pick/statuses/948c01ba9f84b2e5139d36493962745e33cdbfa3","head":{"label":"thoughtbot:tests","ref":"tests","sha":"948c01ba9f84b2e5139d36493962745e33cdbfa3","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":23039777,"name":"pick","full_name":"thoughtbot/pick","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/pick","description":"A fuzzy search tool for the command-line","fork":false,"url":"https://api.github.com/repos/thoughtbot/pick","forks_url":"https://api.github.com/repos/thoughtbot/pick/forks","keys_url":"https://api.github.com/repos/thoughtbot/pick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/pick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/pick/teams","hooks_url":"https://api.github.com/repos/thoughtbot/pick/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/pick/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/pick/events","assignees_url":"https://api.github.com/repos/thoughtbot/pick/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/pick/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/pick/tags","blobs_url":"https://api.github.com/repos/thoughtbot/pick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/pick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/pick/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/pick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/pick/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/pick/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/pick/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/pick/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/pick/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/pick/subscription","commits_url":"https://api.github.com/repos/thoughtbot/pick/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/pick/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/pick/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/pick/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/pick/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/pick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/pick/merges","archive_url":"https://api.github.com/repos/thoughtbot/pick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/pick/downloads","issues_url":"https://api.github.com/repos/thoughtbot/pick/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/pick/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/pick/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/pick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/pick/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/pick/releases{/id}","deployments_url":"https://api.github.com/repos/thoughtbot/pick/deployments","created_at":"2014-08-17T12:13:39Z","updated_at":"2016-07-13T04:21:27Z","pushed_at":"2016-07-16T10:01:56Z","git_url":"git://github.com/thoughtbot/pick.git","ssh_url":"git@github.com:thoughtbot/pick.git","clone_url":"https://github.com/thoughtbot/pick.git","svn_url":"https://github.com/thoughtbot/pick","homepage":"https://thoughtbot.com/tools","size":697,"stargazers_count":441,"watchers_count":441,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":12,"forks":21,"open_issues":12,"watchers":441,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"ebf87b4b2a02a3f080534ee256846b33b28762bb","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":23039777,"name":"pick","full_name":"thoughtbot/pick","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/pick","description":"A fuzzy search tool for the command-line","fork":false,"url":"https://api.github.com/repos/thoughtbot/pick","forks_url":"https://api.github.com/repos/thoughtbot/pick/forks","keys_url":"https://api.github.com/repos/thoughtbot/pick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/pick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/pick/teams","hooks_url":"https://api.github.com/repos/thoughtbot/pick/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/pick/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/pick/events","assignees_url":"https://api.github.com/repos/thoughtbot/pick/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/pick/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/pick/tags","blobs_url":"https://api.github.com/repos/thoughtbot/pick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/pick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/pick/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/pick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/pick/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/pick/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/pick/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/pick/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/pick/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/pick/subscription","commits_url":"https://api.github.com/repos/thoughtbot/pick/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/pick/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/pick/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/pick/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/pick/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/pick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/pick/merges","archive_url":"https://api.github.com/repos/thoughtbot/pick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/pick/downloads","issues_url":"https://api.github.com/repos/thoughtbot/pick/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/pick/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/pick/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/pick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/pick/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/pick/releases{/id}","deployments_url":"https://api.github.com/repos/thoughtbot/pick/deployments","created_at":"2014-08-17T12:13:39Z","updated_at":"2016-07-13T04:21:27Z","pushed_at":"2016-07-16T10:01:56Z","git_url":"git://github.com/thoughtbot/pick.git","ssh_url":"git@github.com:thoughtbot/pick.git","clone_url":"https://github.com/thoughtbot/pick.git","svn_url":"https://github.com/thoughtbot/pick","homepage":"https://thoughtbot.com/tools","size":697,"stargazers_count":441,"watchers_count":441,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":12,"forks":21,"open_issues":12,"watchers":441,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/pick/pulls/148"},"html":{"href":"https://github.com/thoughtbot/pick/pull/148"},"issue":{"href":"https://api.github.com/repos/thoughtbot/pick/issues/148"},"comments":{"href":"https://api.github.com/repos/thoughtbot/pick/issues/148/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/pick/pulls/148/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/pick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/pick/pulls/148/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/pick/statuses/948c01ba9f84b2e5139d36493962745e33cdbfa3"}}}}
{"actor":{"display_login":"mike-burns"}}