提交 4c0fea0f 编写于 作者: J Junio C Hamano

rev-list --boundary: fix re-injecting boundary commits.

Marco reported that

	$ git rev-list --boundary --topo-order --parents 5aa44d50..ab57c8dd

misses these two boundary commits.

        c6496575
        eb38cc68

Indeed, we can see that gitk shows these two commits at the
bottom, because the --boundary code failed to output them.

The code did not check to avoid pushing the same uninteresting
commit twice to the result list.  I am not sure why this fixes
the reported problem, but this seems to fix it.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 b4a081b4
......@@ -420,24 +420,33 @@ static void limit_list(struct rev_info *revs)
p = &commit_list_insert(commit, p)->next;
}
if (revs->boundary) {
list = newlist;
while (list) {
/* mark the ones that are on the result list first */
for (list = newlist; list; list = list->next) {
struct commit *commit = list->item;
commit->object.flags |= TMP_MARK;
}
for (list = newlist; list; list = list->next) {
struct commit *commit = list->item;
struct object *obj = &commit->object;
struct commit_list *parent = commit->parents;
if (obj->flags & (UNINTERESTING|BOUNDARY)) {
list = list->next;
struct commit_list *parent;
if (obj->flags & UNINTERESTING)
continue;
}
while (parent) {
for (parent = commit->parents;
parent;
parent = parent->next) {
struct commit *pcommit = parent->item;
parent = parent->next;
if (!(pcommit->object.flags & UNINTERESTING))
continue;
pcommit->object.flags |= BOUNDARY;
if (pcommit->object.flags & TMP_MARK)
continue;
pcommit->object.flags |= TMP_MARK;
p = &commit_list_insert(pcommit, p)->next;
}
list = list->next;
}
for (list = newlist; list; list = list->next) {
struct commit *commit = list->item;
commit->object.flags &= ~TMP_MARK;
}
}
revs->commits = newlist;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册