{"action":"created","comment":{"url":"https://api.github.com/repos/murcul/git-slice/pulls/comments/173205402","pull_request_review_id":102355697,"id":173205402,"diff_hunk":"@@ -47,7 +49,103 @@ async function getLastGitSliceCommitHash(repo) {\n   const revwalk = Git.Revwalk.create(repo);\n   revwalk.pushHead();\n   const commits = await revwalk.getCommitsUntil(c => true);\n-  return removeCommitMsgPrefix(commits.find(x => x.message().indexOf(\"git-slice:\") === 0).message())\n+  const commit = commits\n+    .find(x => x.message().indexOf(COMMIT_MSG_PREFIX) === 0)\n+    .message();\n+  return commit.replace(COMMIT_MSG_PREFIX, \"\");\n+}\n+\n+function promptForCredentials(url, existingUserName) {\n+  console.log(`Credentials required to access ${url}`);\n+  const userName = readlineSync.question(\"Username: \");\n+  const password = readlineSync.question(\"Password: \", {\n+    hideEchoBack: true\n+  });\n+  return Git.Cred.userpassPlaintextNew(userName, password);\n+}\n+\n+async function cloneRepo(mainUrl, mainRepoPath) {\n+  try {\n+    await fs.remove(mainRepoPath);\n+    await Git.Clone.clone(mainUrl, mainRepoPath, {\n+      fetchOpts: {\n+        callbacks: {\n+          credentials: promptForCredentials\n+        }\n+      }\n+    });\n+  } catch (e) {\n+    return Promise.reject(`Unable to clone ${mainUrl}`);\n+  }\n+}\n+\n+async function updateFromOrigin(repo, branch) {\n+  try {\n+    await repo.fetch(\"origin\", {\n+      callbacks: {\n+        credentials: promptForCredentials\n+      }\n+    });\n+    await repo.mergeBranches(branch, `origin/${branch}`);\n+  } catch (e) {\n+    return Promise.reject(`Unable to update ${mainUrl}`);\n+  }\n+}\n+\n+async function getTempRepo(mainUrl, branch) {\n+  const mainRepoPath = TEMPORARY_FOLDER_NAME;","path":"lib/utils.js","position":59,"original_position":59,"commit_id":"9c64b7c5d3eca3459826130d68f37995fed012ce","original_commit_id":"9c64b7c5d3eca3459826130d68f37995fed012ce","user":{"login":"arslanarshad31","id":15626390,"avatar_url":"https://avatars2.githubusercontent.com/u/15626390?v=4","gravatar_id":"","url":"https://api.github.com/users/arslanarshad31","html_url":"https://github.com/arslanarshad31","followers_url":"https://api.github.com/users/arslanarshad31/followers","following_url":"https://api.github.com/users/arslanarshad31/following{/other_user}","gists_url":"https://api.github.com/users/arslanarshad31/gists{/gist_id}","starred_url":"https://api.github.com/users/arslanarshad31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arslanarshad31/subscriptions","organizations_url":"https://api.github.com/users/arslanarshad31/orgs","repos_url":"https://api.github.com/users/arslanarshad31/repos","events_url":"https://api.github.com/users/arslanarshad31/events{/privacy}","received_events_url":"https://api.github.com/users/arslanarshad31/received_events","type":"User","site_admin":false},"body":"Yeah it can be handy for slicing multiple repos 👍 \r\nGood catch, will incorporate that soon.","created_at":"2018-03-08T16:07:36Z","updated_at":"2018-03-08T16:07:36Z","html_url":"https://github.com/murcul/git-slice/pull/20#discussion_r173205402","pull_request_url":"https://api.github.com/repos/murcul/git-slice/pulls/20","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/murcul/git-slice/pulls/comments/173205402"},"html":{"href":"https://github.com/murcul/git-slice/pull/20#discussion_r173205402"},"pull_request":{"href":"https://api.github.com/repos/murcul/git-slice/pulls/20"}},"in_reply_to_id":173138253},"pull_request":{"url":"https://api.github.com/repos/murcul/git-slice/pulls/20","id":172261670,"html_url":"https://github.com/murcul/git-slice/pull/20","diff_url":"https://github.com/murcul/git-slice/pull/20.diff","patch_url":"https://github.com/murcul/git-slice/pull/20.patch","issue_url":"https://api.github.com/repos/murcul/git-slice/issues/20","number":20,"state":"open","locked":false,"title":"[Review] Improvements","user":{"login":"arslanarshad31","id":15626390,"avatar_url":"https://avatars2.githubusercontent.com/u/15626390?v=4","gravatar_id":"","url":"https://api.github.com/users/arslanarshad31","html_url":"https://github.com/arslanarshad31","followers_url":"https://api.github.com/users/arslanarshad31/followers","following_url":"https://api.github.com/users/arslanarshad31/following{/other_user}","gists_url":"https://api.github.com/users/arslanarshad31/gists{/gist_id}","starred_url":"https://api.github.com/users/arslanarshad31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arslanarshad31/subscriptions","organizations_url":"https://api.github.com/users/arslanarshad31/orgs","repos_url":"https://api.github.com/users/arslanarshad31/repos","events_url":"https://api.github.com/users/arslanarshad31/events{/privacy}","received_events_url":"https://api.github.com/users/arslanarshad31/received_events","type":"User","site_admin":false},"body":"This PRs aims to resolve the following:\r\n- Making git-slice.json immutable (for most cases)\r\n- Operate over remote URLs","created_at":"2018-03-01T15:04:26Z","updated_at":"2018-03-08T16:07:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2d86c96aabea6aa08877235ba1c306674487f7a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/murcul/git-slice/pulls/20/commits","review_comments_url":"https://api.github.com/repos/murcul/git-slice/pulls/20/comments","review_comment_url":"https://api.github.com/repos/murcul/git-slice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/murcul/git-slice/issues/20/comments","statuses_url":"https://api.github.com/repos/murcul/git-slice/statuses/9c64b7c5d3eca3459826130d68f37995fed012ce","head":{"label":"murcul:improvements","ref":"improvements","sha":"9c64b7c5d3eca3459826130d68f37995fed012ce","user":{"login":"murcul","id":31163758,"avatar_url":"https://avatars3.githubusercontent.com/u/31163758?v=4","gravatar_id":"","url":"https://api.github.com/users/murcul","html_url":"https://github.com/murcul","followers_url":"https://api.github.com/users/murcul/followers","following_url":"https://api.github.com/users/murcul/following{/other_user}","gists_url":"https://api.github.com/users/murcul/gists{/gist_id}","starred_url":"https://api.github.com/users/murcul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murcul/subscriptions","organizations_url":"https://api.github.com/users/murcul/orgs","repos_url":"https://api.github.com/users/murcul/repos","events_url":"https://api.github.com/users/murcul/events{/privacy}","received_events_url":"https://api.github.com/users/murcul/received_events","type":"Organization","site_admin":false},"repo":{"id":101085801,"name":"git-slice","full_name":"murcul/git-slice","owner":{"login":"murcul","id":31163758,"avatar_url":"https://avatars3.githubusercontent.com/u/31163758?v=4","gravatar_id":"","url":"https://api.github.com/users/murcul","html_url":"https://github.com/murcul","followers_url":"https://api.github.com/users/murcul/followers","following_url":"https://api.github.com/users/murcul/following{/other_user}","gists_url":"https://api.github.com/users/murcul/gists{/gist_id}","starred_url":"https://api.github.com/users/murcul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murcul/subscriptions","organizations_url":"https://api.github.com/users/murcul/orgs","repos_url":"https://api.github.com/users/murcul/repos","events_url":"https://api.github.com/users/murcul/events{/privacy}","received_events_url":"https://api.github.com/users/murcul/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/murcul/git-slice","description":null,"fork":false,"url":"https://api.github.com/repos/murcul/git-slice","forks_url":"https://api.github.com/repos/murcul/git-slice/forks","keys_url":"https://api.github.com/repos/murcul/git-slice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/murcul/git-slice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/murcul/git-slice/teams","hooks_url":"https://api.github.com/repos/murcul/git-slice/hooks","issue_events_url":"https://api.github.com/repos/murcul/git-slice/issues/events{/number}","events_url":"https://api.github.com/repos/murcul/git-slice/events","assignees_url":"https://api.github.com/repos/murcul/git-slice/assignees{/user}","branches_url":"https://api.github.com/repos/murcul/git-slice/branches{/branch}","tags_url":"https://api.github.com/repos/murcul/git-slice/tags","blobs_url":"https://api.github.com/repos/murcul/git-slice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/murcul/git-slice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/murcul/git-slice/git/refs{/sha}","trees_url":"https://api.github.com/repos/murcul/git-slice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/murcul/git-slice/statuses/{sha}","languages_url":"https://api.github.com/repos/murcul/git-slice/languages","stargazers_url":"https://api.github.com/repos/murcul/git-slice/stargazers","contributors_url":"https://api.github.com/repos/murcul/git-slice/contributors","subscribers_url":"https://api.github.com/repos/murcul/git-slice/subscribers","subscription_url":"https://api.github.com/repos/murcul/git-slice/subscription","commits_url":"https://api.github.com/repos/murcul/git-slice/commits{/sha}","git_commits_url":"https://api.github.com/repos/murcul/git-slice/git/commits{/sha}","comments_url":"https://api.github.com/repos/murcul/git-slice/comments{/number}","issue_comment_url":"https://api.github.com/repos/murcul/git-slice/issues/comments{/number}","contents_url":"https://api.github.com/repos/murcul/git-slice/contents/{+path}","compare_url":"https://api.github.com/repos/murcul/git-slice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/murcul/git-slice/merges","archive_url":"https://api.github.com/repos/murcul/git-slice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/murcul/git-slice/downloads","issues_url":"https://api.github.com/repos/murcul/git-slice/issues{/number}","pulls_url":"https://api.github.com/repos/murcul/git-slice/pulls{/number}","milestones_url":"https://api.github.com/repos/murcul/git-slice/milestones{/number}","notifications_url":"https://api.github.com/repos/murcul/git-slice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/murcul/git-slice/labels{/name}","releases_url":"https://api.github.com/repos/murcul/git-slice/releases{/id}","deployments_url":"https://api.github.com/repos/murcul/git-slice/deployments","created_at":"2017-08-22T16:48:02Z","updated_at":"2018-02-23T16:25:55Z","pushed_at":"2018-03-08T15:06:34Z","git_url":"git://github.com/murcul/git-slice.git","ssh_url":"git@github.com:murcul/git-slice.git","clone_url":"https://github.com/murcul/git-slice.git","svn_url":"https://github.com/murcul/git-slice","homepage":null,"size":218,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"murcul:master","ref":"master","sha":"eacb9a16a3a8f675cdad300c36ab91805f503f9f","user":{"login":"murcul","id":31163758,"avatar_url":"https://avatars3.githubusercontent.com/u/31163758?v=4","gravatar_id":"","url":"https://api.github.com/users/murcul","html_url":"https://github.com/murcul","followers_url":"https://api.github.com/users/murcul/followers","following_url":"https://api.github.com/users/murcul/following{/other_user}","gists_url":"https://api.github.com/users/murcul/gists{/gist_id}","starred_url":"https://api.github.com/users/murcul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murcul/subscriptions","organizations_url":"https://api.github.com/users/murcul/orgs","repos_url":"https://api.github.com/users/murcul/repos","events_url":"https://api.github.com/users/murcul/events{/privacy}","received_events_url":"https://api.github.com/users/murcul/received_events","type":"Organization","site_admin":false},"repo":{"id":101085801,"name":"git-slice","full_name":"murcul/git-slice","owner":{"login":"murcul","id":31163758,"avatar_url":"https://avatars3.githubusercontent.com/u/31163758?v=4","gravatar_id":"","url":"https://api.github.com/users/murcul","html_url":"https://github.com/murcul","followers_url":"https://api.github.com/users/murcul/followers","following_url":"https://api.github.com/users/murcul/following{/other_user}","gists_url":"https://api.github.com/users/murcul/gists{/gist_id}","starred_url":"https://api.github.com/users/murcul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murcul/subscriptions","organizations_url":"https://api.github.com/users/murcul/orgs","repos_url":"https://api.github.com/users/murcul/repos","events_url":"https://api.github.com/users/murcul/events{/privacy}","received_events_url":"https://api.github.com/users/murcul/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/murcul/git-slice","description":null,"fork":false,"url":"https://api.github.com/repos/murcul/git-slice","forks_url":"https://api.github.com/repos/murcul/git-slice/forks","keys_url":"https://api.github.com/repos/murcul/git-slice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/murcul/git-slice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/murcul/git-slice/teams","hooks_url":"https://api.github.com/repos/murcul/git-slice/hooks","issue_events_url":"https://api.github.com/repos/murcul/git-slice/issues/events{/number}","events_url":"https://api.github.com/repos/murcul/git-slice/events","assignees_url":"https://api.github.com/repos/murcul/git-slice/assignees{/user}","branches_url":"https://api.github.com/repos/murcul/git-slice/branches{/branch}","tags_url":"https://api.github.com/repos/murcul/git-slice/tags","blobs_url":"https://api.github.com/repos/murcul/git-slice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/murcul/git-slice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/murcul/git-slice/git/refs{/sha}","trees_url":"https://api.github.com/repos/murcul/git-slice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/murcul/git-slice/statuses/{sha}","languages_url":"https://api.github.com/repos/murcul/git-slice/languages","stargazers_url":"https://api.github.com/repos/murcul/git-slice/stargazers","contributors_url":"https://api.github.com/repos/murcul/git-slice/contributors","subscribers_url":"https://api.github.com/repos/murcul/git-slice/subscribers","subscription_url":"https://api.github.com/repos/murcul/git-slice/subscription","commits_url":"https://api.github.com/repos/murcul/git-slice/commits{/sha}","git_commits_url":"https://api.github.com/repos/murcul/git-slice/git/commits{/sha}","comments_url":"https://api.github.com/repos/murcul/git-slice/comments{/number}","issue_comment_url":"https://api.github.com/repos/murcul/git-slice/issues/comments{/number}","contents_url":"https://api.github.com/repos/murcul/git-slice/contents/{+path}","compare_url":"https://api.github.com/repos/murcul/git-slice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/murcul/git-slice/merges","archive_url":"https://api.github.com/repos/murcul/git-slice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/murcul/git-slice/downloads","issues_url":"https://api.github.com/repos/murcul/git-slice/issues{/number}","pulls_url":"https://api.github.com/repos/murcul/git-slice/pulls{/number}","milestones_url":"https://api.github.com/repos/murcul/git-slice/milestones{/number}","notifications_url":"https://api.github.com/repos/murcul/git-slice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/murcul/git-slice/labels{/name}","releases_url":"https://api.github.com/repos/murcul/git-slice/releases{/id}","deployments_url":"https://api.github.com/repos/murcul/git-slice/deployments","created_at":"2017-08-22T16:48:02Z","updated_at":"2018-02-23T16:25:55Z","pushed_at":"2018-03-08T15:06:34Z","git_url":"git://github.com/murcul/git-slice.git","ssh_url":"git@github.com:murcul/git-slice.git","clone_url":"https://github.com/murcul/git-slice.git","svn_url":"https://github.com/murcul/git-slice","homepage":null,"size":218,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/murcul/git-slice/pulls/20"},"html":{"href":"https://github.com/murcul/git-slice/pull/20"},"issue":{"href":"https://api.github.com/repos/murcul/git-slice/issues/20"},"comments":{"href":"https://api.github.com/repos/murcul/git-slice/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/murcul/git-slice/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/murcul/git-slice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/murcul/git-slice/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/murcul/git-slice/statuses/9c64b7c5d3eca3459826130d68f37995fed012ce"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"arslanarshad31"}}