{"action":"created","comment":{"url":"https://api.github.com/repos/driusan/dgit/pulls/comments/204211161","pull_request_review_id":139258306,"id":204211161,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDIxMTE2MQ==","diff_hunk":"@@ -187,7 +188,7 @@ const (\n //\n // As a special case, if something is added as Stage0, then Stage1-3 entries\n // will be removed.\n-func (g *Index) AddStage(c *Client, path IndexPath, mode EntryMode, s Sha1, stage Stage, size uint32, mtime int64, createEntry bool) error {\n+func (g *Index) AddStage(c *Client, path IndexPath, mode EntryMode, s Sha1, stage Stage, size uint32, mtime int64, createEntry bool, replaceEntry bool) error {","path":"git/index.go","position":13,"original_position":13,"commit_id":"33bd90a66fa754055d1099365595510039a7c14e","original_commit_id":"33bd90a66fa754055d1099365595510039a7c14e","user":{"login":"driusan","id":498329,"node_id":"MDQ6VXNlcjQ5ODMyOQ==","avatar_url":"https://avatars0.githubusercontent.com/u/498329?v=4","gravatar_id":"","url":"https://api.github.com/users/driusan","html_url":"https://github.com/driusan","followers_url":"https://api.github.com/users/driusan/followers","following_url":"https://api.github.com/users/driusan/following{/other_user}","gists_url":"https://api.github.com/users/driusan/gists{/gist_id}","starred_url":"https://api.github.com/users/driusan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driusan/subscriptions","organizations_url":"https://api.github.com/users/driusan/orgs","repos_url":"https://api.github.com/users/driusan/repos","events_url":"https://api.github.com/users/driusan/events{/privacy}","received_events_url":"https://api.github.com/users/driusan/received_events","type":"User","site_admin":false},"body":"The code path that uses the new param looks pretty self-contained, and only has one caller that sets it, so can we remove the bool param and have a ReplaceStage function instead?\r\n\r\nAlternatively, if AddStage and ReplaceStage do share a lot of code, maybe AddStage should take an UpdateIndexOptions to keep it more readable at the call site.","created_at":"2018-07-21T13:40:18Z","updated_at":"2018-07-21T13:42:59Z","html_url":"https://github.com/driusan/dgit/pull/64#discussion_r204211161","pull_request_url":"https://api.github.com/repos/driusan/dgit/pulls/64","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/driusan/dgit/pulls/comments/204211161"},"html":{"href":"https://github.com/driusan/dgit/pull/64#discussion_r204211161"},"pull_request":{"href":"https://api.github.com/repos/driusan/dgit/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/driusan/dgit/pulls/64","id":203008961,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMDA4OTYx","html_url":"https://github.com/driusan/dgit/pull/64","diff_url":"https://github.com/driusan/dgit/pull/64.diff","patch_url":"https://github.com/driusan/dgit/pull/64.patch","issue_url":"https://api.github.com/repos/driusan/dgit/issues/64","number":64,"state":"open","locked":false,"title":"Hook replace option in update-index command","user":{"login":"sirnewton01","id":3670311,"node_id":"MDQ6VXNlcjM2NzAzMTE=","avatar_url":"https://avatars0.githubusercontent.com/u/3670311?v=4","gravatar_id":"","url":"https://api.github.com/users/sirnewton01","html_url":"https://github.com/sirnewton01","followers_url":"https://api.github.com/users/sirnewton01/followers","following_url":"https://api.github.com/users/sirnewton01/following{/other_user}","gists_url":"https://api.github.com/users/sirnewton01/gists{/gist_id}","starred_url":"https://api.github.com/users/sirnewton01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirnewton01/subscriptions","organizations_url":"https://api.github.com/users/sirnewton01/orgs","repos_url":"https://api.github.com/users/sirnewton01/repos","events_url":"https://api.github.com/users/sirnewton01/events{/privacy}","received_events_url":"https://api.github.com/users/sirnewton01/received_events","type":"User","site_admin":false},"body":"This PR hooks in replace functionality when specified that will search the index for existing entries based on sha1 hash and sub-paths and remove them.","created_at":"2018-07-21T13:01:03Z","updated_at":"2018-07-21T13:42:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86bb39f1601ce7314535185313164eb97c84811e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/driusan/dgit/pulls/64/commits","review_comments_url":"https://api.github.com/repos/driusan/dgit/pulls/64/comments","review_comment_url":"https://api.github.com/repos/driusan/dgit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/driusan/dgit/issues/64/comments","statuses_url":"https://api.github.com/repos/driusan/dgit/statuses/33bd90a66fa754055d1099365595510039a7c14e","head":{"label":"sirnewton01:replace_option","ref":"replace_option","sha":"33bd90a66fa754055d1099365595510039a7c14e","user":{"login":"sirnewton01","id":3670311,"node_id":"MDQ6VXNlcjM2NzAzMTE=","avatar_url":"https://avatars0.githubusercontent.com/u/3670311?v=4","gravatar_id":"","url":"https://api.github.com/users/sirnewton01","html_url":"https://github.com/sirnewton01","followers_url":"https://api.github.com/users/sirnewton01/followers","following_url":"https://api.github.com/users/sirnewton01/following{/other_user}","gists_url":"https://api.github.com/users/sirnewton01/gists{/gist_id}","starred_url":"https://api.github.com/users/sirnewton01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirnewton01/subscriptions","organizations_url":"https://api.github.com/users/sirnewton01/orgs","repos_url":"https://api.github.com/users/sirnewton01/repos","events_url":"https://api.github.com/users/sirnewton01/events{/privacy}","received_events_url":"https://api.github.com/users/sirnewton01/received_events","type":"User","site_admin":false},"repo":{"id":75889099,"node_id":"MDEwOlJlcG9zaXRvcnk3NTg4OTA5OQ==","name":"dgit","full_name":"sirnewton01/dgit","owner":{"login":"sirnewton01","id":3670311,"node_id":"MDQ6VXNlcjM2NzAzMTE=","avatar_url":"https://avatars0.githubusercontent.com/u/3670311?v=4","gravatar_id":"","url":"https://api.github.com/users/sirnewton01","html_url":"https://github.com/sirnewton01","followers_url":"https://api.github.com/users/sirnewton01/followers","following_url":"https://api.github.com/users/sirnewton01/following{/other_user}","gists_url":"https://api.github.com/users/sirnewton01/gists{/gist_id}","starred_url":"https://api.github.com/users/sirnewton01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirnewton01/subscriptions","organizations_url":"https://api.github.com/users/sirnewton01/orgs","repos_url":"https://api.github.com/users/sirnewton01/repos","events_url":"https://api.github.com/users/sirnewton01/events{/privacy}","received_events_url":"https://api.github.com/users/sirnewton01/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sirnewton01/dgit","description":"A Pure Go Git Implementation","fork":true,"url":"https://api.github.com/repos/sirnewton01/dgit","forks_url":"https://api.github.com/repos/sirnewton01/dgit/forks","keys_url":"https://api.github.com/repos/sirnewton01/dgit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sirnewton01/dgit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sirnewton01/dgit/teams","hooks_url":"https://api.github.com/repos/sirnewton01/dgit/hooks","issue_events_url":"https://api.github.com/repos/sirnewton01/dgit/issues/events{/number}","events_url":"https://api.github.com/repos/sirnewton01/dgit/events","assignees_url":"https://api.github.com/repos/sirnewton01/dgit/assignees{/user}","branches_url":"https://api.github.com/repos/sirnewton01/dgit/branches{/branch}","tags_url":"https://api.github.com/repos/sirnewton01/dgit/tags","blobs_url":"https://api.github.com/repos/sirnewton01/dgit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sirnewton01/dgit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sirnewton01/dgit/git/refs{/sha}","trees_url":"https://api.github.com/repos/sirnewton01/dgit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sirnewton01/dgit/statuses/{sha}","languages_url":"https://api.github.com/repos/sirnewton01/dgit/languages","stargazers_url":"https://api.github.com/repos/sirnewton01/dgit/stargazers","contributors_url":"https://api.github.com/repos/sirnewton01/dgit/contributors","subscribers_url":"https://api.github.com/repos/sirnewton01/dgit/subscribers","subscription_url":"https://api.github.com/repos/sirnewton01/dgit/subscription","commits_url":"https://api.github.com/repos/sirnewton01/dgit/commits{/sha}","git_commits_url":"https://api.github.com/repos/sirnewton01/dgit/git/commits{/sha}","comments_url":"https://api.github.com/repos/sirnewton01/dgit/comments{/number}","issue_comment_url":"https://api.github.com/repos/sirnewton01/dgit/issues/comments{/number}","contents_url":"https://api.github.com/repos/sirnewton01/dgit/contents/{+path}","compare_url":"https://api.github.com/repos/sirnewton01/dgit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sirnewton01/dgit/merges","archive_url":"https://api.github.com/repos/sirnewton01/dgit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sirnewton01/dgit/downloads","issues_url":"https://api.github.com/repos/sirnewton01/dgit/issues{/number}","pulls_url":"https://api.github.com/repos/sirnewton01/dgit/pulls{/number}","milestones_url":"https://api.github.com/repos/sirnewton01/dgit/milestones{/number}","notifications_url":"https://api.github.com/repos/sirnewton01/dgit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sirnewton01/dgit/labels{/name}","releases_url":"https://api.github.com/repos/sirnewton01/dgit/releases{/id}","deployments_url":"https://api.github.com/repos/sirnewton01/dgit/deployments","created_at":"2016-12-08T00:57:36Z","updated_at":"2018-07-20T15:42:51Z","pushed_at":"2018-07-21T12:59:31Z","git_url":"git://github.com/sirnewton01/dgit.git","ssh_url":"git@github.com:sirnewton01/dgit.git","clone_url":"https://github.com/sirnewton01/dgit.git","svn_url":"https://github.com/sirnewton01/dgit","homepage":null,"size":3219,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"driusan:master","ref":"master","sha":"324ad8d486b477eb7ac0f9a90dad8c1db41dd93c","user":{"login":"driusan","id":498329,"node_id":"MDQ6VXNlcjQ5ODMyOQ==","avatar_url":"https://avatars0.githubusercontent.com/u/498329?v=4","gravatar_id":"","url":"https://api.github.com/users/driusan","html_url":"https://github.com/driusan","followers_url":"https://api.github.com/users/driusan/followers","following_url":"https://api.github.com/users/driusan/following{/other_user}","gists_url":"https://api.github.com/users/driusan/gists{/gist_id}","starred_url":"https://api.github.com/users/driusan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driusan/subscriptions","organizations_url":"https://api.github.com/users/driusan/orgs","repos_url":"https://api.github.com/users/driusan/repos","events_url":"https://api.github.com/users/driusan/events{/privacy}","received_events_url":"https://api.github.com/users/driusan/received_events","type":"User","site_admin":false},"repo":{"id":51049175,"node_id":"MDEwOlJlcG9zaXRvcnk1MTA0OTE3NQ==","name":"dgit","full_name":"driusan/dgit","owner":{"login":"driusan","id":498329,"node_id":"MDQ6VXNlcjQ5ODMyOQ==","avatar_url":"https://avatars0.githubusercontent.com/u/498329?v=4","gravatar_id":"","url":"https://api.github.com/users/driusan","html_url":"https://github.com/driusan","followers_url":"https://api.github.com/users/driusan/followers","following_url":"https://api.github.com/users/driusan/following{/other_user}","gists_url":"https://api.github.com/users/driusan/gists{/gist_id}","starred_url":"https://api.github.com/users/driusan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driusan/subscriptions","organizations_url":"https://api.github.com/users/driusan/orgs","repos_url":"https://api.github.com/users/driusan/repos","events_url":"https://api.github.com/users/driusan/events{/privacy}","received_events_url":"https://api.github.com/users/driusan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/driusan/dgit","description":"A Pure Go Git Implementation","fork":false,"url":"https://api.github.com/repos/driusan/dgit","forks_url":"https://api.github.com/repos/driusan/dgit/forks","keys_url":"https://api.github.com/repos/driusan/dgit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/driusan/dgit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/driusan/dgit/teams","hooks_url":"https://api.github.com/repos/driusan/dgit/hooks","issue_events_url":"https://api.github.com/repos/driusan/dgit/issues/events{/number}","events_url":"https://api.github.com/repos/driusan/dgit/events","assignees_url":"https://api.github.com/repos/driusan/dgit/assignees{/user}","branches_url":"https://api.github.com/repos/driusan/dgit/branches{/branch}","tags_url":"https://api.github.com/repos/driusan/dgit/tags","blobs_url":"https://api.github.com/repos/driusan/dgit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/driusan/dgit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/driusan/dgit/git/refs{/sha}","trees_url":"https://api.github.com/repos/driusan/dgit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/driusan/dgit/statuses/{sha}","languages_url":"https://api.github.com/repos/driusan/dgit/languages","stargazers_url":"https://api.github.com/repos/driusan/dgit/stargazers","contributors_url":"https://api.github.com/repos/driusan/dgit/contributors","subscribers_url":"https://api.github.com/repos/driusan/dgit/subscribers","subscription_url":"https://api.github.com/repos/driusan/dgit/subscription","commits_url":"https://api.github.com/repos/driusan/dgit/commits{/sha}","git_commits_url":"https://api.github.com/repos/driusan/dgit/git/commits{/sha}","comments_url":"https://api.github.com/repos/driusan/dgit/comments{/number}","issue_comment_url":"https://api.github.com/repos/driusan/dgit/issues/comments{/number}","contents_url":"https://api.github.com/repos/driusan/dgit/contents/{+path}","compare_url":"https://api.github.com/repos/driusan/dgit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/driusan/dgit/merges","archive_url":"https://api.github.com/repos/driusan/dgit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/driusan/dgit/downloads","issues_url":"https://api.github.com/repos/driusan/dgit/issues{/number}","pulls_url":"https://api.github.com/repos/driusan/dgit/pulls{/number}","milestones_url":"https://api.github.com/repos/driusan/dgit/milestones{/number}","notifications_url":"https://api.github.com/repos/driusan/dgit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/driusan/dgit/labels{/name}","releases_url":"https://api.github.com/repos/driusan/dgit/releases{/id}","deployments_url":"https://api.github.com/repos/driusan/dgit/deployments","created_at":"2016-02-04T03:21:19Z","updated_at":"2018-07-21T13:21:59Z","pushed_at":"2018-07-21T13:21:56Z","git_url":"git://github.com/driusan/dgit.git","ssh_url":"git@github.com:driusan/dgit.git","clone_url":"https://github.com/driusan/dgit.git","svn_url":"https://github.com/driusan/dgit","homepage":null,"size":3187,"stargazers_count":54,"watchers_count":54,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":17,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/driusan/dgit/pulls/64"},"html":{"href":"https://github.com/driusan/dgit/pull/64"},"issue":{"href":"https://api.github.com/repos/driusan/dgit/issues/64"},"comments":{"href":"https://api.github.com/repos/driusan/dgit/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/driusan/dgit/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/driusan/dgit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/driusan/dgit/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/driusan/dgit/statuses/33bd90a66fa754055d1099365595510039a7c14e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"driusan"}}