{"action":"created","comment":{"url":"https://api.github.com/repos/traildb/traildb/pulls/comments/69375909","id":69375909,"diff_hunk":"@@ -0,0 +1,57 @@\n+#define _DEFAULT_SOURCE /* mkstemp */\n+#define _GNU_SOURCE\n+\n+#include <fcntl.h>\n+#include <unistd.h>\n+#include <sys/types.h>\n+#include <stdlib.h>\n+#include <string.h>\n+\n+#include \"tdb_internal.h\"\n+\n+static int compare(uint64_t t1, uint64_t t2)\n+{\n+    if (t1 > t2)\n+        return 1;\n+    if (t1 < t2)\n+        return -1;\n+    return 0;\n+}\n+\n+#define SORT_TYPE      struct tdb_grouped_event\n+#define SORT_NAME      _events\n+#define SORT_CMP(x,y)  compare((x).timestamp, (y).timestamp)\n+#include \"sort/sort.h\"\n+\n+void events_sort(struct tdb_grouped_event *buf, uint64_t num_events)","path":"src/tdb_sort.c","position":26,"original_position":26,"commit_id":"664785c52a12bf434ca235c1c732859ce64e6bc2","original_commit_id":"4b190b2e9e6aacf75a5febe05aa5a2d266c9afeb","user":{"login":"rasky","id":1014109,"avatar_url":"https://avatars.githubusercontent.com/u/1014109?v=3","gravatar_id":"","url":"https://api.github.com/users/rasky","html_url":"https://github.com/rasky","followers_url":"https://api.github.com/users/rasky/followers","following_url":"https://api.github.com/users/rasky/following{/other_user}","gists_url":"https://api.github.com/users/rasky/gists{/gist_id}","starred_url":"https://api.github.com/users/rasky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasky/subscriptions","organizations_url":"https://api.github.com/users/rasky/orgs","repos_url":"https://api.github.com/users/rasky/repos","events_url":"https://api.github.com/users/rasky/events{/privacy}","received_events_url":"https://api.github.com/users/rasky/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2016-07-02T09:47:07Z","updated_at":"2016-07-02T09:47:07Z","html_url":"https://github.com/traildb/traildb/pull/84#discussion_r69375909","pull_request_url":"https://api.github.com/repos/traildb/traildb/pulls/84","_links":{"self":{"href":"https://api.github.com/repos/traildb/traildb/pulls/comments/69375909"},"html":{"href":"https://github.com/traildb/traildb/pull/84#discussion_r69375909"},"pull_request":{"href":"https://api.github.com/repos/traildb/traildb/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/traildb/traildb/pulls/84","id":76053708,"html_url":"https://github.com/traildb/traildb/pull/84","diff_url":"https://github.com/traildb/traildb/pull/84.diff","patch_url":"https://github.com/traildb/traildb/pull/84.patch","issue_url":"https://api.github.com/repos/traildb/traildb/issues/84","number":84,"state":"open","locked":false,"title":"Implement stable sorting for events","user":{"login":"rasky","id":1014109,"avatar_url":"https://avatars.githubusercontent.com/u/1014109?v=3","gravatar_id":"","url":"https://api.github.com/users/rasky","html_url":"https://github.com/rasky","followers_url":"https://api.github.com/users/rasky/followers","following_url":"https://api.github.com/users/rasky/following{/other_user}","gists_url":"https://api.github.com/users/rasky/gists{/gist_id}","starred_url":"https://api.github.com/users/rasky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasky/subscriptions","organizations_url":"https://api.github.com/users/rasky/orgs","repos_url":"https://api.github.com/users/rasky/repos","events_url":"https://api.github.com/users/rasky/events{/privacy}","received_events_url":"https://api.github.com/users/rasky/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-02T02:24:16Z","updated_at":"2016-07-02T09:47:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67c0b444c593bbe72121a2e4106e6609ce29d906","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/traildb/traildb/pulls/84/commits","review_comments_url":"https://api.github.com/repos/traildb/traildb/pulls/84/comments","review_comment_url":"https://api.github.com/repos/traildb/traildb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/traildb/traildb/issues/84/comments","statuses_url":"https://api.github.com/repos/traildb/traildb/statuses/664785c52a12bf434ca235c1c732859ce64e6bc2","head":{"label":"rasky:stable_sort","ref":"stable_sort","sha":"664785c52a12bf434ca235c1c732859ce64e6bc2","user":{"login":"rasky","id":1014109,"avatar_url":"https://avatars.githubusercontent.com/u/1014109?v=3","gravatar_id":"","url":"https://api.github.com/users/rasky","html_url":"https://github.com/rasky","followers_url":"https://api.github.com/users/rasky/followers","following_url":"https://api.github.com/users/rasky/following{/other_user}","gists_url":"https://api.github.com/users/rasky/gists{/gist_id}","starred_url":"https://api.github.com/users/rasky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasky/subscriptions","organizations_url":"https://api.github.com/users/rasky/orgs","repos_url":"https://api.github.com/users/rasky/repos","events_url":"https://api.github.com/users/rasky/events{/privacy}","received_events_url":"https://api.github.com/users/rasky/received_events","type":"User","site_admin":false},"repo":{"id":59590087,"name":"traildb-1","full_name":"rasky/traildb-1","owner":{"login":"rasky","id":1014109,"avatar_url":"https://avatars.githubusercontent.com/u/1014109?v=3","gravatar_id":"","url":"https://api.github.com/users/rasky","html_url":"https://github.com/rasky","followers_url":"https://api.github.com/users/rasky/followers","following_url":"https://api.github.com/users/rasky/following{/other_user}","gists_url":"https://api.github.com/users/rasky/gists{/gist_id}","starred_url":"https://api.github.com/users/rasky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasky/subscriptions","organizations_url":"https://api.github.com/users/rasky/orgs","repos_url":"https://api.github.com/users/rasky/repos","events_url":"https://api.github.com/users/rasky/events{/privacy}","received_events_url":"https://api.github.com/users/rasky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rasky/traildb-1","description":"TrailDB is an efficient tool for storing and querying series of events","fork":true,"url":"https://api.github.com/repos/rasky/traildb-1","forks_url":"https://api.github.com/repos/rasky/traildb-1/forks","keys_url":"https://api.github.com/repos/rasky/traildb-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rasky/traildb-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rasky/traildb-1/teams","hooks_url":"https://api.github.com/repos/rasky/traildb-1/hooks","issue_events_url":"https://api.github.com/repos/rasky/traildb-1/issues/events{/number}","events_url":"https://api.github.com/repos/rasky/traildb-1/events","assignees_url":"https://api.github.com/repos/rasky/traildb-1/assignees{/user}","branches_url":"https://api.github.com/repos/rasky/traildb-1/branches{/branch}","tags_url":"https://api.github.com/repos/rasky/traildb-1/tags","blobs_url":"https://api.github.com/repos/rasky/traildb-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rasky/traildb-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rasky/traildb-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/rasky/traildb-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rasky/traildb-1/statuses/{sha}","languages_url":"https://api.github.com/repos/rasky/traildb-1/languages","stargazers_url":"https://api.github.com/repos/rasky/traildb-1/stargazers","contributors_url":"https://api.github.com/repos/rasky/traildb-1/contributors","subscribers_url":"https://api.github.com/repos/rasky/traildb-1/subscribers","subscription_url":"https://api.github.com/repos/rasky/traildb-1/subscription","commits_url":"https://api.github.com/repos/rasky/traildb-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/rasky/traildb-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/rasky/traildb-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/rasky/traildb-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/rasky/traildb-1/contents/{+path}","compare_url":"https://api.github.com/repos/rasky/traildb-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rasky/traildb-1/merges","archive_url":"https://api.github.com/repos/rasky/traildb-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rasky/traildb-1/downloads","issues_url":"https://api.github.com/repos/rasky/traildb-1/issues{/number}","pulls_url":"https://api.github.com/repos/rasky/traildb-1/pulls{/number}","milestones_url":"https://api.github.com/repos/rasky/traildb-1/milestones{/number}","notifications_url":"https://api.github.com/repos/rasky/traildb-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rasky/traildb-1/labels{/name}","releases_url":"https://api.github.com/repos/rasky/traildb-1/releases{/id}","deployments_url":"https://api.github.com/repos/rasky/traildb-1/deployments","created_at":"2016-05-24T16:31:02Z","updated_at":"2016-05-24T16:31:03Z","pushed_at":"2016-07-02T09:46:00Z","git_url":"git://github.com/rasky/traildb-1.git","ssh_url":"git@github.com:rasky/traildb-1.git","clone_url":"https://github.com/rasky/traildb-1.git","svn_url":"https://github.com/rasky/traildb-1","homepage":"http://traildb.io","size":1287,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"traildb:master","ref":"master","sha":"a077e1ee1fad14185764ef0fa071184e18acb551","user":{"login":"traildb","id":16310720,"avatar_url":"https://avatars.githubusercontent.com/u/16310720?v=3","gravatar_id":"","url":"https://api.github.com/users/traildb","html_url":"https://github.com/traildb","followers_url":"https://api.github.com/users/traildb/followers","following_url":"https://api.github.com/users/traildb/following{/other_user}","gists_url":"https://api.github.com/users/traildb/gists{/gist_id}","starred_url":"https://api.github.com/users/traildb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/traildb/subscriptions","organizations_url":"https://api.github.com/users/traildb/orgs","repos_url":"https://api.github.com/users/traildb/repos","events_url":"https://api.github.com/users/traildb/events{/privacy}","received_events_url":"https://api.github.com/users/traildb/received_events","type":"Organization","site_admin":false},"repo":{"id":22868877,"name":"traildb","full_name":"traildb/traildb","owner":{"login":"traildb","id":16310720,"avatar_url":"https://avatars.githubusercontent.com/u/16310720?v=3","gravatar_id":"","url":"https://api.github.com/users/traildb","html_url":"https://github.com/traildb","followers_url":"https://api.github.com/users/traildb/followers","following_url":"https://api.github.com/users/traildb/following{/other_user}","gists_url":"https://api.github.com/users/traildb/gists{/gist_id}","starred_url":"https://api.github.com/users/traildb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/traildb/subscriptions","organizations_url":"https://api.github.com/users/traildb/orgs","repos_url":"https://api.github.com/users/traildb/repos","events_url":"https://api.github.com/users/traildb/events{/privacy}","received_events_url":"https://api.github.com/users/traildb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/traildb/traildb","description":"TrailDB is an efficient tool for storing and querying series of events","fork":false,"url":"https://api.github.com/repos/traildb/traildb","forks_url":"https://api.github.com/repos/traildb/traildb/forks","keys_url":"https://api.github.com/repos/traildb/traildb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/traildb/traildb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/traildb/traildb/teams","hooks_url":"https://api.github.com/repos/traildb/traildb/hooks","issue_events_url":"https://api.github.com/repos/traildb/traildb/issues/events{/number}","events_url":"https://api.github.com/repos/traildb/traildb/events","assignees_url":"https://api.github.com/repos/traildb/traildb/assignees{/user}","branches_url":"https://api.github.com/repos/traildb/traildb/branches{/branch}","tags_url":"https://api.github.com/repos/traildb/traildb/tags","blobs_url":"https://api.github.com/repos/traildb/traildb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/traildb/traildb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/traildb/traildb/git/refs{/sha}","trees_url":"https://api.github.com/repos/traildb/traildb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/traildb/traildb/statuses/{sha}","languages_url":"https://api.github.com/repos/traildb/traildb/languages","stargazers_url":"https://api.github.com/repos/traildb/traildb/stargazers","contributors_url":"https://api.github.com/repos/traildb/traildb/contributors","subscribers_url":"https://api.github.com/repos/traildb/traildb/subscribers","subscription_url":"https://api.github.com/repos/traildb/traildb/subscription","commits_url":"https://api.github.com/repos/traildb/traildb/commits{/sha}","git_commits_url":"https://api.github.com/repos/traildb/traildb/git/commits{/sha}","comments_url":"https://api.github.com/repos/traildb/traildb/comments{/number}","issue_comment_url":"https://api.github.com/repos/traildb/traildb/issues/comments{/number}","contents_url":"https://api.github.com/repos/traildb/traildb/contents/{+path}","compare_url":"https://api.github.com/repos/traildb/traildb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/traildb/traildb/merges","archive_url":"https://api.github.com/repos/traildb/traildb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/traildb/traildb/downloads","issues_url":"https://api.github.com/repos/traildb/traildb/issues{/number}","pulls_url":"https://api.github.com/repos/traildb/traildb/pulls{/number}","milestones_url":"https://api.github.com/repos/traildb/traildb/milestones{/number}","notifications_url":"https://api.github.com/repos/traildb/traildb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/traildb/traildb/labels{/name}","releases_url":"https://api.github.com/repos/traildb/traildb/releases{/id}","deployments_url":"https://api.github.com/repos/traildb/traildb/deployments","created_at":"2014-08-12T07:34:48Z","updated_at":"2016-06-29T16:01:17Z","pushed_at":"2016-07-02T09:46:01Z","git_url":"git://github.com/traildb/traildb.git","ssh_url":"git@github.com:traildb/traildb.git","clone_url":"https://github.com/traildb/traildb.git","svn_url":"https://github.com/traildb/traildb","homepage":"http://traildb.io","size":1529,"stargazers_count":601,"watchers_count":601,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":18,"forks":28,"open_issues":18,"watchers":601,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/traildb/traildb/pulls/84"},"html":{"href":"https://github.com/traildb/traildb/pull/84"},"issue":{"href":"https://api.github.com/repos/traildb/traildb/issues/84"},"comments":{"href":"https://api.github.com/repos/traildb/traildb/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/traildb/traildb/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/traildb/traildb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/traildb/traildb/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/traildb/traildb/statuses/664785c52a12bf434ca235c1c732859ce64e6bc2"}}}}
{"actor":{"display_login":"rasky"}}