+ }
+}
+
+static int filter_commit(struct commit * commit)
+{
+ if (commit->object.flags & UNINTERESTING)
+ return CONTINUE;
+ if (min_age != -1 && (commit->date > min_age))
+ return CONTINUE;
+ if (max_age != -1 && (commit->date < max_age))
+ return STOP;
+ if (max_count != -1 && !max_count--)
+ return STOP;
+
+ return DO;
+}
+
+static int process_commit(struct commit * commit)
+{
+ int action=filter_commit(commit);
+
+ if (action == STOP) {
+ return STOP;
+ }
+
+ if (action == CONTINUE) {
+ return CONTINUE;