aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-02-19 03:14:59 +0100
committerJunio C Hamano <junkio@cox.net>2007-02-19 19:07:01 -0800
commitc4025103faf02a1b457b945cf5e4e12c97fa72d7 (patch)
treeb3ed3fca8a1fed9f64a39950f1e0ad420e5bf393 /revision.c
parent437b1b20df4b356c9342dac8d38849f24ef44f27 (diff)
downloadgit-c4025103faf02a1b457b945cf5e4e12c97fa72d7.tar.gz
git-c4025103faf02a1b457b945cf5e4e12c97fa72d7.tar.xz
rev-list --max-age, --max-count: support --boundary
Now, when saying --max-age=<timestamp>, or --max-count=<n>, together with --boundary, rev-list prints the boundary commits, i.e. the commits which are _just_ not shown without --boundary, i.e. their children are, but they aren't. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/revision.c b/revision.c
index 15bdaf609..4f298bacc 100644
--- a/revision.c
+++ b/revision.c
@@ -1229,9 +1229,15 @@ static struct commit *get_revision_1(struct rev_info *revs)
*/
if (!revs->limited) {
if (revs->max_age != -1 &&
- (commit->date < revs->max_age))
- continue;
- add_parents_to_list(revs, commit, &revs->commits);
+ (commit->date < revs->max_age)) {
+ if (revs->boundary)
+ commit->object.flags |=
+ BOUNDARY_SHOW | BOUNDARY;
+ else
+ continue;
+ } else
+ add_parents_to_list(revs, commit,
+ &revs->commits);
}
if (commit->object.flags & SHOWN)
continue;
@@ -1298,7 +1304,18 @@ struct commit *get_revision(struct rev_info *revs)
case -1:
break;
case 0:
- return NULL;
+ if (revs->boundary) {
+ struct commit_list *list = revs->commits;
+ while (list) {
+ list->item->object.flags |=
+ BOUNDARY_SHOW | BOUNDARY;
+ list = list->next;
+ }
+ /* all remaining commits are boundary commits */
+ revs->max_count = -1;
+ revs->limited = 1;
+ } else
+ return NULL;
default:
revs->max_count--;
}