get_commits_pattern {gitdown}R Documentation

Get commits associated with a text pattern

Description

Get commits associated with a text pattern

Usage

get_commits_pattern(
  repo = ".",
  pattern = c(Ticket = "#[[:digit:]]+"),
  pattern.table = NULL,
  ref = "main",
  path = NULL,
  silent = FALSE
)

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.

path

The path to a file. If not NULL, only commits modifying this file will be returned. Note that modifying commits that occurred before the file was given its present name are not returned; that is, the output of git log with --no-follow is reproduced.

silent

Logical. Whether to hide messages.

Value

A tibble with one line for each commit, duplicated if associated with multiple patterns and the following columns:

Examples

repo <- fake_repo()
get_commits_pattern(repo = repo, pattern = c("Ticket" = "#[[:digit:]]+"))
get_commits_pattern(repo = repo,
  pattern = c("Ticket" = "ticket[[:digit:]]+", "Issues" = "#[[:digit:]]+"))

[Package gitdown version 0.1.6 Index]