X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=commit.h;h=5d179d4dc891947e1f8421184f1030bfda245cf7;hb=abe0582207c72ec848e78707577c61a98f5c633d;hp=491b2c148f2d1dfe5db8695fecb4fc5e848a0229;hpb=f755494cec27fed8c9693bb91c26762061518b0b;p=git.git diff --git a/commit.h b/commit.h index 491b2c14..5d179d4d 100644 --- a/commit.h +++ b/commit.h @@ -40,6 +40,7 @@ enum cmit_fmt { CMIT_FMT_DEFAULT = CMIT_FMT_MEDIUM, CMIT_FMT_SHORT, CMIT_FMT_FULL, + CMIT_FMT_ONELINE, }; extern enum cmit_fmt get_commit_format(const char *arg); @@ -54,4 +55,17 @@ struct commit *pop_most_recent_commit(struct commit_list **list, struct commit *pop_commit(struct commit_list **stack); int count_parents(struct commit * commit); + +/* + * Performs an in-place topological sort of list supplied. + * + * Pre-conditions: + * all commits in input list and all parents of those + * commits must have object.util == NULL + * + * Post-conditions: + * invariant of resulting list is: + * a reachable from b => ord(b) < ord(a) + */ +void sort_in_topological_order(struct commit_list ** list); #endif /* COMMIT_H */