diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-05-23 16:51:31 +0200 |
---|---|---|
committer | Andreas Ericsson <ae@op5.se> | 2010-06-02 10:32:07 +0200 |
commit | 655d381a1948783d7d26ff9ec5ef54ed6bbefb29 (patch) | |
tree | bcc85e9ef60749eb8a4cd9db1c9f7b3b974ff407 /src/commit.h | |
parent | 47c31f584e09d79f3674987582a60c7bb6b673c0 (diff) | |
download | libgit2-655d381a1948783d7d26ff9ec5ef54ed6bbefb29.tar.gz |
Add topological sorting and new insertion methods for commit lists.
'git_commit_list_toposort()' and 'git_commit_list_timesort()' now
sort a commit list by topological and time order respectively.
Both sorts are stable and in place.
'git_commit_list_append' has been replaced by 'git_commit_list_push_back'
and 'git_commit_list_push_front'.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
Diffstat (limited to 'src/commit.h')
-rw-r--r-- | src/commit.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/commit.h b/src/commit.h index 72ea4e962..e8d0c5322 100644 --- a/src/commit.h +++ b/src/commit.h @@ -43,10 +43,16 @@ void git_commit__mark_uninteresting(git_commit *commit); int git_commit_parse_existing(git_commit *commit); -void git_commit_list_clear(git_commit_list *list, int free_commits); -void git_commit_list_append(git_commit_list *list, git_commit *commit); + +void git_commit_list_push_back(git_commit_list *list, git_commit *commit); +void git_commit_list_push_front(git_commit_list *list, git_commit *commit); + git_commit *git_commit_list_pop_back(git_commit_list *list); git_commit *git_commit_list_pop_front(git_commit_list *list); -void git_commit_list_sort(git_commit_list *list); + +void git_commit_list_clear(git_commit_list *list, int free_commits); + +void git_commit_list_timesort(git_commit_list *list); +void git_commit_list_toposort(git_commit_list *list); #endif |