diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-03-08 14:57:03 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-03-14 23:52:15 +0200 |
commit | 71db842fac3ba8582255bc5b61361ddef08ef105 (patch) | |
tree | f4c4efa3860da60ef0f3e86c5ab6c1b4dad2d1fc /include/git2 | |
parent | 26022f0719f652ae8311abea6f6de92bd4a75a87 (diff) | |
download | libgit2-71db842fac3ba8582255bc5b61361ddef08ef105.tar.gz |
Rewrite the Revision Walker
The new revision walker uses an internal Commit object storage system,
custom memory allocator and much improved topological and time sorting
algorithms. It's about 20x times faster than the previous implementation
when browsing big repositories.
The following external API calls have changed:
`git_revwalk_next` returns an OID instead of a full commit object.
The initial call to `git_revwalk_next` is no longer blocking when
iterating through a repo with a time-sorting mode.
Iterating with Topological or inverted modes still makes the initial
call blocking to preprocess the commit list, but this block should be
mostly unnoticeable on most repositories (topological preprocessing
times at 0.3s on the git.git repo).
`git_revwalk_push` and `git_revwalk_hide` now take an OID instead
of a full commit object.
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/revwalk.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h index 841110499..fdbbe236c 100644 --- a/include/git2/revwalk.h +++ b/include/git2/revwalk.h @@ -27,6 +27,7 @@ #include "common.h" #include "types.h" +#include "object.h" /** * @file git2/revwalk.h @@ -88,14 +89,15 @@ GIT_EXTERN(void) git_revwalk_reset(git_revwalk *walker); * @param walker the walker being used for the traversal. * @param commit the commit to start from. */ -GIT_EXTERN(int) git_revwalk_push(git_revwalk *walk, git_commit *commit); +GIT_EXTERN(int) git_revwalk_push(git_revwalk *walk, const git_oid *oid); + /** * Mark a commit (and its ancestors) uninteresting for the output. * @param walker the walker being used for the traversal. * @param commit the commit that will be ignored during the traversal */ -GIT_EXTERN(int) git_revwalk_hide(git_revwalk *walk, git_commit *commit); +GIT_EXTERN(int) git_revwalk_hide(git_revwalk *walk, const git_oid *oid); /** * Get the next commit from the revision traversal. @@ -105,7 +107,7 @@ GIT_EXTERN(int) git_revwalk_hide(git_revwalk *walk, git_commit *commit); * @return GIT_SUCCESS if the next commit was found; * GIT_EREVWALKOVER if there are no commits left to iterate */ -GIT_EXTERN(int) git_revwalk_next(git_commit **commit, git_revwalk *walk); +GIT_EXTERN(int) git_revwalk_next(git_oid *oid, git_revwalk *walk); /** * Change the sorting mode when iterating through the |