Skip to contents

Points a named tag at name's current revision, or at rev — this is how you retroactively tag a prior revision, e.g. tagging the version before your latest edit. These are lengua's own tags (refs/lengua/tags/<name>/<tag>), not git tags: they're scoped per template, so the same tag name can exist independently on several templates. A tag name works anywhere lq_get()'s rev or lq_diff()'s from/to accept a revision.

Usage

lq_tag(path, name, tag, rev = NULL, force = FALSE, source = NULL)

Arguments

path

Path to the library.

name

Template name.

tag

Tag name. Can't be "HEAD" (any casing) or look like a commit id — both would be ambiguous as a revision.

rev

Revision to tag instead of the current HEAD.

force

Overwrite the tag if it already exists.

source

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

Value

Invisibly, a lenguar_tag_result (has $name, $tag, $commit).

Examples

store <- withr::local_tempdir()
lq_init(store)
lq_add(store, "letter.md", "We had so much fun.", message = "past tense")
lq_add(store, "letter.md", "We will have so much fun.", message = "future tense")
lq_tag(store, "letter.md", "tense-future")
lq_tag(store, "letter.md", "tense-past", rev = "HEAD~1")