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>
This commit is contained in:
parent
437b1b20df
commit
c4025103fa
21
revision.c
21
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))
|
||||
(commit->date < revs->max_age)) {
|
||||
if (revs->boundary)
|
||||
commit->object.flags |=
|
||||
BOUNDARY_SHOW | BOUNDARY;
|
||||
else
|
||||
continue;
|
||||
add_parents_to_list(revs, commit, &revs->commits);
|
||||
} else
|
||||
add_parents_to_list(revs, commit,
|
||||
&revs->commits);
|
||||
}
|
||||
if (commit->object.flags & SHOWN)
|
||||
continue;
|
||||
@ -1298,6 +1304,17 @@ struct commit *get_revision(struct rev_info *revs)
|
||||
case -1:
|
||||
break;
|
||||
case 0:
|
||||
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--;
|
||||
|
Loading…
x
Reference in New Issue
Block a user