{"action":"reopened","number":146,"pull_request":{"url":"https://api.github.com/repos/osfclient/osfclient/pulls/146","id":198683041,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4NjgzMDQx","html_url":"https://github.com/osfclient/osfclient/pull/146","diff_url":"https://github.com/osfclient/osfclient/pull/146.diff","patch_url":"https://github.com/osfclient/osfclient/pull/146.patch","issue_url":"https://api.github.com/repos/osfclient/osfclient/issues/146","number":146,"state":"open","locked":false,"title":"[MRG] hash checking --update option for upload, fetch, and clone","user":{"login":"benlindsay","id":9361152,"node_id":"MDQ6VXNlcjkzNjExNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/9361152?v=4","gravatar_id":"","url":"https://api.github.com/users/benlindsay","html_url":"https://github.com/benlindsay","followers_url":"https://api.github.com/users/benlindsay/followers","following_url":"https://api.github.com/users/benlindsay/following{/other_user}","gists_url":"https://api.github.com/users/benlindsay/gists{/gist_id}","starred_url":"https://api.github.com/users/benlindsay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlindsay/subscriptions","organizations_url":"https://api.github.com/users/benlindsay/orgs","repos_url":"https://api.github.com/users/benlindsay/repos","events_url":"https://api.github.com/users/benlindsay/events{/privacy}","received_events_url":"https://api.github.com/users/benlindsay/received_events","type":"User","site_admin":false},"body":"I started working on adding a hash checking option, and this seems to work so far. I haven't added tests or anything yet, and this relies on the change in #142 which is unmerged, and which I copied into these changes. I just wanted to get input on this before putting too much time into it.\r\n\r\nMy thought, based on @betatim's suggestion in #138 of adding an `--update` flag, is that, assuming a file already exists on OSF, if `--force` is specified, we don't care whether `--update` is specified, and upload without comparing the hashes. If `--force` is not specified, then we check the hash if `--update` is specified, and fail the upload otherwise. Does that seem like a reasonable way to do it?\r\n\r\nAlso note that I copied the local checksum function from https://gist.github.com/rji/b38c7238128edf53a181#file-sha256-py. It seems to work but I don't know if there's a better way to do it.\r\n\r\nAlso, once we settle on the right way to do this, I figure we could do the same thing for `fetch` as well.\r\n\r\n# EDIT\r\n\r\nForgot to add Fixes #138 ","created_at":"2018-07-02T13:39:47Z","updated_at":"2018-07-27T21:19:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"829d154e11166130269baa1587a7f00f94d3aa50","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/osfclient/osfclient/pulls/146/commits","review_comments_url":"https://api.github.com/repos/osfclient/osfclient/pulls/146/comments","review_comment_url":"https://api.github.com/repos/osfclient/osfclient/pulls/comments{/number}","comments_url":"https://api.github.com/repos/osfclient/osfclient/issues/146/comments","statuses_url":"https://api.github.com/repos/osfclient/osfclient/statuses/6c5f08096dc4e0e1ce88a9035dccaeaa83396160","head":{"label":"benlindsay:checkhash","ref":"checkhash","sha":"6c5f08096dc4e0e1ce88a9035dccaeaa83396160","user":{"login":"benlindsay","id":9361152,"node_id":"MDQ6VXNlcjkzNjExNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/9361152?v=4","gravatar_id":"","url":"https://api.github.com/users/benlindsay","html_url":"https://github.com/benlindsay","followers_url":"https://api.github.com/users/benlindsay/followers","following_url":"https://api.github.com/users/benlindsay/following{/other_user}","gists_url":"https://api.github.com/users/benlindsay/gists{/gist_id}","starred_url":"https://api.github.com/users/benlindsay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlindsay/subscriptions","organizations_url":"https://api.github.com/users/benlindsay/orgs","repos_url":"https://api.github.com/users/benlindsay/repos","events_url":"https://api.github.com/users/benlindsay/events{/privacy}","received_events_url":"https://api.github.com/users/benlindsay/received_events","type":"User","site_admin":false},"repo":{"id":139356496,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkzNTY0OTY=","name":"osfclient","full_name":"benlindsay/osfclient","owner":{"login":"benlindsay","id":9361152,"node_id":"MDQ6VXNlcjkzNjExNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/9361152?v=4","gravatar_id":"","url":"https://api.github.com/users/benlindsay","html_url":"https://github.com/benlindsay","followers_url":"https://api.github.com/users/benlindsay/followers","following_url":"https://api.github.com/users/benlindsay/following{/other_user}","gists_url":"https://api.github.com/users/benlindsay/gists{/gist_id}","starred_url":"https://api.github.com/users/benlindsay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlindsay/subscriptions","organizations_url":"https://api.github.com/users/benlindsay/orgs","repos_url":"https://api.github.com/users/benlindsay/repos","events_url":"https://api.github.com/users/benlindsay/events{/privacy}","received_events_url":"https://api.github.com/users/benlindsay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benlindsay/osfclient","description":"A python library and command-line client for file storage on OSF","fork":true,"url":"https://api.github.com/repos/benlindsay/osfclient","forks_url":"https://api.github.com/repos/benlindsay/osfclient/forks","keys_url":"https://api.github.com/repos/benlindsay/osfclient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benlindsay/osfclient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benlindsay/osfclient/teams","hooks_url":"https://api.github.com/repos/benlindsay/osfclient/hooks","issue_events_url":"https://api.github.com/repos/benlindsay/osfclient/issues/events{/number}","events_url":"https://api.github.com/repos/benlindsay/osfclient/events","assignees_url":"https://api.github.com/repos/benlindsay/osfclient/assignees{/user}","branches_url":"https://api.github.com/repos/benlindsay/osfclient/branches{/branch}","tags_url":"https://api.github.com/repos/benlindsay/osfclient/tags","blobs_url":"https://api.github.com/repos/benlindsay/osfclient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benlindsay/osfclient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benlindsay/osfclient/git/refs{/sha}","trees_url":"https://api.github.com/repos/benlindsay/osfclient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benlindsay/osfclient/statuses/{sha}","languages_url":"https://api.github.com/repos/benlindsay/osfclient/languages","stargazers_url":"https://api.github.com/repos/benlindsay/osfclient/stargazers","contributors_url":"https://api.github.com/repos/benlindsay/osfclient/contributors","subscribers_url":"https://api.github.com/repos/benlindsay/osfclient/subscribers","subscription_url":"https://api.github.com/repos/benlindsay/osfclient/subscription","commits_url":"https://api.github.com/repos/benlindsay/osfclient/commits{/sha}","git_commits_url":"https://api.github.com/repos/benlindsay/osfclient/git/commits{/sha}","comments_url":"https://api.github.com/repos/benlindsay/osfclient/comments{/number}","issue_comment_url":"https://api.github.com/repos/benlindsay/osfclient/issues/comments{/number}","contents_url":"https://api.github.com/repos/benlindsay/osfclient/contents/{+path}","compare_url":"https://api.github.com/repos/benlindsay/osfclient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benlindsay/osfclient/merges","archive_url":"https://api.github.com/repos/benlindsay/osfclient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benlindsay/osfclient/downloads","issues_url":"https://api.github.com/repos/benlindsay/osfclient/issues{/number}","pulls_url":"https://api.github.com/repos/benlindsay/osfclient/pulls{/number}","milestones_url":"https://api.github.com/repos/benlindsay/osfclient/milestones{/number}","notifications_url":"https://api.github.com/repos/benlindsay/osfclient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benlindsay/osfclient/labels{/name}","releases_url":"https://api.github.com/repos/benlindsay/osfclient/releases{/id}","deployments_url":"https://api.github.com/repos/benlindsay/osfclient/deployments","created_at":"2018-07-01T19:35:24Z","updated_at":"2018-07-24T02:52:59Z","pushed_at":"2018-07-27T13:06:29Z","git_url":"git://github.com/benlindsay/osfclient.git","ssh_url":"git@github.com:benlindsay/osfclient.git","clone_url":"https://github.com/benlindsay/osfclient.git","svn_url":"https://github.com/benlindsay/osfclient","homepage":"http://osfclient.readthedocs.io/en/stable/","size":392,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"osfclient:master","ref":"master","sha":"cf54352debc4978bf4daf267fcf18c5365005f2b","user":{"login":"osfclient","id":32774405,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNzc0NDA1","avatar_url":"https://avatars0.githubusercontent.com/u/32774405?v=4","gravatar_id":"","url":"https://api.github.com/users/osfclient","html_url":"https://github.com/osfclient","followers_url":"https://api.github.com/users/osfclient/followers","following_url":"https://api.github.com/users/osfclient/following{/other_user}","gists_url":"https://api.github.com/users/osfclient/gists{/gist_id}","starred_url":"https://api.github.com/users/osfclient/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osfclient/subscriptions","organizations_url":"https://api.github.com/users/osfclient/orgs","repos_url":"https://api.github.com/users/osfclient/repos","events_url":"https://api.github.com/users/osfclient/events{/privacy}","received_events_url":"https://api.github.com/users/osfclient/received_events","type":"Organization","site_admin":false},"repo":{"id":84216678,"node_id":"MDEwOlJlcG9zaXRvcnk4NDIxNjY3OA==","name":"osfclient","full_name":"osfclient/osfclient","owner":{"login":"osfclient","id":32774405,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNzc0NDA1","avatar_url":"https://avatars0.githubusercontent.com/u/32774405?v=4","gravatar_id":"","url":"https://api.github.com/users/osfclient","html_url":"https://github.com/osfclient","followers_url":"https://api.github.com/users/osfclient/followers","following_url":"https://api.github.com/users/osfclient/following{/other_user}","gists_url":"https://api.github.com/users/osfclient/gists{/gist_id}","starred_url":"https://api.github.com/users/osfclient/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osfclient/subscriptions","organizations_url":"https://api.github.com/users/osfclient/orgs","repos_url":"https://api.github.com/users/osfclient/repos","events_url":"https://api.github.com/users/osfclient/events{/privacy}","received_events_url":"https://api.github.com/users/osfclient/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/osfclient/osfclient","description":"A python library and command-line client for file storage on OSF","fork":false,"url":"https://api.github.com/repos/osfclient/osfclient","forks_url":"https://api.github.com/repos/osfclient/osfclient/forks","keys_url":"https://api.github.com/repos/osfclient/osfclient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osfclient/osfclient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osfclient/osfclient/teams","hooks_url":"https://api.github.com/repos/osfclient/osfclient/hooks","issue_events_url":"https://api.github.com/repos/osfclient/osfclient/issues/events{/number}","events_url":"https://api.github.com/repos/osfclient/osfclient/events","assignees_url":"https://api.github.com/repos/osfclient/osfclient/assignees{/user}","branches_url":"https://api.github.com/repos/osfclient/osfclient/branches{/branch}","tags_url":"https://api.github.com/repos/osfclient/osfclient/tags","blobs_url":"https://api.github.com/repos/osfclient/osfclient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osfclient/osfclient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osfclient/osfclient/git/refs{/sha}","trees_url":"https://api.github.com/repos/osfclient/osfclient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osfclient/osfclient/statuses/{sha}","languages_url":"https://api.github.com/repos/osfclient/osfclient/languages","stargazers_url":"https://api.github.com/repos/osfclient/osfclient/stargazers","contributors_url":"https://api.github.com/repos/osfclient/osfclient/contributors","subscribers_url":"https://api.github.com/repos/osfclient/osfclient/subscribers","subscription_url":"https://api.github.com/repos/osfclient/osfclient/subscription","commits_url":"https://api.github.com/repos/osfclient/osfclient/commits{/sha}","git_commits_url":"https://api.github.com/repos/osfclient/osfclient/git/commits{/sha}","comments_url":"https://api.github.com/repos/osfclient/osfclient/comments{/number}","issue_comment_url":"https://api.github.com/repos/osfclient/osfclient/issues/comments{/number}","contents_url":"https://api.github.com/repos/osfclient/osfclient/contents/{+path}","compare_url":"https://api.github.com/repos/osfclient/osfclient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osfclient/osfclient/merges","archive_url":"https://api.github.com/repos/osfclient/osfclient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osfclient/osfclient/downloads","issues_url":"https://api.github.com/repos/osfclient/osfclient/issues{/number}","pulls_url":"https://api.github.com/repos/osfclient/osfclient/pulls{/number}","milestones_url":"https://api.github.com/repos/osfclient/osfclient/milestones{/number}","notifications_url":"https://api.github.com/repos/osfclient/osfclient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osfclient/osfclient/labels{/name}","releases_url":"https://api.github.com/repos/osfclient/osfclient/releases{/id}","deployments_url":"https://api.github.com/repos/osfclient/osfclient/deployments","created_at":"2017-03-07T15:42:39Z","updated_at":"2018-07-27T20:53:03Z","pushed_at":"2018-07-27T21:17:21Z","git_url":"git://github.com/osfclient/osfclient.git","ssh_url":"git@github.com:osfclient/osfclient.git","clone_url":"https://github.com/osfclient/osfclient.git","svn_url":"https://github.com/osfclient/osfclient","homepage":"http://osfclient.readthedocs.io/en/stable/","size":355,"stargazers_count":43,"watchers_count":43,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":26,"open_issues":56,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/osfclient/osfclient/pulls/146"},"html":{"href":"https://github.com/osfclient/osfclient/pull/146"},"issue":{"href":"https://api.github.com/repos/osfclient/osfclient/issues/146"},"comments":{"href":"https://api.github.com/repos/osfclient/osfclient/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/osfclient/osfclient/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/osfclient/osfclient/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/osfclient/osfclient/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/osfclient/osfclient/statuses/6c5f08096dc4e0e1ce88a9035dccaeaa83396160"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":16,"review_comments":6,"maintainer_can_modify":true,"commits":11,"additions":453,"deletions":23,"changed_files":9}}
{"actor":{"display_login":"betatim"}}