Merge branch 'jc/topo-author-date-sort'
authorJunio C Hamano <gitster@pobox.com>
Mon, 1 Jul 2013 19:41:22 +0000 (12:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Jul 2013 19:41:23 +0000 (12:41 -0700)
"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

1  2 
.gitignore
Documentation/rev-list-options.txt
Makefile
builtin/log.c
builtin/show-branch.c
commit.c
commit.h
revision.c
revision.h
diff --cc .gitignore
index c0e00eb37bb370ce9deee72468fb419bc25cfd62,b753817ad4b86c6a2d74c11af31c76cab8b4f1c7..efa8db00358772852e637af8758f8f76719dec01
  /test-mktemp
  /test-parse-options
  /test-path-utils
+ /test-prio-queue
 +/test-read-cache
  /test-regex
  /test-revision-walking
  /test-run-command
Simple merge
diff --cc Makefile
index e1583761dfa58c3ede93b2076e4aa0963f2aa379,0246194abe63f565e575dd448cee655672fe6c4d..5a68fe5431043d2b1b98493434c0c7989d36757c
+++ 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 builtin/log.c
Simple merge
Simple merge
diff --cc commit.c
Simple merge
diff --cc commit.h
index 350472114b6ddd3bad40a91c7acfb0629ece14a7,e43dfd01823481a23b542e0a4ab1a5df8b493e70..4d452dc96db3d5590878ab6f257022fe76b4130b
+++ 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 f1bb731fd71eb874344faa5376e7c375ac2fcf7f,12d9b64b3aeb86818352c13e35588e6c673a1ff2..2f0142f22e21d7cfb1c74ca7035ee962e16dbd9e
@@@ -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)
diff --cc revision.h
Simple merge