Compares two versions of a file. The output will appear in the viewer and only rows where there have been additions, deletions or modifications in the file will be shown.
diffPreviousVersions(
file,
previous_version,
current_version = NULL,
banner_cur = NULL,
banner_prev = NULL,
side_by_side = TRUE,
ignore_white_space = FALSE
)
file path from working directory
commit hash of version to compare to current revision
current version (defaults to local copy)
Header for first file in viewer
Header for second file in viewer
Logical. Should diffs be displayed side by side?
Logical. Should white space be ignored?
with_demoRepo({
prev_version <- gitLog("script/data-assembly.R")[2,][["last_commit"]]
diffPreviousVersions(file = "script/data-assembly.R",
previous_version = prev_version)
})
#> < Previous version (d9d77c6) > Current version (7ea9406)
#> @@ 11,2 @@ @@ 11,3 @@
#> lb_0 <- src_abc$lb lb_0 <- src_abc$lb
#> lb_1 <- lb_0 %>% filter(LBTEST == 'Te lb_1 <- lb_0 %>% filter(LBTEST == 'Te
#> st of interest') st of interest')
#> ~ > vs_0 <- src_abc$vs