Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better create_from_github() #253

Merged
merged 8 commits into from Feb 15, 2018

Conversation

Projects
None yet
2 participants
@jennybc
Copy link
Member

jennybc commented Feb 14, 2018

Fixes #215 create_from_github() should share many arguments with use_github()
Fixes #214 GitHub connectivity

I think this completes the obvious set of GitHub operations a typical user would expect. At least in terms of project initiation.

  • Clones from the ssh or https url (vs the git url, previously), which stores a usable URL for the origin remote, i.e. pull/push should now work going forward
  • More explicit logic re: forking and PAT availability
  • Adds upstream remote in case of fork, also honouring ssh vs https protocol
  • Allows token, credentials, host to be specified

@jennybc jennybc changed the title Better create from GitHub Better create_from_github() Feb 14, 2018

Major upgrade of create_from_github()
Fixes @215

  * Clones from the ssh or https url (vs the git url), which stores the correct URL for origin remote
  * Better logic re: forking
  * Adds upstream remote in case of fork
  * Allows token, credentials, host to be specified

@jennybc jennybc force-pushed the better-create-from-github branch from 3937ef8 to ecb8607 Feb 15, 2018

jennybc added some commits Feb 15, 2018

Fail early if repo_path exists and is not empty
In particular, do this before creating a fork

@jennybc jennybc requested a review from hadley Feb 15, 2018

@hadley hadley requested a review from jimhester Feb 15, 2018

@hadley

hadley approved these changes Feb 15, 2018

#' repositories.
#' Creates a new local Git repository from a repository on GitHub. It is highly
#' recommended that you pre-configure or pass a GitHub personal access token
#' (PAT) as described in [gh::gh_whoami()]. In particular, a PAT is required in

This comment has been minimized.

@hadley

hadley Feb 15, 2018

Member

Are you planning to add any PAT help for this release?

This comment has been minimized.

@jennybc

jennybc Feb 15, 2018

Author Member

Yes, I plan to tackle that next.

R/create.R Outdated
owner <- repo_info$owner$login

if (is.na(fork)) {
if (pat_available) {

This comment has been minimized.

@hadley

hadley Feb 15, 2018

Member
fork <- pat_available && !isTRUE(perms$push)

?

R/github.R Outdated
#' fields with appropriate links (unless they already exist).
#' `use_github()` requires that your package have a git repository, which you
#' can create with [use_git()], if needed. `use_github()` then sets up
#' appropriate git remotes and syncs. `use_github_links()` populates the `URL`

This comment has been minimized.

@hadley

hadley Feb 15, 2018

Member

"remotes and syncs" ?

R/github.R Outdated
#' public and private keys are in the default locations, `~/.ssh/id_rsa.pub`
#' and `~/.ssh/id_rsa`, respectively, and that `ssh-agent` is configured to
#' manage any associated passphrase. Alternatively, specify a
#' [git2r::cred_ssh_key()] object via the `credentials` parameter.

This comment has been minimized.

@hadley

hadley Feb 15, 2018

Member

Cross-link to relevant happy git with R section?

@jennybc

This comment has been minimized.

Copy link
Member Author

jennybc commented Feb 15, 2018

I acted on all the small comments.

@jennybc jennybc merged commit 3e07f67 into master Feb 15, 2018

0 of 4 checks passed

continuous-integration/appveyor/branch Waiting for AppVeyor build to complete
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@jennybc jennybc deleted the better-create-from-github branch Feb 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.