{"action":"created","comment":{"url":"https://api.github.com/repos/IRkernel/IRkernel/pulls/comments/63862676","id":63862676,"diff_hunk":"@@ -44,3 +44,20 @@ init_shadowenv <- function() {\n         stop(\"'edit()' not yet supported in the Jupyter R kernel\")\n     })\n }\n+\n+init_cran_repo <- function() {\n+    r <- getOption('repos')\n+    is_configured_by_user <- !identical(r, c(CRAN = '@CRAN@'))\n+    if (!is_configured_by_user) {","path":"R/environment.r","position":8,"original_position":8,"commit_id":"7d0aeea64fe531ecf4864fdc135e9aa8f388c0c4","original_commit_id":"7d0aeea64fe531ecf4864fdc135e9aa8f388c0c4","user":{"login":"flying-sheep","id":291575,"avatar_url":"https://avatars.githubusercontent.com/u/291575?v=3","gravatar_id":"","url":"https://api.github.com/users/flying-sheep","html_url":"https://github.com/flying-sheep","followers_url":"https://api.github.com/users/flying-sheep/followers","following_url":"https://api.github.com/users/flying-sheep/following{/other_user}","gists_url":"https://api.github.com/users/flying-sheep/gists{/gist_id}","starred_url":"https://api.github.com/users/flying-sheep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flying-sheep/subscriptions","organizations_url":"https://api.github.com/users/flying-sheep/orgs","repos_url":"https://api.github.com/users/flying-sheep/repos","events_url":"https://api.github.com/users/flying-sheep/events{/privacy}","received_events_url":"https://api.github.com/users/flying-sheep/received_events","type":"User","site_admin":false},"body":"i think it’s a bit confusing if you invert twice.\r\n\r\nhow about\r\n\r\n```r\r\nis_default <- identical(r, c(CRAN = '@CRAN@'))\r\nif (is_default) { ... }\r\n```\r\n\r\nor\r\n\r\n```r\r\nis_configured_by_user <- !identical(r, c(CRAN = '@CRAN@'))\r\nif (is_configured_by_user) return()\r\n...\r\n```","created_at":"2016-05-19T11:35:06Z","updated_at":"2016-05-19T11:35:06Z","html_url":"https://github.com/IRkernel/IRkernel/pull/339#discussion_r63862676","pull_request_url":"https://api.github.com/repos/IRkernel/IRkernel/pulls/339","_links":{"self":{"href":"https://api.github.com/repos/IRkernel/IRkernel/pulls/comments/63862676"},"html":{"href":"https://github.com/IRkernel/IRkernel/pull/339#discussion_r63862676"},"pull_request":{"href":"https://api.github.com/repos/IRkernel/IRkernel/pulls/339"}}},"pull_request":{"url":"https://api.github.com/repos/IRkernel/IRkernel/pulls/339","id":70675450,"html_url":"https://github.com/IRkernel/IRkernel/pull/339","diff_url":"https://github.com/IRkernel/IRkernel/pull/339.diff","patch_url":"https://github.com/IRkernel/IRkernel/pull/339.patch","issue_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/339","number":339,"state":"open","locked":false,"title":"Set default repo during the kernel session","user":{"login":"janschulz","id":890156,"avatar_url":"https://avatars.githubusercontent.com/u/890156?v=3","gravatar_id":"","url":"https://api.github.com/users/janschulz","html_url":"https://github.com/janschulz","followers_url":"https://api.github.com/users/janschulz/followers","following_url":"https://api.github.com/users/janschulz/following{/other_user}","gists_url":"https://api.github.com/users/janschulz/gists{/gist_id}","starred_url":"https://api.github.com/users/janschulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janschulz/subscriptions","organizations_url":"https://api.github.com/users/janschulz/orgs","repos_url":"https://api.github.com/users/janschulz/repos","events_url":"https://api.github.com/users/janschulz/events{/privacy}","received_events_url":"https://api.github.com/users/janschulz/received_events","type":"User","site_admin":false},"body":"We set repos to the default mirror of CRAN (which has geo-redirect enabled) aswe currently do not have any way to ask the user in case it is unset.\r\n    \r\nThe setting is only set if it is unset (e.g. the user does not set it in .RProfile).\r\n\r\nCloses: https://github.com/IRkernel/IRkernel/issues/306","created_at":"2016-05-19T11:07:46Z","updated_at":"2016-05-19T11:35:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e074a6e829fbbd3f1fbc9305a0d689908fcde75c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/IRkernel/IRkernel/pulls/339/commits","review_comments_url":"https://api.github.com/repos/IRkernel/IRkernel/pulls/339/comments","review_comment_url":"https://api.github.com/repos/IRkernel/IRkernel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/339/comments","statuses_url":"https://api.github.com/repos/IRkernel/IRkernel/statuses/7d0aeea64fe531ecf4864fdc135e9aa8f388c0c4","head":{"label":"janschulz:repos","ref":"repos","sha":"7d0aeea64fe531ecf4864fdc135e9aa8f388c0c4","user":{"login":"janschulz","id":890156,"avatar_url":"https://avatars.githubusercontent.com/u/890156?v=3","gravatar_id":"","url":"https://api.github.com/users/janschulz","html_url":"https://github.com/janschulz","followers_url":"https://api.github.com/users/janschulz/followers","following_url":"https://api.github.com/users/janschulz/following{/other_user}","gists_url":"https://api.github.com/users/janschulz/gists{/gist_id}","starred_url":"https://api.github.com/users/janschulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janschulz/subscriptions","organizations_url":"https://api.github.com/users/janschulz/orgs","repos_url":"https://api.github.com/users/janschulz/repos","events_url":"https://api.github.com/users/janschulz/events{/privacy}","received_events_url":"https://api.github.com/users/janschulz/received_events","type":"User","site_admin":false},"repo":{"id":34160743,"name":"IRkernel","full_name":"janschulz/IRkernel","owner":{"login":"janschulz","id":890156,"avatar_url":"https://avatars.githubusercontent.com/u/890156?v=3","gravatar_id":"","url":"https://api.github.com/users/janschulz","html_url":"https://github.com/janschulz","followers_url":"https://api.github.com/users/janschulz/followers","following_url":"https://api.github.com/users/janschulz/following{/other_user}","gists_url":"https://api.github.com/users/janschulz/gists{/gist_id}","starred_url":"https://api.github.com/users/janschulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janschulz/subscriptions","organizations_url":"https://api.github.com/users/janschulz/orgs","repos_url":"https://api.github.com/users/janschulz/repos","events_url":"https://api.github.com/users/janschulz/events{/privacy}","received_events_url":"https://api.github.com/users/janschulz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/janschulz/IRkernel","description":"R kernel for IPython","fork":true,"url":"https://api.github.com/repos/janschulz/IRkernel","forks_url":"https://api.github.com/repos/janschulz/IRkernel/forks","keys_url":"https://api.github.com/repos/janschulz/IRkernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janschulz/IRkernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janschulz/IRkernel/teams","hooks_url":"https://api.github.com/repos/janschulz/IRkernel/hooks","issue_events_url":"https://api.github.com/repos/janschulz/IRkernel/issues/events{/number}","events_url":"https://api.github.com/repos/janschulz/IRkernel/events","assignees_url":"https://api.github.com/repos/janschulz/IRkernel/assignees{/user}","branches_url":"https://api.github.com/repos/janschulz/IRkernel/branches{/branch}","tags_url":"https://api.github.com/repos/janschulz/IRkernel/tags","blobs_url":"https://api.github.com/repos/janschulz/IRkernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janschulz/IRkernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janschulz/IRkernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/janschulz/IRkernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janschulz/IRkernel/statuses/{sha}","languages_url":"https://api.github.com/repos/janschulz/IRkernel/languages","stargazers_url":"https://api.github.com/repos/janschulz/IRkernel/stargazers","contributors_url":"https://api.github.com/repos/janschulz/IRkernel/contributors","subscribers_url":"https://api.github.com/repos/janschulz/IRkernel/subscribers","subscription_url":"https://api.github.com/repos/janschulz/IRkernel/subscription","commits_url":"https://api.github.com/repos/janschulz/IRkernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/janschulz/IRkernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/janschulz/IRkernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/janschulz/IRkernel/issues/comments{/number}","contents_url":"https://api.github.com/repos/janschulz/IRkernel/contents/{+path}","compare_url":"https://api.github.com/repos/janschulz/IRkernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janschulz/IRkernel/merges","archive_url":"https://api.github.com/repos/janschulz/IRkernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janschulz/IRkernel/downloads","issues_url":"https://api.github.com/repos/janschulz/IRkernel/issues{/number}","pulls_url":"https://api.github.com/repos/janschulz/IRkernel/pulls{/number}","milestones_url":"https://api.github.com/repos/janschulz/IRkernel/milestones{/number}","notifications_url":"https://api.github.com/repos/janschulz/IRkernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janschulz/IRkernel/labels{/name}","releases_url":"https://api.github.com/repos/janschulz/IRkernel/releases{/id}","deployments_url":"https://api.github.com/repos/janschulz/IRkernel/deployments","created_at":"2015-04-18T09:51:20Z","updated_at":"2015-04-18T09:51:20Z","pushed_at":"2016-05-19T11:33:39Z","git_url":"git://github.com/janschulz/IRkernel.git","ssh_url":"git@github.com:janschulz/IRkernel.git","clone_url":"https://github.com/janschulz/IRkernel.git","svn_url":"https://github.com/janschulz/IRkernel","homepage":null,"size":2861,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"IRkernel:master","ref":"master","sha":"cb7fd617fda7959f0855623a2529d36bd7c93d45","user":{"login":"IRkernel","id":11616939,"avatar_url":"https://avatars.githubusercontent.com/u/11616939?v=3","gravatar_id":"","url":"https://api.github.com/users/IRkernel","html_url":"https://github.com/IRkernel","followers_url":"https://api.github.com/users/IRkernel/followers","following_url":"https://api.github.com/users/IRkernel/following{/other_user}","gists_url":"https://api.github.com/users/IRkernel/gists{/gist_id}","starred_url":"https://api.github.com/users/IRkernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IRkernel/subscriptions","organizations_url":"https://api.github.com/users/IRkernel/orgs","repos_url":"https://api.github.com/users/IRkernel/repos","events_url":"https://api.github.com/users/IRkernel/events{/privacy}","received_events_url":"https://api.github.com/users/IRkernel/received_events","type":"Organization","site_admin":false},"repo":{"id":17196838,"name":"IRkernel","full_name":"IRkernel/IRkernel","owner":{"login":"IRkernel","id":11616939,"avatar_url":"https://avatars.githubusercontent.com/u/11616939?v=3","gravatar_id":"","url":"https://api.github.com/users/IRkernel","html_url":"https://github.com/IRkernel","followers_url":"https://api.github.com/users/IRkernel/followers","following_url":"https://api.github.com/users/IRkernel/following{/other_user}","gists_url":"https://api.github.com/users/IRkernel/gists{/gist_id}","starred_url":"https://api.github.com/users/IRkernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IRkernel/subscriptions","organizations_url":"https://api.github.com/users/IRkernel/orgs","repos_url":"https://api.github.com/users/IRkernel/repos","events_url":"https://api.github.com/users/IRkernel/events{/privacy}","received_events_url":"https://api.github.com/users/IRkernel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IRkernel/IRkernel","description":"R kernel for Jupyter","fork":false,"url":"https://api.github.com/repos/IRkernel/IRkernel","forks_url":"https://api.github.com/repos/IRkernel/IRkernel/forks","keys_url":"https://api.github.com/repos/IRkernel/IRkernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IRkernel/IRkernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IRkernel/IRkernel/teams","hooks_url":"https://api.github.com/repos/IRkernel/IRkernel/hooks","issue_events_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/events{/number}","events_url":"https://api.github.com/repos/IRkernel/IRkernel/events","assignees_url":"https://api.github.com/repos/IRkernel/IRkernel/assignees{/user}","branches_url":"https://api.github.com/repos/IRkernel/IRkernel/branches{/branch}","tags_url":"https://api.github.com/repos/IRkernel/IRkernel/tags","blobs_url":"https://api.github.com/repos/IRkernel/IRkernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IRkernel/IRkernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IRkernel/IRkernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/IRkernel/IRkernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IRkernel/IRkernel/statuses/{sha}","languages_url":"https://api.github.com/repos/IRkernel/IRkernel/languages","stargazers_url":"https://api.github.com/repos/IRkernel/IRkernel/stargazers","contributors_url":"https://api.github.com/repos/IRkernel/IRkernel/contributors","subscribers_url":"https://api.github.com/repos/IRkernel/IRkernel/subscribers","subscription_url":"https://api.github.com/repos/IRkernel/IRkernel/subscription","commits_url":"https://api.github.com/repos/IRkernel/IRkernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/IRkernel/IRkernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/IRkernel/IRkernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/comments{/number}","contents_url":"https://api.github.com/repos/IRkernel/IRkernel/contents/{+path}","compare_url":"https://api.github.com/repos/IRkernel/IRkernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IRkernel/IRkernel/merges","archive_url":"https://api.github.com/repos/IRkernel/IRkernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IRkernel/IRkernel/downloads","issues_url":"https://api.github.com/repos/IRkernel/IRkernel/issues{/number}","pulls_url":"https://api.github.com/repos/IRkernel/IRkernel/pulls{/number}","milestones_url":"https://api.github.com/repos/IRkernel/IRkernel/milestones{/number}","notifications_url":"https://api.github.com/repos/IRkernel/IRkernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IRkernel/IRkernel/labels{/name}","releases_url":"https://api.github.com/repos/IRkernel/IRkernel/releases{/id}","deployments_url":"https://api.github.com/repos/IRkernel/IRkernel/deployments","created_at":"2014-02-26T02:57:07Z","updated_at":"2016-05-19T01:43:10Z","pushed_at":"2016-05-19T11:33:40Z","git_url":"git://github.com/IRkernel/IRkernel.git","ssh_url":"git@github.com:IRkernel/IRkernel.git","clone_url":"https://github.com/IRkernel/IRkernel.git","svn_url":"https://github.com/IRkernel/IRkernel","homepage":"https://irkernel.github.io/","size":483,"stargazers_count":447,"watchers_count":447,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":46,"forks":86,"open_issues":46,"watchers":447,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IRkernel/IRkernel/pulls/339"},"html":{"href":"https://github.com/IRkernel/IRkernel/pull/339"},"issue":{"href":"https://api.github.com/repos/IRkernel/IRkernel/issues/339"},"comments":{"href":"https://api.github.com/repos/IRkernel/IRkernel/issues/339/comments"},"review_comments":{"href":"https://api.github.com/repos/IRkernel/IRkernel/pulls/339/comments"},"review_comment":{"href":"https://api.github.com/repos/IRkernel/IRkernel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IRkernel/IRkernel/pulls/339/commits"},"statuses":{"href":"https://api.github.com/repos/IRkernel/IRkernel/statuses/7d0aeea64fe531ecf4864fdc135e9aa8f388c0c4"}}}}