diff --git a/base/libgit2/tag.jl b/base/libgit2/tag.jl index 3c0d31a2b6b52..098bfd03837e9 100644 --- a/base/libgit2/tag.jl +++ b/base/libgit2/tag.jl @@ -1,5 +1,10 @@ # This file is a part of Julia. License is MIT: http://julialang.org/license +""" + LibGit2.tag_list(repo::GitRepo) -> Vector{String} + +Get a list of all tags in the git repository `repo`. +""" function tag_list(repo::GitRepo) sa_ref = Ref(StrArrayStruct()) @check ccall((:git_tag_list, :libgit2), Cint, @@ -9,11 +14,27 @@ function tag_list(repo::GitRepo) res end +""" + LibGit2.tag_delete(repo::GitRepo, tag::AbstractString) + +Remove the git tag `tag` from the repository `repo`. +""" function tag_delete(repo::GitRepo, tag::AbstractString) @check ccall((:git_tag_delete, :libgit2), Cint, (Ptr{Void}, Cstring, ), repo.ptr, tag) end +""" + LibGit2.tag_create(repo::GitRepo, tag::AbstractString, commit; kwargs...) + +Create a new git tag `tag` (e.g. `"v0.5"`) in the repository `repo`, at +the commit `commit`. + +The keyword arguments are: + * `msg::AbstractString=""`: the message for the tag. + * `force::Bool=false`: if `true`, existing references will be overwritten. + * `sig::Signature=Signature(repo)`: the tagger's signature. +""" function tag_create(repo::GitRepo, tag::AbstractString, commit::Union{AbstractString,AbstractGitHash}; msg::AbstractString = "", force::Bool = false, @@ -30,6 +51,11 @@ function tag_create(repo::GitRepo, tag::AbstractString, commit::Union{AbstractSt return oid_ptr[] end +""" + LibGit2.name(tag::GitTag) + +The name of `tag` (e.g. `"v0.5"`). +""" function name(tag::GitTag) str_ptr = ccall((:git_tag_name, :libgit2), Cstring, (Ptr{Void}, ), tag.ptr) str_ptr == C_NULL && throw(Error.GitError(Error.ERROR))