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 /src/revwalk.h | |
| 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 'src/revwalk.h')
| -rw-r--r-- | src/revwalk.h | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/revwalk.h b/src/revwalk.h index 7b69ccd63..2970d773c 100644 --- a/src/revwalk.h +++ b/src/revwalk.h @@ -8,60 +8,4 @@ #include "repository.h" #include "hashtable.h" -struct git_revwalk_commit; - -typedef struct git_revwalk_listnode { - struct git_revwalk_commit *walk_commit; - struct git_revwalk_listnode *next; - struct git_revwalk_listnode *prev; -} git_revwalk_listnode; - -typedef struct git_revwalk_list { - struct git_revwalk_listnode *head; - struct git_revwalk_listnode *tail; - size_t size; -} git_revwalk_list; - - -struct git_revwalk_commit { - - git_commit *commit_object; - git_revwalk_list parents; - - unsigned short in_degree; - unsigned seen:1, - uninteresting:1, - topo_delay:1, - flags:25; -}; - -typedef struct git_revwalk_commit git_revwalk_commit; - -struct git_revwalk { - git_repository *repo; - - git_hashtable *commits; - git_revwalk_list iterator; - - git_revwalk_commit *(*next)(git_revwalk_list *); - - unsigned walking:1; - unsigned int sorting; -}; - - -void git_revwalk__prepare_walk(git_revwalk *walk); -int git_revwalk__enroot(git_revwalk *walk, git_commit *commit); - -int git_revwalk_list_push_back(git_revwalk_list *list, git_revwalk_commit *commit); -int git_revwalk_list_push_front(git_revwalk_list *list, git_revwalk_commit *obj); - -git_revwalk_commit *git_revwalk_list_pop_back(git_revwalk_list *list); -git_revwalk_commit *git_revwalk_list_pop_front(git_revwalk_list *list); - -void git_revwalk_list_clear(git_revwalk_list *list); - -void git_revwalk_list_timesort(git_revwalk_list *list); -void git_revwalk_list_toposort(git_revwalk_list *list); - #endif /* INCLUDE_revwalk_h__ */ |
