Skip to content

Commit

Permalink
Remove some git /github related defunct functions (#1980)
Browse files Browse the repository at this point in the history
* Remove defunct functions `browse_github_token()`, `browse_github_pat()`, `github_token()`, `pr_sync()`, and `pr_pull_upstream()`.

* Add news + adjust pkgdown + add redirects

---------

Co-authored-by: Jennifer (Jenny) Bryan <[email protected]>
  • Loading branch information
olivroy and jennybc authored Jul 24, 2024
1 parent 1909b25 commit 1f73587
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 120 deletions.
5 changes: 0 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ export(browse_cran)
export(browse_github)
export(browse_github_actions)
export(browse_github_issues)
export(browse_github_pat)
export(browse_github_pulls)
export(browse_github_token)
export(browse_package)
export(browse_project)
export(browse_travis)
Expand Down Expand Up @@ -45,7 +43,6 @@ export(git_protocol)
export(git_remotes)
export(git_sitrep)
export(git_vaccinate)
export(github_token)
export(issue_close_community)
export(issue_reprex_needed)
export(local_project)
Expand All @@ -56,10 +53,8 @@ export(pr_init)
export(pr_merge_main)
export(pr_pause)
export(pr_pull)
export(pr_pull_upstream)
export(pr_push)
export(pr_resume)
export(pr_sync)
export(pr_view)
export(proj_activate)
export(proj_get)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# usethis (development version)

* `browse_github_token()`, `browse_github_pat()`, and `github_token()` have been removed after being deprecated in usethis 2.0.0. `create_github_token()`, `gh::gh_token()`, and `gh_token_help()` should be used instead.

* `pr_pull_upstream()` and `pr_sync()` have been removed after being deprecated in usethis 2.0.0. `pr_merge_main()` and `pr_push()` should be used instead.

* `pr_merge_main()` now offers the choice to not open the files with merge conflicts (@olivroy, #1720).

* `edit_rstudio_snippets()` now accepts yaml snippets (@olivroy, #1941).
Expand Down
69 changes: 2 additions & 67 deletions R/usethis-defunct.R
Original file line number Diff line number Diff line change
@@ -1,77 +1,12 @@
#' Defunct PR functions
#' Deprecated Git functions
#'
#' @description
#' `r lifecycle::badge("defunct")`
#'
#' * `pr_pull_upstream()` has been replaced by [pr_merge_main()].
#' * `pr_sync()` has been replaced by [pr_pull()] + [pr_merge_main()] + [pr_push()]
#'
#' @keywords internal
#' @export
pr_pull_upstream <- function() {
lifecycle::deprecate_stop(
when = "2.0.0",
what = "pr_pull_upstream()",
with = "pr_merge_main()",
)
}

#' @rdname pr_pull_upstream
#' @export
pr_sync <- function() {
lifecycle::deprecate_stop(
when = "2.0.0",
what = "pr_sync()",
details = "Sync a PR with:`pr_pull(); pr_merge_main(); pr_push();`"
)
}

#' Defunct GitHub functions
#'
#' @description
#' `r lifecycle::badge("defunct")`
#' `r lifecycle::badge("deprecated")`
#'
#' * `browse_github_token()` and `browse_github_pat()` have been replaced by
#' [create_github_token()].
#' * `github_token()` has been replaced by [gh::gh_token()]
#' * `git_branch_default()` has been replaced by [git_default_branch()].
#'
#' @keywords internal
#' @export
browse_github_token <- function(...) {
lifecycle::deprecate_stop(
when = "2.0.0",
what = "browse_github_token()",
with = "create_github_token()"
)
}

#' @rdname browse_github_token
#' @export
browse_github_pat <- function(...) {
lifecycle::deprecate_stop(
"2.0.0",
what = "browse_github_pat()",
with = "create_github_token()"
)
}

#' @rdname browse_github_token
#' @export
github_token <- function() {
details <- glue("
Call `gh::gh_token()` to retrieve a GitHub personal access token.
Call `usethis::gh_token_help()` if you need help getting or configuring \\
your token.")
lifecycle::deprecate_stop(
"2.0.0",
what = "github_token()",
details = details
)
}

#' @rdname browse_github_token
#' @export
git_branch_default <- function() {
lifecycle::deprecate_soft("2.1.0", "git_branch_default()", "git_default_branch()")
git_default_branch()
Expand Down
8 changes: 6 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,8 @@ reference:
<img src='figures/lifecycle-deprecated.svg' alt='Deprecated lifecycle'/>
</a>
contents:
- browse_github_token
- git_credentials
- pr_pull_upstream
- git_branch_default
- use_github_actions
- use_tidy_labels
- use_travis
Expand All @@ -188,3 +187,8 @@ articles:
contents:
- articles/ui-cli-conversion
- articles/badge-accessibility

redirects:
- ["reference/browse_github_pat.html", "reference/github-token.html"]
- ["reference/pr_pull_upstream.html","reference/pull-requests.html"]
- ["reference/browse_github_token.html", "reference/github-token.html"]
27 changes: 0 additions & 27 deletions man/browse_github_token.Rd

This file was deleted.

15 changes: 15 additions & 0 deletions man/git_branch_default.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions man/pr_pull_upstream.Rd

This file was deleted.

0 comments on commit 1f73587

Please sign in to comment.