summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b4a081b)
raw | patch | inline | side by side (parent: b4a081b)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 31 Mar 2006 07:59:19 +0000 (23:59 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 31 Mar 2006 07:59:19 +0000 (23:59 -0800) |
Marco reported that
$ git rev-list --boundary --topo-order --parents 5aa44d5..ab57c8d
misses these two boundary commits.
c649657501bada28794a30102d9c13cc28ca0e5e
eb38cc689e84a8fd01c1856e889fe8d3b4f1bfb4
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>
$ git rev-list --boundary --topo-order --parents 5aa44d5..ab57c8d
misses these two boundary commits.
c649657501bada28794a30102d9c13cc28ca0e5e
eb38cc689e84a8fd01c1856e889fe8d3b4f1bfb4
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>
revision.c | patch | blob | history |
diff --git a/revision.c b/revision.c
index abc874584e94399d262cd9b31dd2c8e601056cdc..c2a95aabef4558989c8b321d64b2c515a9f71309 100644 (file)
--- a/revision.c
+++ b/revision.c
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;