git_log: Get a commit log

Description Usage Arguments Value Examples

Description

Get a commit log. Convenience wrapper around the git2r functions coerce-git_repository-method, which coerces the commit log of the repository to a data frame, and commits, which returns individual git_commit objects. The print method shows truncated versions of selected variables, e.g., the commit message, time, and SHA, but rest assured the full information is present in the returned object.

Usage

1
git_log(repo = ".")

Arguments

repo

Path to a Git repo. If unspecified, current working directory is checked to see if it is or is inside a Git repo.

Value

A data frame (or tbl_df) with S3 class git_log, solely for printing purposes. Variables: the commit message, when the commit happened, author, SHA, email, summary, and a list-column of objects of class git_commit.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
require(dplyr, quietly = TRUE)
repo <- git_init(tempfile("githug-"))
owd <- setwd(repo)
line1 <- "Thelma: You're a real live outlaw, aren't ya?"
line2 <- paste("J.D.: Well I may be an outlaw, darlin', but you're the one",
               "stealing my heart.")
writeLines(line1, "tl.txt")
git_COMMIT(line1)
write(line2, "tl.txt", append = TRUE)
git_COMMIT(line2)
git_log()
setwd(owd)

jennybc/githug documentation built on May 19, 2019, 5:05 a.m.