+static void mark_sha1_path(struct revision *rev, unsigned int mask)
+{
+ struct parent *p;
+
+ if (rev->flags & mask)
+ return;
+
+ rev->flags |= mask;
+ p = rev->parent;
+ while (p) {
+ mark_sha1_path(p->parent, mask);
+ p = p->next;
+ }
+}
+
+/*
+ * Some revisions are less interesting than others.
+ *
+ * For example, if we use a cache-file, that one may contain
+ * revisions that were never used. They are never interesting.
+ *
+ * And sometimes we're only interested in "edge" commits, ie
+ * places where the marking changes between parent and child.
+ */
+static int interesting(struct revision *rev)
+{
+ unsigned mask = marked(rev);
+
+ if (!mask)
+ return 0;
+ if (show_edges) {
+ struct parent *p = rev->parent;
+ while (p) {
+ if (mask != marked(p->parent))
+ return 1;
+ p = p->next;
+ }
+ return 0;
+ }
+ return 1;
+}
+