From 8cceb3b183db41cdf0795b1f10cd5e2e467b975a Mon Sep 17 00:00:00 2001 From: kshyatt Date: Mon, 31 Jul 2017 14:46:19 -0400 Subject: [PATCH] Doc author, committer, message --- base/libgit2/commit.jl | 22 ++++++++++++++++++++++ doc/src/devdocs/libgit2.md | 3 +++ 2 files changed, 25 insertions(+) diff --git a/base/libgit2/commit.jl b/base/libgit2/commit.jl index 63ae8825e8175..9060e6304469e 100644 --- a/base/libgit2/commit.jl +++ b/base/libgit2/commit.jl @@ -1,5 +1,13 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +""" + message(c::GitCommit, raw::Bool=false) + +Return the commit message describing the changes made in commit `c`. If +`raw` is `false`, return a slightly "cleaned up" message (which has any +leading newlines removed). If `raw` is `true`, the message is not stripped +of any such newlines. +""" function message(c::GitCommit, raw::Bool=false) local msg_ptr::Cstring msg_ptr = raw ? ccall((:git_commit_message_raw, :libgit2), Cstring, (Ptr{Void},), c.ptr) : @@ -10,12 +18,26 @@ function message(c::GitCommit, raw::Bool=false) return unsafe_string(msg_ptr) end +""" + author(c::GitCommit) + +Return the [`Signature`](@ref) of the author of the commit `c`. The author is +the person who made changes to the relevant file(s). See also [`committer`](@ref). +""" function author(c::GitCommit) ptr = ccall((:git_commit_author, :libgit2), Ptr{SignatureStruct}, (Ptr{Void},), c.ptr) @assert ptr != C_NULL return Signature(ptr) end +""" + committer(c::GitCommit) + +Return the [`Signature`](@ref) of the committer of the commit `c`. The committer is +the person who committed the changes originally authored by the [`author`](@ref), but +need not be the same as the `author`, for example, if the `author` emailed a patch to +a `committer` who committed it. +""" function committer(c::GitCommit) ptr = ccall((:git_commit_committer, :libgit2), Ptr{SignatureStruct}, (Ptr{Void},), c.ptr) @assert ptr != C_NULL diff --git a/doc/src/devdocs/libgit2.md b/doc/src/devdocs/libgit2.md index 8472105fbfd31..fb86054d00811 100644 --- a/doc/src/devdocs/libgit2.md +++ b/doc/src/devdocs/libgit2.md @@ -53,6 +53,7 @@ Base.LibGit2.UserPasswordCredentials Base.LibGit2.add_fetch! Base.LibGit2.add_push! Base.LibGit2.addblob! +Base.LibGit2.author Base.LibGit2.authors Base.LibGit2.branch Base.LibGit2.branch! @@ -60,6 +61,7 @@ Base.LibGit2.checkout! Base.LibGit2.checkused! Base.LibGit2.clone Base.LibGit2.commit +Base.LibGit2.committer Base.LibGit2.create_branch Base.LibGit2.credentials_callback Base.LibGit2.credentials_cb @@ -88,6 +90,7 @@ Base.LibGit2.isorphan Base.LibGit2.lookup_branch Base.LibGit2.mirror_callback Base.LibGit2.mirror_cb +Base.LibGit2.message Base.LibGit2.name Base.LibGit2.need_update Base.LibGit2.objtype