Merge branch 'ds/add-missing-tags'
authorJunio C Hamano <gitster@pobox.com>
Tue, 13 Nov 2018 13:37:24 +0000 (22:37 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Nov 2018 13:37:24 +0000 (22:37 +0900)
The history traversal used to implement the tag-following has been
optimized by introducing a new helper.

* ds/add-missing-tags:
remote: make add_missing_tags() linear
test-reach: test get_reachable_subset
commit-reach: implement get_reachable_subset

1  2 
commit-reach.h
diff --combined commit-reach.h
index 7a65f55e59fd724fb351055b67a8c87a86a35c7c,defcef4076f2b9427a2572087e5909cba99874b7..fb8082a2ece94a94cf2f9a55ba95950caa41a914
@@@ -1,13 -1,12 +1,13 @@@
  #ifndef COMMIT_REACH_H
  #define COMMIT_REACH_H
  
 +#include "commit.h"
  #include "commit-slab.h"
  
 -struct commit;
  struct commit_list;
 -struct contains_cache;
  struct ref_filter;
 +struct object_id;
 +struct object_array;
  
  struct commit_list *get_merge_bases_many(struct commit *one,
                                         int n,
@@@ -75,4 -74,17 +75,17 @@@ int can_all_from_reach_with_flag(struc
  int can_all_from_reach(struct commit_list *from, struct commit_list *to,
                       int commit_date_cutoff);
  
+ /*
+  * Return a list of commits containing the commits in the 'to' array
+  * that are reachable from at least one commit in the 'from' array.
+  * Also add the given 'flag' to each of the commits in the returned list.
+  *
+  * This method uses the PARENT1 and PARENT2 flags during its operation,
+  * so be sure these flags are not set before calling the method.
+  */
+ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
+                                        struct commit **to, int nr_to,
+                                        unsigned int reachable_flag);
  #endif