nest_commits_by_pattern {gitdown}R Documentation

Nest all commits by each pattern found in the commit messages

Description

Nest all commits by each pattern found in the commit messages

Usage

nest_commits_by_pattern(
  repo,
  pattern = c(Issues = "#[[:digit:]]+"),
  pattern.table = NULL,
  ref = "main",
  silent = TRUE
)

Arguments

repo

a path to a repository or a git_repository object. Default is '.'

pattern

Named vector with regex pattern to expose commits, like ⁠c("Issues" = "#\[\[:digit:\]\]")⁠ for issues

pattern.table

data.frame with two columns: pattern and description of the pattern. This is used as correspondence table to add some names to existing patterns.

ref

The name of a reference to list commits from e.g. a tag or a branch. The default is NULL for the current branch.

silent

Logical. Whether to hide messages.

Value

A tibble with a row for each different pattern found in commit messages and following columns:

Examples

repo <- fake_repo()
nest_commits_by_pattern(repo)

# With table of correspondence
pattern.table <- data.frame(
  number = c("#2", "#1", "#1000"),
  title = c("#2 A second issue to illustrate a blog post",
            "#1 An example of issue",
            "#1000 issue with no commit"))
 nest_commits_by_pattern(
  repo,
  pattern.table = pattern.table,
  pattern = c("Tickets" = "ticket[[:digit:]]+", "Issues" = "#[[:digit:]]+"))

[Package gitdown version 0.1.6 Index]