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
Merged

Better create_from_github() #253

merged 8 commits into from Feb 15, 2018

Conversation

@jennybc
Copy link
Member

@jennybc 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
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 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
Copy link
Member

@hadley hadley Feb 15, 2018

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

Copy link
Member Author

@jennybc jennybc Feb 15, 2018

Yes, I plan to tackle that next.

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

if (is.na(fork)) {
if (pat_available) {
Copy link
Member

@hadley hadley Feb 15, 2018

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`
Copy link
Member

@hadley hadley Feb 15, 2018

"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.
Copy link
Member

@hadley hadley Feb 15, 2018

Cross-link to relevant happy git with R section?

@jennybc
Copy link
Member Author

@jennybc 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
@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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants