-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
methods for committer, sha, branch, commit message #135
Comments
Nice! You can use You are right, there are no methods for committer, sha, branch name and commit message. How would you ideally write? |
My misstake, |
@stewid IMHO that is a bad idea. Whenever I call |
Thanks @gaborcsardi, good point. Let's keep |
I've had a go at adding the methods I'm after, let me know if they're consistent with your plans. They work for me in this context:
The current git commit of this file is Proposed methods to avoid use of
|
The two methods library(git2r) ## Clone git2r from github.com/cran/git2r
path <- tempfile()
dir.create(path)
repo <- clone("https://github.com/cran/git2r.git", path, progress = FALSE) ## View content of last commit
str(commits(repo, n = 1)[[1]])
The git commit message is divided into the two slots ## View summary of last commit
summary(commits(repo, n = 1)[[1]])
Insted of |
Would it still be consider to add a |
@cderv |
Oh sorry. I did not see that. 😔 Looking for this I found this thread and not comment about it being implemented. I should have looked better. 😓 |
Are there methods for these already?I'm not having much luck finding them. I'd like to have a colophon with git info like so, but feel a bit uncomfortable using
@
:The current git commit of this file is
r last_commit@sha
, which is on ther branches(repo)[[1]]@name
branch and was made byr last_commit@committer@name
onr when(last_commit)
. The current commit message is "r last_commit@summary
".Which renders nicely as:
The current git commit of this file is 0d0a2e8b40dbcc2b4ad5125fa6e1f08ec5244160, which is on the master branch and was made by Alice on 2015-05-07 23:17:20. The current commit message is “First commit message”.
The text was updated successfully, but these errors were encountered: