extract_commit
extracts the 7-digit SHA1 identifier and message for a
specified commit.
extract_commit(path, num)
path | character. Specify the path to a directory that is a Git repository (or any subdirectory of the Git repository). |
---|---|
num | numeric. The number of the commit to extract in reverse chronological order. In other words, 1 is the most recent commit, 2 is the second most recent commit, etc. |
A list with the named elements sha1
and message
(both
characters). If a Git repository is not found at path
, both are
NA
.
if (FALSE) { # Most recent commit extract_commit(".", 1) # Penultimate commit extract_commit(".", 2) }