tar_git_log {gittargets} | R Documentation |
Data snapshots of a code branch (Git)
Description
Show all the data snapshots of a code branch.
Usage
tar_git_log(
code = getwd(),
store = targets::tar_config_get("store"),
branch = gert::git_branch(repo = code),
max = 100
)
Arguments
code |
Character of length 1, directory path to the code repository,
usually the root of the |
store |
Character of length 1, path to the data store of the pipeline.
If |
branch |
Character of length 1, name of the code repository branch to query. Defaults to the currently checked-out code branch. |
max |
Positive numeric of length 1, maximum number of code commits to inspect for the given branch. |
Details
By design, tar_git_log()
only queries a single
code branch at a time. This allows tar_git_log()
to report more detailed information about the snapshots
of the given code branch.
To query all data snapshots over all branches, simply run
gert::git_branch_list(local = TRUE, repo = "_targets")
.
The valid snapshots show "code=<SHA1>"
in the name
column,
where <SHA1>
is the Git commit hash of the code commit
corresponding to the data snapshot.
Value
A data frame of information about data snapshots and code commits.
See Also
Other git:
tar_git_checkout()
,
tar_git_init()
,
tar_git_ok()
,
tar_git_snapshot()
,
tar_git_status_code()
,
tar_git_status_data()
,
tar_git_status_targets()
,
tar_git_status()
Examples
if (Sys.getenv("TAR_EXAMPLES") == "true" && tar_git_ok(verbose = FALSE)) {
targets::tar_dir({ # Containing code does not modify the user's filespace.
targets::tar_script(tar_target(data, 1))
targets::tar_make()
gert::git_init()
gert::git_add("_targets.R")
gert::git_commit("First commit")
tar_git_init()
tar_git_snapshot(status = FALSE, verbose = FALSE)
tar_git_log()
})
}