Skip to content

Commit

Permalink
Module-qualify references to LibGit2.{map,count} (JuliaLang#39461)
Browse files Browse the repository at this point in the history
Reading the documentation is very confusing, because these functions don't
extend the corresponding `Base` functions and they aren't exported.

Ref: JuliaLang#22654 (comment).
  • Loading branch information
giordano authored and ElOceanografo committed May 4, 2021
1 parent e5af534 commit 2e08875
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions stdlib/LibGit2/src/walker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
A `GitRevWalker` *walks* through the *revisions* (i.e. commits) of
a git repository `repo`. It is a collection of the commits
in the repository, and supports iteration and calls to [`map`](@ref LibGit2.map)
and [`count`](@ref LibGit2.count) (for instance, `count` could be used to determine
in the repository, and supports iteration and calls to [`LibGit2.map`](@ref)
and [`LibGit2.count`](@ref) (for instance, `LibGit2.count` could be used to determine
what percentage of commits in a repository were made by a certain
author).
```julia
cnt = LibGit2.with(LibGit2.GitRevWalker(repo)) do walker
count((oid,repo)->(oid == commit_oid1), walker, oid=commit_oid1, by=LibGit2.Consts.SORT_TIME)
LibGit2.count((oid,repo)->(oid == commit_oid1), walker, oid=commit_oid1, by=LibGit2.Consts.SORT_TIME)
end
```
Here, `count` finds the number of commits along the walk with a certain `GitHash`.
Here, `LibGit2.count` finds the number of commits along the walk with a certain `GitHash`.
Since the `GitHash` is unique to a commit, `cnt` will be `1`.
"""
function GitRevWalker(repo::GitRepo)
Expand Down Expand Up @@ -60,7 +60,7 @@ end
Start the [`GitRevWalker`](@ref) `walker` at commit `cid`. This function can be used
to apply a function to all commits since a certain year, by passing the first commit
of that year as `cid` and then passing the resulting `w` to [`map`](@ref LibGit2.map).
of that year as `cid` and then passing the resulting `w` to [`LibGit2.map`](@ref).
"""
function push!(w::GitRevWalker, cid::GitHash)
ensure_initialized()
Expand Down Expand Up @@ -104,7 +104,7 @@ oids = LibGit2.with(LibGit2.GitRevWalker(repo)) do walker
LibGit2.map((oid, repo)->string(oid), walker, by=LibGit2.Consts.SORT_TIME)
end
```
Here, `map` visits each commit using the `GitRevWalker` and finds its `GitHash`.
Here, `LibGit2.map` visits each commit using the `GitRevWalker` and finds its `GitHash`.
"""
function map(f::Function, walker::GitRevWalker;
oid::GitHash=GitHash(),
Expand Down Expand Up @@ -146,10 +146,10 @@ are:
# Examples
```julia
cnt = LibGit2.with(LibGit2.GitRevWalker(repo)) do walker
count((oid, repo)->(oid == commit_oid1), walker, oid=commit_oid1, by=LibGit2.Consts.SORT_TIME)
LibGit2.count((oid, repo)->(oid == commit_oid1), walker, oid=commit_oid1, by=LibGit2.Consts.SORT_TIME)
end
```
`count` finds the number of commits along the walk with a certain `GitHash` `commit_oid1`, starting
`LibGit2.count` finds the number of commits along the walk with a certain `GitHash` `commit_oid1`, starting
the walk from that commit and moving forwards in time from it. Since the `GitHash` is unique to
a commit, `cnt` will be `1`.
"""
Expand Down

0 comments on commit 2e08875

Please sign in to comment.