Skip to contents

Diff a template between two revisions

Usage

lq_diff(path, name, from = "HEAD~1", to = "HEAD", source = NULL)

Arguments

path

Path to the library.

name

Template name.

from, to

Revisions to compare (any revspec lengua understands, e.g. "HEAD", "HEAD~1", a commit sha).

source

Which source to read. Required if the library has more than one source.

Value

A lenguar_diff data frame with tag ("equal"/"insert"/"delete") and line columns.

Examples

store <- withr::local_tempdir()
lq_init(store)
lq_add(store, "hello.md", "v1", message = "v1")
lq_add(store, "hello.md", "v2", message = "v2")
lq_diff(store, "hello.md")
#>   ---
#>   {}
#>   ---
#>   
#> - v1
#> + v2