{"action":"created","comment":{"url":"https://api.github.com/repos/abrady0/orc/pulls/comments/24598216","id":24598216,"diff_hunk":"@@ -1,42 +1,169 @@\n-var app = require('commander');\n+var commander = require('commander');\n var git = require('gitty');\n var path = require('path');\n-\n-// process.stdin.resume();\n-// process.stdin.setEncoding('utf8');\n-// process.stdin.on('data', function(data) {\n-//  process.stdout.write(data);\n-// });\n+var pushover   = require('pushover');\n \n process.on('SIGINT', function () {\n   console.log('Got a SIGINT. Goodbye cruel world');\n   process.exit(0);\n });\n \n-function _requireCommit() {\n+function init(dir, cb) {\n+  // TODO: march up to root dir just to make output consistent\n+  var repo = git(dir);\n+  repo.getBranches(function(err, branches) {\n+    if(err) {\n+      cb('error getting branches '+err);\n+      return;\n+    }\n+    if (!branches.current) {\n+      cb('error: '+repo.name+' doesn\\'t appear to be a valid git repo');\n+      return;\n+    }\n+    cb(null, { repo_dir: dir, repo: git(dir)});\n+  });\n+}\n+\n+function noUnstaged(orc, cb) {\n+  orc.repo.status(function(err, status) {\n+    if(err) {\n+      cb('error getting status checking unstaged '+err);\n+      return;\n+    }\n+    if(status.unstaged.length > 0) {\n+      cb('unstaged files, commit before running this.');\n+      return;\n+    }\n+    cb(null, true);\n+  });\n+}\n+\n+function noUntracked(orc, cb) {\n+  orc.repo.status(function(err, status) {\n+    if(err) {\n+      cb('error getting status checking unstaged '+err);\n+      return;\n+    }\n+    if(status.untracked.length > 0) {\n+      cb('untracked files, add or ignore before running this.');\n+      return;\n+    }","path":"orc.js","position":58,"original_position":58,"commit_id":"593e1e7d1952c6f290d77157f7e1db604e54d26b","original_commit_id":"593e1e7d1952c6f290d77157f7e1db604e54d26b","user":{"login":"Brucer","id":224315,"avatar_url":"https://avatars.githubusercontent.com/u/224315?v=3","gravatar_id":"","url":"https://api.github.com/users/Brucer","html_url":"https://github.com/Brucer","followers_url":"https://api.github.com/users/Brucer/followers","following_url":"https://api.github.com/users/Brucer/following{/other_user}","gists_url":"https://api.github.com/users/Brucer/gists{/gist_id}","starred_url":"https://api.github.com/users/Brucer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brucer/subscriptions","organizations_url":"https://api.github.com/users/Brucer/orgs","repos_url":"https://api.github.com/users/Brucer/repos","events_url":"https://api.github.com/users/Brucer/events{/privacy}","received_events_url":"https://api.github.com/users/Brucer/received_events","type":"User","site_admin":false},"body":"I guess now that it's not an exception, it's probably as composable though.","created_at":"2015-02-12T17:12:26Z","updated_at":"2015-02-12T17:12:26Z","html_url":"https://github.com/abrady0/orc/pull/2#discussion_r24598216","pull_request_url":"https://api.github.com/repos/abrady0/orc/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/abrady0/orc/pulls/comments/24598216"},"html":{"href":"https://github.com/abrady0/orc/pull/2#discussion_r24598216"},"pull_request":{"href":"https://api.github.com/repos/abrady0/orc/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/abrady0/orc/pulls/2","id":29151540,"html_url":"https://github.com/abrady0/orc/pull/2","diff_url":"https://github.com/abrady0/orc/pull/2.diff","patch_url":"https://github.com/abrady0/orc/pull/2.patch","issue_url":"https://api.github.com/repos/abrady0/orc/issues/2","number":2,"state":"open","locked":false,"title":"Orc checkpoint","user":{"login":"abrady0","id":10427533,"avatar_url":"https://avatars.githubusercontent.com/u/10427533?v=3","gravatar_id":"","url":"https://api.github.com/users/abrady0","html_url":"https://github.com/abrady0","followers_url":"https://api.github.com/users/abrady0/followers","following_url":"https://api.github.com/users/abrady0/following{/other_user}","gists_url":"https://api.github.com/users/abrady0/gists{/gist_id}","starred_url":"https://api.github.com/users/abrady0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrady0/subscriptions","organizations_url":"https://api.github.com/users/abrady0/orgs","repos_url":"https://api.github.com/users/abrady0/repos","events_url":"https://api.github.com/users/abrady0/events{/privacy}","received_events_url":"https://api.github.com/users/abrady0/received_events","type":"User","site_admin":false},"body":"orc checkpoint works. also refactored feedback from previous pull request. CC @conordickinson @cory @Brucer  for feedback.","created_at":"2015-02-12T04:07:08Z","updated_at":"2015-02-12T17:12:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"01acae556c0abb51a3dc8c1d748b915c5ed589be","assignee":{"login":"conordickinson","id":774384,"avatar_url":"https://avatars.githubusercontent.com/u/774384?v=3","gravatar_id":"","url":"https://api.github.com/users/conordickinson","html_url":"https://github.com/conordickinson","followers_url":"https://api.github.com/users/conordickinson/followers","following_url":"https://api.github.com/users/conordickinson/following{/other_user}","gists_url":"https://api.github.com/users/conordickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/conordickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conordickinson/subscriptions","organizations_url":"https://api.github.com/users/conordickinson/orgs","repos_url":"https://api.github.com/users/conordickinson/repos","events_url":"https://api.github.com/users/conordickinson/events{/privacy}","received_events_url":"https://api.github.com/users/conordickinson/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/abrady0/orc/pulls/2/commits","review_comments_url":"https://api.github.com/repos/abrady0/orc/pulls/2/comments","review_comment_url":"https://api.github.com/repos/abrady0/orc/pulls/comments/{number}","comments_url":"https://api.github.com/repos/abrady0/orc/issues/2/comments","statuses_url":"https://api.github.com/repos/abrady0/orc/statuses/593e1e7d1952c6f290d77157f7e1db604e54d26b","head":{"label":"abrady0:orc_checkpoint","ref":"orc_checkpoint","sha":"593e1e7d1952c6f290d77157f7e1db604e54d26b","user":{"login":"abrady0","id":10427533,"avatar_url":"https://avatars.githubusercontent.com/u/10427533?v=3","gravatar_id":"","url":"https://api.github.com/users/abrady0","html_url":"https://github.com/abrady0","followers_url":"https://api.github.com/users/abrady0/followers","following_url":"https://api.github.com/users/abrady0/following{/other_user}","gists_url":"https://api.github.com/users/abrady0/gists{/gist_id}","starred_url":"https://api.github.com/users/abrady0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrady0/subscriptions","organizations_url":"https://api.github.com/users/abrady0/orgs","repos_url":"https://api.github.com/users/abrady0/repos","events_url":"https://api.github.com/users/abrady0/events{/privacy}","received_events_url":"https://api.github.com/users/abrady0/received_events","type":"User","site_admin":false},"repo":{"id":30608337,"name":"orc","full_name":"abrady0/orc","owner":{"login":"abrady0","id":10427533,"avatar_url":"https://avatars.githubusercontent.com/u/10427533?v=3","gravatar_id":"","url":"https://api.github.com/users/abrady0","html_url":"https://github.com/abrady0","followers_url":"https://api.github.com/users/abrady0/followers","following_url":"https://api.github.com/users/abrady0/following{/other_user}","gists_url":"https://api.github.com/users/abrady0/gists{/gist_id}","starred_url":"https://api.github.com/users/abrady0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrady0/subscriptions","organizations_url":"https://api.github.com/users/abrady0/orgs","repos_url":"https://api.github.com/users/abrady0/repos","events_url":"https://api.github.com/users/abrady0/events{/privacy}","received_events_url":"https://api.github.com/users/abrady0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abrady0/orc","description":"command line tool","fork":false,"url":"https://api.github.com/repos/abrady0/orc","forks_url":"https://api.github.com/repos/abrady0/orc/forks","keys_url":"https://api.github.com/repos/abrady0/orc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abrady0/orc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abrady0/orc/teams","hooks_url":"https://api.github.com/repos/abrady0/orc/hooks","issue_events_url":"https://api.github.com/repos/abrady0/orc/issues/events{/number}","events_url":"https://api.github.com/repos/abrady0/orc/events","assignees_url":"https://api.github.com/repos/abrady0/orc/assignees{/user}","branches_url":"https://api.github.com/repos/abrady0/orc/branches{/branch}","tags_url":"https://api.github.com/repos/abrady0/orc/tags","blobs_url":"https://api.github.com/repos/abrady0/orc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abrady0/orc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abrady0/orc/git/refs{/sha}","trees_url":"https://api.github.com/repos/abrady0/orc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abrady0/orc/statuses/{sha}","languages_url":"https://api.github.com/repos/abrady0/orc/languages","stargazers_url":"https://api.github.com/repos/abrady0/orc/stargazers","contributors_url":"https://api.github.com/repos/abrady0/orc/contributors","subscribers_url":"https://api.github.com/repos/abrady0/orc/subscribers","subscription_url":"https://api.github.com/repos/abrady0/orc/subscription","commits_url":"https://api.github.com/repos/abrady0/orc/commits{/sha}","git_commits_url":"https://api.github.com/repos/abrady0/orc/git/commits{/sha}","comments_url":"https://api.github.com/repos/abrady0/orc/comments{/number}","issue_comment_url":"https://api.github.com/repos/abrady0/orc/issues/comments/{number}","contents_url":"https://api.github.com/repos/abrady0/orc/contents/{+path}","compare_url":"https://api.github.com/repos/abrady0/orc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abrady0/orc/merges","archive_url":"https://api.github.com/repos/abrady0/orc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abrady0/orc/downloads","issues_url":"https://api.github.com/repos/abrady0/orc/issues{/number}","pulls_url":"https://api.github.com/repos/abrady0/orc/pulls{/number}","milestones_url":"https://api.github.com/repos/abrady0/orc/milestones{/number}","notifications_url":"https://api.github.com/repos/abrady0/orc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abrady0/orc/labels{/name}","releases_url":"https://api.github.com/repos/abrady0/orc/releases{/id}","created_at":"2015-02-10T18:49:18Z","updated_at":"2015-02-11T17:56:37Z","pushed_at":"2015-02-12T08:22:37Z","git_url":"git://github.com/abrady0/orc.git","ssh_url":"git@github.com:abrady0/orc.git","clone_url":"https://github.com/abrady0/orc.git","svn_url":"https://github.com/abrady0/orc","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"abrady0:master","ref":"master","sha":"ebb656065a4acd677c95b2964164d973f5bd22b3","user":{"login":"abrady0","id":10427533,"avatar_url":"https://avatars.githubusercontent.com/u/10427533?v=3","gravatar_id":"","url":"https://api.github.com/users/abrady0","html_url":"https://github.com/abrady0","followers_url":"https://api.github.com/users/abrady0/followers","following_url":"https://api.github.com/users/abrady0/following{/other_user}","gists_url":"https://api.github.com/users/abrady0/gists{/gist_id}","starred_url":"https://api.github.com/users/abrady0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrady0/subscriptions","organizations_url":"https://api.github.com/users/abrady0/orgs","repos_url":"https://api.github.com/users/abrady0/repos","events_url":"https://api.github.com/users/abrady0/events{/privacy}","received_events_url":"https://api.github.com/users/abrady0/received_events","type":"User","site_admin":false},"repo":{"id":30608337,"name":"orc","full_name":"abrady0/orc","owner":{"login":"abrady0","id":10427533,"avatar_url":"https://avatars.githubusercontent.com/u/10427533?v=3","gravatar_id":"","url":"https://api.github.com/users/abrady0","html_url":"https://github.com/abrady0","followers_url":"https://api.github.com/users/abrady0/followers","following_url":"https://api.github.com/users/abrady0/following{/other_user}","gists_url":"https://api.github.com/users/abrady0/gists{/gist_id}","starred_url":"https://api.github.com/users/abrady0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrady0/subscriptions","organizations_url":"https://api.github.com/users/abrady0/orgs","repos_url":"https://api.github.com/users/abrady0/repos","events_url":"https://api.github.com/users/abrady0/events{/privacy}","received_events_url":"https://api.github.com/users/abrady0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abrady0/orc","description":"command line tool","fork":false,"url":"https://api.github.com/repos/abrady0/orc","forks_url":"https://api.github.com/repos/abrady0/orc/forks","keys_url":"https://api.github.com/repos/abrady0/orc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abrady0/orc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abrady0/orc/teams","hooks_url":"https://api.github.com/repos/abrady0/orc/hooks","issue_events_url":"https://api.github.com/repos/abrady0/orc/issues/events{/number}","events_url":"https://api.github.com/repos/abrady0/orc/events","assignees_url":"https://api.github.com/repos/abrady0/orc/assignees{/user}","branches_url":"https://api.github.com/repos/abrady0/orc/branches{/branch}","tags_url":"https://api.github.com/repos/abrady0/orc/tags","blobs_url":"https://api.github.com/repos/abrady0/orc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abrady0/orc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abrady0/orc/git/refs{/sha}","trees_url":"https://api.github.com/repos/abrady0/orc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abrady0/orc/statuses/{sha}","languages_url":"https://api.github.com/repos/abrady0/orc/languages","stargazers_url":"https://api.github.com/repos/abrady0/orc/stargazers","contributors_url":"https://api.github.com/repos/abrady0/orc/contributors","subscribers_url":"https://api.github.com/repos/abrady0/orc/subscribers","subscription_url":"https://api.github.com/repos/abrady0/orc/subscription","commits_url":"https://api.github.com/repos/abrady0/orc/commits{/sha}","git_commits_url":"https://api.github.com/repos/abrady0/orc/git/commits{/sha}","comments_url":"https://api.github.com/repos/abrady0/orc/comments{/number}","issue_comment_url":"https://api.github.com/repos/abrady0/orc/issues/comments/{number}","contents_url":"https://api.github.com/repos/abrady0/orc/contents/{+path}","compare_url":"https://api.github.com/repos/abrady0/orc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abrady0/orc/merges","archive_url":"https://api.github.com/repos/abrady0/orc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abrady0/orc/downloads","issues_url":"https://api.github.com/repos/abrady0/orc/issues{/number}","pulls_url":"https://api.github.com/repos/abrady0/orc/pulls{/number}","milestones_url":"https://api.github.com/repos/abrady0/orc/milestones{/number}","notifications_url":"https://api.github.com/repos/abrady0/orc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abrady0/orc/labels{/name}","releases_url":"https://api.github.com/repos/abrady0/orc/releases{/id}","created_at":"2015-02-10T18:49:18Z","updated_at":"2015-02-11T17:56:37Z","pushed_at":"2015-02-12T08:22:37Z","git_url":"git://github.com/abrady0/orc.git","ssh_url":"git@github.com:abrady0/orc.git","clone_url":"https://github.com/abrady0/orc.git","svn_url":"https://github.com/abrady0/orc","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/abrady0/orc/pulls/2"},"html":{"href":"https://github.com/abrady0/orc/pull/2"},"issue":{"href":"https://api.github.com/repos/abrady0/orc/issues/2"},"comments":{"href":"https://api.github.com/repos/abrady0/orc/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/abrady0/orc/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/abrady0/orc/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/abrady0/orc/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/abrady0/orc/statuses/593e1e7d1952c6f290d77157f7e1db604e54d26b"}}}}