aboutsummaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-06-27 18:22:03 +0200
committerJunio C Hamano <gitster@pobox.com>2008-06-30 22:45:51 -0700
commit98cf9c3bd7504d36e6049939bf9cc624f2cf5b9f (patch)
tree1d74146b496f63ad16769356320c65e0bf5c2d6e /commit.h
parent6a938648e1454842157b84408acbb6471ec6745f (diff)
downloadgit-98cf9c3bd7504d36e6049939bf9cc624f2cf5b9f.tar.gz
git-98cf9c3bd7504d36e6049939bf9cc624f2cf5b9f.tar.xz
Introduce reduce_heads()
The new function reduce_heads() is given a list of commits, and removes ones that can be reached from other commits in the list. It is useful for reducing the commits randomly thrown at the git-merge command and remove redundant commits that the user shouldn't have given to it. The implementation uses the get_merge_bases_many() introduced in the previous commit. If the merge base between one commit taken from the list and the remaining commits is the commit itself, that means the commit is reachable from some of the other commits. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/commit.h b/commit.h
index dcec7fb9a..2acfc79d3 100644
--- a/commit.h
+++ b/commit.h
@@ -140,4 +140,6 @@ static inline int single_parent(struct commit *commit)
return commit->parents && !commit->parents->next;
}
+struct commit_list *reduce_heads(struct commit_list *heads);
+
#endif /* COMMIT_H */