From: Junio C Hamano Date: Mon, 1 Jul 2013 19:41:22 +0000 (-0700) Subject: Merge branch 'jc/topo-author-date-sort' X-Git-Tag: v1.8.4-rc0~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=534f0e0996c0a5a0bea5bae8ae088a80a929932b;p=thirdparty%2Fgit.git 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 --- 534f0e0996c0a5a0bea5bae8ae088a80a929932b diff --cc .gitignore index c0e00eb37b,b753817ad4..efa8db0035 --- a/.gitignore +++ b/.gitignore @@@ -191,7 -190,7 +191,8 @@@ /test-mktemp /test-parse-options /test-path-utils + /test-prio-queue +/test-read-cache /test-regex /test-revision-walking /test-run-command diff --cc Makefile index e1583761df,0246194abe..5a68fe5431 --- a/Makefile +++ b/Makefile @@@ -569,7 -552,7 +569,8 @@@ TEST_PROGRAMS_NEED_X += test-mergesor TEST_PROGRAMS_NEED_X += test-mktemp TEST_PROGRAMS_NEED_X += test-parse-options TEST_PROGRAMS_NEED_X += test-path-utils + TEST_PROGRAMS_NEED_X += test-prio-queue +TEST_PROGRAMS_NEED_X += test-read-cache TEST_PROGRAMS_NEED_X += test-regex TEST_PROGRAMS_NEED_X += test-revision-walking TEST_PROGRAMS_NEED_X += test-run-command diff --cc commit.h index 350472114b,e43dfd0182..4d452dc96d --- a/commit.h +++ b/commit.h @@@ -139,9 -137,15 +139,16 @@@ struct commit *pop_most_recent_commit(s struct commit *pop_commit(struct commit_list **stack); 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. * diff --cc revision.c index f1bb731fd7,12d9b64b3a..2f0142f22e --- a/revision.c +++ b/revision.c @@@ -2606,9 -2168,7 +2609,9 @@@ int prepare_revision_walk(struct rev_in if (limit_list(revs) < 0) return -1; if (revs->topo_order) - sort_in_topological_order(&revs->commits, revs->lifo); + sort_in_topological_order(&revs->commits, revs->sort_order); + if (revs->line_level_traverse) + line_log_filter(revs); if (revs->simplify_merges) simplify_merges(revs); if (revs->children.name)