OSDN Git Service

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
  /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
+++ 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
+++ 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
@@@ -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