githug (version 0.0.0.9000)

git_log: Get a commit log

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

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

Run this code
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)

Run the code above in your browser using DataLab