@matheusbsbs / matheus-bagliano / commits / c4025103fa
Fork 0

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>

Johannes Schindelin committed Feb 19, 2007 at 03:14 UTC c4025103faf02a1b457b945cf5e4e12c97fa72d7
1 file changed +21 -4
revision.c
+21 -4
@@ -1229,9 +1229,15 @@ static struct commit *get_revision_1(struct rev_info *revs)
1229 */
1230 if (!revs->limited) {
1231 if (revs->max_age != -1 &&
1232 - (commit->date < revs->max_age))
1233 - continue;
1234 - add_parents_to_list(revs, commit, &revs->commits);
1232 + (commit->date < revs->max_age)) {
1233 + if (revs->boundary)
1234 + commit->object.flags |=
1235 + BOUNDARY_SHOW | BOUNDARY;
1236 + else
1237 + continue;
1238 + } else
1239 + add_parents_to_list(revs, commit,
1240 + &revs->commits);
1241 }
1242 if (commit->object.flags & SHOWN)
1243 continue;
@@ -1298,7 +1304,18 @@ struct commit *get_revision(struct rev_info *revs)
1304 case -1:
1305 break;
1306 case 0:
1301 - return NULL;
1307 + if (revs->boundary) {
1308 + struct commit_list *list = revs->commits;
1309 + while (list) {
1310 + list->item->object.flags |=
1311 + BOUNDARY_SHOW | BOUNDARY;
1312 + list = list->next;
1313 + }
1314 + /* all remaining commits are boundary commits */
1315 + revs->max_count = -1;
1316 + revs->limited = 1;
1317 + } else
1318 + return NULL;
1319 default:
1320 revs->max_count--;
1321 }