You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Learn host from Git remotes (when possible), get PAT from host (#1229)
* TODO comment re: gert verbosity
* Bump min version of gh, list in Remotes
* Depend on (dev) gitcreds
* Getting things rolling
* Don't accomodate weird configs
* Switch over release-related functions
* Switch label-editing functions over
* Switch over use_pkgdown_travis() and its helper
* Switch over use_tidy_thanks() and do some general fixup
* Switch over the issue functions
* Switch over use_github() and use_github_links()
* Crude switch over of create_from_github()
This version always errors in the "no token" case
* Bring back create_from_github()'s ability to clone, if no token
Lots of other refactoring. Main point of that is to GitHub checks and prep before starting any work on the local filesystem. Less likely to leave partial setup in the event of GitHub failure.
* Remove have_github_token(), check_github_token()
* Get rid of the repo_spec_orig() workaround
* Update WORDLIST
* Fixes revealed by manual tests with GHE
* Fix this signature
We will probably use an external mocking package soon anywa
* Stop printing this message
* stringAsFactors = HELLNO
* Deprecate github_token()
* Work on updating setup advice
This needs a lot of simplification but this is better than doing nothing, for now.
* Switch over the pr functions
* Update WORDLIST
* Work on NEWS
Copy file name to clipboardExpand all lines: NEWS.md
+44-10Lines changed: 44 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,5 @@
1
1
# usethis (development version)
2
2
3
-
## Adoption of gert and credentials
4
-
5
-
Usethis now uses the gert package for Git operations (<https://docs.ropensci.org/gert>), where previously we used git2r. The main motivation for this is to provide a smoother user experience by discovering and using the same credentials as command line Git (and, therefore, the same as RStudio). Under the hood, the hero is the credentials package (<https://docs.ropensci.org/credentials/>). `use_git_credentials()` and `git_credentials()` are now deprecated, since usethis no longer needs a way for a user to provide explicit credentials. The switch to gert + credentials should eliminate most credential-finding fiascos, but if you want to learn more, see the [introductory vignette](https://cran.r-project.org/web/packages/credentials/vignettes/intro.html) for the credentials package.
6
-
7
-
Gert also takes a different approach to wrapping libgit2, the underlying C library that does Git operations. The result is more consistent support for SSH and TLS, across all operating systems, without requiring special effort at install time. More users should enjoy Git remote operations that "just work", for both SSH and HTTPS remotes. There should be fewer "unsupported protocol" errors.
8
-
9
3
## GitHub remote configuration
10
4
11
5
Usethis gains a more formal framework for characterizing a GitHub remote configuration. We look at:
@@ -16,17 +10,57 @@ Usethis gains a more formal framework for characterizing a GitHub remote configu
16
10
17
11
This is an internal matter, but users will notice that usethis is more clear about which configurations are supported by various functions and which are not. The most common configurations are reviewed in a [section of Happy Git](https://happygitwithr.com/common-remote-setups.html).
18
12
19
-
When working in a fork, there is sometimes a question whether to target the fork or the parent repository. For example, `use_github_links()` adds GitHub links to the URL and BugReports fields of DESCRIPTION. If someone calls `use_github_links()` when working in a fork, they probably want those links to refer to the *parent* repo, not to their fork, because the user is probably preparing a pull request. Usethis should now have better default behaviour in these situations and, in some cases, will present an interactive choice.
13
+
When working in a fork, there is sometimes a question whether to target the fork or the parent repository. For example, `use_github_links()` adds GitHub links to the URL and BugReports fields of DESCRIPTION. If someone calls `use_github_links()` when working in a fork, they probably want those links to refer to the *parent* or *source* repo, not to their fork, because the user is probably preparing a pull request. Usethis should now have better default behaviour in these situations and, in some cases, will present an interactive choice.
14
+
15
+
## Adoption of gert and getting usethis out of the Git credential business
16
+
17
+
Usethis has various functions that help with Git-related tasks, which break down into two categories:
18
+
19
+
1. Git tasks, such as clone, push, and pull. These are things you could do with
20
+
command line Git.
21
+
1. GitHub tasks, such as fork, release, and open an issue / pull request. These
22
+
are things you could do in the browser or with the GitHub API.
23
+
24
+
We've switched from git2r to the gert package for Git operations (<https://docs.ropensci.org/gert>). We continue to use the gh package for GitHub API work (<https://gh.r-lib.org>).
25
+
26
+
The big news in this area is that these lower-level dependencies are getting better at finding Git credentials, finding the same credentials as command line Git (and, therefore, the same as RStudio), and finding the same credentials as each other. This allows usethis to shed some of the workarounds we have needed in the past, to serve as a remedial "credential valet".
27
+
28
+
Under the hood, both gert and gh are now consulting your local Git credential store, when they need credentials. At the time of writing, they are using two different even-lower-level packages to do this:
29
+
30
+
* gert uses the credentials package (<https://docs.ropensci.org/credentials/>)
31
+
* gh uses the gitcreds package (<https://r-lib.github.io/gitcreds/>)
32
+
33
+
Even now, gert and gh should discover the same credentials, at least for github.com. Moving forward, we are hopeful that these two packages will merge into one.
34
+
35
+
The main user-facing changes in usethis are:
36
+
37
+
* usethis should be able to work with any GitHub deployment. While github.com is the default, GitHub Enterprise deployments should be fully supported.
38
+
* The target `host` is determined from the current project's configured GitHub remotes, whenever possible.
39
+
* The associated `auth_token` is determined from the target `host`, whenever possible.
40
+
41
+
As a result, several functions are deprecated and several other functions have some deprecated arguments.
The switch to gert + credentials should eliminate most credential-finding fiascos, but if you want to learn more, see the [introductory vignette](https://cran.r-project.org/web/packages/credentials/vignettes/intro.html) for the credentials package. Gert also takes a different approach to wrapping libgit2, the underlying C library that does Git operations. The result is more consistent support for SSH and TLS, across all operating systems, without requiring special effort at install time. More users should enjoy Git remote operations that "just work", for both SSH and HTTPS remotes. There should be fewer "unsupported protocol" errors.
20
56
21
57
## Default branch
22
58
23
59
There is increasing interest in making the name of a repo's default branch configurable. In principle, this is already possible, but in reality many Git tools have `master` hard-wired in various places and usethis is no exception. We are laying the groundwork to respect a repository-specific default branch in a future release. It remains to be seen if some standard will emerge for where to record this info or if usethis needs to track it in a custom Git configuration field.
24
60
25
61
*TODO: Summarize current level of prep or support of non-`master` default branch.*
26
62
27
-
## Changes to Git/GitHub-related functions
28
-
29
-
`use_git_credentials()` and `git_credentials()` are deprecated. All credential-handling has been delegated to the credentials package.
63
+
## Changes to behaviour of Git/GitHub-related functions
30
64
31
65
`pr_finish()` deletes the remote PR branch if the PR has been merged and the current user has the power to do so, i.e. an external contributor deleting their own branch or a maintainer deleting a branch associated with an internal PR (#1150).
0 commit comments