X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=commit.h;h=e43dfd01823481a23b542e0a4ab1a5df8b493e70;hb=81c6b38b;hp=4138bb4c0850f95ba7215cb62f457cd682495968;hpb=b76a9e164854a7a87a2f21859f05b132ee5b83d9;p=thirdparty%2Fgit.git diff --git a/commit.h b/commit.h index 4138bb4c08..e43dfd0182 100644 --- a/commit.h +++ b/commit.h @@ -14,7 +14,7 @@ struct commit_list { struct commit { struct object object; void *util; - unsigned int indegree; + unsigned int index; unsigned long date; struct commit_list *parents; struct tree *tree; @@ -139,15 +139,24 @@ struct commit *pop_commit(struct commit_list **stack); void clear_commit_marks(struct commit *commit, unsigned int mark); void clear_commit_marks_for_object_array(struct object_array *a, unsigned mark); + +enum rev_sort_order { + REV_SORT_IN_GRAPH_ORDER = 0, + REV_SORT_BY_COMMIT_DATE, + REV_SORT_BY_AUTHOR_DATE +}; + /* * Performs an in-place topological sort of list supplied. * * invariant of resulting list is: * a reachable from b => ord(b) < ord(a) - * in addition, when lifo == 0, commits on parallel tracks are - * sorted in the dates order. + * sort_order further specifies: + * REV_SORT_IN_GRAPH_ORDER: try to show a commit on a single-parent + * chain together. + * REV_SORT_BY_COMMIT_DATE: show eligible commits in committer-date order. */ -void sort_in_topological_order(struct commit_list ** list, int lifo); +void sort_in_topological_order(struct commit_list **, enum rev_sort_order); struct commit_graft { unsigned char sha1[20]; @@ -164,7 +173,7 @@ extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *r extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos, int cleanup); extern struct commit_list *get_octopus_merge_bases(struct commit_list *in); -/* largest postive number a signed 32-bit integer can contain */ +/* largest positive number a signed 32-bit integer can contain */ #define INFINITE_DEPTH 0x7fffffff extern int register_shallow(const unsigned char *sha1);