-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Pull as part of finalize_version() #408
base: main
Are you sure you want to change the base?
Conversation
#' @example man/examples/commit-version.R | ||
#' | ||
#' @export | ||
commit_version <- function() { | ||
amending <- commit_version_impl() | ||
commit_version <- function(pull = TRUE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually the default should be FALSE I suppose
Thanks. |
So you'd prefer the code if (has_remote_branch(gert::git_branch()) && pull) {
# is the local branch behind?
if (gert::git_ahead_behind()$behind > 0) {
# With pull = TRUE we would fetch always and always uncommit + commit if behind master
gert::git_pull(rebase = TRUE)
}
}
to be directly in Another question: is the default |
I'd wrap that code in a function and call it only from Rethinking offline work. If we're offline, or if PATs are unset, everything should still work, but require opt-in. Otherwise, the default should be to require connectivity and PATs, and do everything that's needed to keep the work in sync. Perhaps we need |
Should this be a separate issue?
One way to lose less information when offline is
But offline, one would still not have the info on PR attribution. Maybe for that too it'd be good to ensure the info is stored in the commit messages via "Co-Authored-by". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Now that everything's on GHA, this becomes much lower priority.
#' @description | ||
#' 1. [commit_version()] | ||
force <- commit_version() | ||
#' 1. [tag_version()], setting `force = TRUE` if and only if `commit_version()` | ||
#' amended a commit. | ||
tag <- tag_version(force) | ||
#' 1. git pull with rebase if `pull = TRUE`. | ||
if (has_remote_branch(gert::git_branch()) && pull) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should pull = TRUE
fail if there's a remote branch?
Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Fix #39
Not ready, I need some clarifications. (maybe a concrete example of a stage where
pull=TRUE
makes sense, as well as a concrete example of a stage wherepull=FALSE
makes sense).