Learn R Programming

git2r (version 0.21.0)

coerce-git_commit-method: Coerce a commit to a data.frame

Description

The commit is coerced to a data.frame

Arguments

from

The commit object

Value

data.frame

Details

The data.frame have the following columns:

sha

The 40 character hexadecimal string of the SHA-1

summary

the short "summary" of the git commit message.

message

the full message of a commit

author

full name of the author

email

email of the author

when

time when the commit happened

Examples

Run this code
# NOT RUN {
## Initialize a temporary repository
path <- tempfile(pattern="git2r-")
dir.create(path)
repo <- init(path)

## Create a user
config(repo, user.name="Alice", user.email="alice@example.org")

## Create a file and commit
writeLines("Example file",  file.path(path, "example.txt"))
add(repo, "example.txt")
c1 <- commit(repo, "Commit message")

## Coerce the commit to a data.frame
df <- as(c1, "data.frame")
df
# }

Run the code above in your browser using DataLab