author | Junio C Hamano <gitster@pobox.com> | |
Fri, 27 Jun 2008 16:22:03 +0000 (18:22 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 1 Jul 2008 05:45:51 +0000 (22:45 -0700) | ||
commit | 98cf9c3bd7504d36e6049939bf9cc624f2cf5b9f | |
tree | 1d74146b496f63ad16769356320c65e0bf5c2d6e | tree | snapshot |
parent | 6a938648e1454842157b84408acbb6471ec6745f | commit | diff |
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>
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>
commit.c | diff | blob | history | |
commit.h | diff | blob | history |