aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-16 18:12:49 -0700
committerJunio C Hamano <junkio@cox.net>2006-04-16 22:05:38 -0700
commit1b65a5aa449e2ea99a68f5d13c5521d0dc64dfd1 (patch)
tree4a9db3b92e5e94addafb6e6120015622476dbd85 /revision.c
parente6bfaf3e33beba9431490a4f5c7a9753986554c4 (diff)
downloadgit-1b65a5aa449e2ea99a68f5d13c5521d0dc64dfd1.tar.gz
git-1b65a5aa449e2ea99a68f5d13c5521d0dc64dfd1.tar.xz
rev-list --boundary: show boundary commits even when limited otherwise.
The boundary commits are shown for UI like gitk to draw them as soon as topo-order sorting allows, and should not be omitted by get_revision() filtering logic. As long as their immediate child commits are shown, we should not filter them out. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/revision.c b/revision.c
index 0505f3f45..e1f9816bd 100644
--- a/revision.c
+++ b/revision.c
@@ -750,6 +750,17 @@ static void rewrite_parents(struct rev_info *revs, struct commit *commit)
}
}
+static void mark_boundary_to_show(struct commit *commit)
+{
+ struct commit_list *p = commit->parents;
+ while (p) {
+ commit = p->item;
+ p = p->next;
+ if (commit->object.flags & BOUNDARY)
+ commit->object.flags |= BOUNDARY_SHOW;
+ }
+}
+
struct commit *get_revision(struct rev_info *revs)
{
struct commit_list *list = revs->commits;
@@ -787,8 +798,20 @@ struct commit *get_revision(struct rev_info *revs)
}
if (commit->object.flags & SHOWN)
continue;
- if (!(commit->object.flags & BOUNDARY) &&
- (commit->object.flags & UNINTERESTING))
+
+ /* We want to show boundary commits only when their
+ * children are shown. When path-limiter is in effect,
+ * rewrite_parents() drops some commits from getting shown,
+ * and there is no point showing boundary parents that
+ * are not shown. After rewrite_parents() rewrites the
+ * parents of a commit that is shown, we mark the boundary
+ * parents with BOUNDARY_SHOW.
+ */
+ if (commit->object.flags & BOUNDARY_SHOW) {
+ commit->object.flags |= SHOWN;
+ return commit;
+ }
+ if (commit->object.flags & UNINTERESTING)
continue;
if (revs->min_age != -1 && (commit->date > revs->min_age))
continue;
@@ -801,6 +824,8 @@ struct commit *get_revision(struct rev_info *revs)
if (revs->parents)
rewrite_parents(revs, commit);
}
+ if (revs->boundary)
+ mark_boundary_to_show(commit);
commit->object.flags |= SHOWN;
return commit;
} while (revs->commits);