+ if (commit->object.flags & (UNINTERESTING|SHOWN))
+ goto next;
+ if (revs->min_age != -1 && (commit->date > revs->min_age))
+ goto next;
+ if (revs->max_age != -1 && (commit->date < revs->max_age))
+ return NULL;
+ if (revs->no_merges && commit->parents && commit->parents->next)
+ goto next;
+ if (revs->prune_fn && revs->dense) {
+ if (!(commit->object.flags & TREECHANGE))
+ goto next;
+ rewrite_parents(commit);
+ }
+ /* More to go? */
+ if (revs->max_count)
+ pop_most_recent_commit(&revs->commits, SEEN);
+ commit->object.flags |= SHOWN;
+ return commit;
+next:
+ pop_most_recent_commit(&revs->commits, SEEN);
+ } while (revs->commits);
+ return NULL;
+}