Skip to content

Commit

Permalink
max-count in terms of intersection
Browse files Browse the repository at this point in the history
When a path designation is given, max-count counts the number
of commits therein (intersection), not globally.

This avoids the case where in case path has been inactive
for the last N commits, --max-count=N and path designation
at git-rev-list is given, would give no commits.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Luben Tuikov authored and Junio C Hamano committed Nov 22, 2005
1 parent c3df856 commit 07f9247
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ static int filter_commit(struct commit * commit)
stop_traversal=1;
return CONTINUE;
}
if (max_count != -1 && !max_count--)
return STOP;
if (no_merges && (commit->parents && commit->parents->next))
return CONTINUE;
if (paths && dense) {
Expand All @@ -148,6 +146,9 @@ static int process_commit(struct commit * commit)
return CONTINUE;
}

if (max_count != -1 && !max_count--)
return STOP;

show_commit(commit);

return CONTINUE;
Expand Down

0 comments on commit 07f9247

Please sign in to comment.