1 #ifndef __COMMIT_REACH_H__
2 #define __COMMIT_REACH_H__
7 struct commit_list *get_merge_bases_many(struct commit *one,
10 struct commit_list *get_merge_bases_many_dirty(struct commit *one,
12 struct commit **twos);
13 struct commit_list *get_merge_bases(struct commit *one, struct commit *two);
14 struct commit_list *get_octopus_merge_bases(struct commit_list *in);
16 /* To be used only when object flags after this call no longer matter */
17 struct commit_list *get_merge_bases_many_dirty(struct commit *one, int n, struct commit **twos);
19 int is_descendant_of(struct commit *commit, struct commit_list *with_commit);
20 int in_merge_bases_many(struct commit *commit, int nr_reference, struct commit **reference);
21 int in_merge_bases(struct commit *commit, struct commit *reference);
25 * Takes a list of commits and returns a new list where those
26 * have been removed that can be reached from other commits in
27 * the list. It is useful for, e.g., reducing the commits
28 * randomly thrown at the git-merge command and removing
29 * redundant commits that the user shouldn't have given to it.
31 * This function destroys the STALE bit of the commit objects'
34 struct commit_list *reduce_heads(struct commit_list *heads);
37 * Like `reduce_heads()`, except it replaces the list. Use this
38 * instead of `foo = reduce_heads(foo);` to avoid memory leaks.
40 void reduce_heads_replace(struct commit_list **heads);
42 int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid);