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

Marco reported that

	$ git rev-list --boundary --topo-order --parents 5aa44d5..ab57c8d

misses these two boundary commits.

        c649657501
        eb38cc689e

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: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-03-30 23:59:19 -08:00
Родитель b4a081b428
Коммит 4c0fea0f11
1 изменённых файлов: 18 добавлений и 9 удалений

Просмотреть файл

@ -420,24 +420,33 @@ static void limit_list(struct rev_info *revs)
p = &commit_list_insert(commit, p)->next; p = &commit_list_insert(commit, p)->next;
} }
if (revs->boundary) { if (revs->boundary) {
list = newlist; /* mark the ones that are on the result list first */
while (list) { 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 commit *commit = list->item;
struct object *obj = &commit->object; struct object *obj = &commit->object;
struct commit_list *parent = commit->parents; struct commit_list *parent;
if (obj->flags & (UNINTERESTING|BOUNDARY)) { if (obj->flags & UNINTERESTING)
list = list->next;
continue; continue;
} for (parent = commit->parents;
while (parent) { parent;
parent = parent->next) {
struct commit *pcommit = parent->item; struct commit *pcommit = parent->item;
parent = parent->next;
if (!(pcommit->object.flags & UNINTERESTING)) if (!(pcommit->object.flags & UNINTERESTING))
continue; continue;
pcommit->object.flags |= BOUNDARY; pcommit->object.flags |= BOUNDARY;
if (pcommit->object.flags & TMP_MARK)
continue;
pcommit->object.flags |= TMP_MARK;
p = &commit_list_insert(pcommit, p)->next; 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; revs->commits = newlist;