summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-01 12:41:22 -0700
committerJunio C Hamano <gitster@pobox.com>2013-07-01 12:41:23 -0700
commit534f0e0996c0a5a0bea5bae8ae088a80a929932b (patch)
tree734ca0d418edf3e0443f3c4e4d751d5cbfa8be05 /commit.h
parent55f34c8d39dac8a90d4944a77cb7614256c62018 (diff)
parentaff2e7c0677d882690213d7ddea4a868f8b18325 (diff)
downloadgit-534f0e0996c0a5a0bea5bae8ae088a80a929932b.tar.gz
Merge branch 'jc/topo-author-date-sort'
"git log" learned the "--author-date-order" option, with which the output is topologically sorted and commits in parallel histories are shown intermixed together based on the author timestamp. * jc/topo-author-date-sort: t6003: add --author-date-order test topology tests: teach a helper to set author dates as well t6003: add --date-order test topology tests: teach a helper to take abbreviated timestamps t/lib-t6000: style fixes log: --author-date-order sort-in-topological-order: use prio-queue prio-queue: priority queue of pointers to structs toposort: rename "lifo" field
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/commit.h b/commit.h
index 350472114b..4d452dc96d 100644
--- a/commit.h
+++ b/commit.h
@@ -142,15 +142,24 @@ void clear_commit_marks(struct commit *commit, unsigned int mark);
void clear_commit_marks_many(int nr, 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];