-/*
- * These two functions should build up a graph in memory about
- * what objects we've referenced, and found, and types..
- *
- * Right now we don't do that kind of reachability checking. Yet.
- */
-static void mark_needs_sha1(unsigned char *parent, const char * type, unsigned char *child)
+#include "revision.h"
+
+static int show_unreachable = 0;
+static unsigned char head_sha1[20];
+
+static void check_connectivity(void)
+{
+ int i;
+
+ /* Look up all the requirements, warn about missing objects.. */
+ for (i = 0; i < nr_revs; i++) {
+ struct revision *rev = revs[i];
+
+ if (show_unreachable && !(rev->flags & REACHABLE)) {
+ printf("unreachable %s\n", sha1_to_hex(rev->sha1));
+ continue;
+ }
+
+ switch (rev->flags & (SEEN | USED)) {
+ case 0:
+ printf("bad %s\n", sha1_to_hex(rev->sha1));
+ break;
+ case USED:
+ printf("missing %s\n", sha1_to_hex(rev->sha1));
+ break;
+ case SEEN:
+ printf("dangling %s\n", sha1_to_hex(rev->sha1));
+ break;
+ }
+ }
+}
+
+static void mark_needs_sha1(unsigned char *parent, const char * tag, unsigned char *child)