From 655d381a1948783d7d26ff9ec5ef54ed6bbefb29 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Sun, 23 May 2010 16:51:31 +0200 Subject: 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 Signed-off-by: Andreas Ericsson --- src/commit.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/commit.h') 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 -- cgit v1.2.1