diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-06-27 18:22:03 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-30 22:45:51 -0700 |
commit | 98cf9c3bd7504d36e6049939bf9cc624f2cf5b9f (patch) | |
tree | 1d74146b496f63ad16769356320c65e0bf5c2d6e /commit.h | |
parent | 6a938648e1454842157b84408acbb6471ec6745f (diff) | |
download | git-98cf9c3bd7504d36e6049939bf9cc624f2cf5b9f.tar.gz |
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.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 */ |