+static char *build_snapshot_setting(int bitmap)
+{
+ const struct cgit_snapshot_format *f;
+ struct strbuf result = STRBUF_INIT;
+
+ for (f = cgit_snapshot_formats; f->suffix; f++) {
+ if (f->bit & bitmap) {
+ if (result.len)
+ strbuf_addch(&result, ' ');
+ strbuf_addstr(&result, f->suffix);
+ }
+ }
+ return strbuf_detach(&result, NULL);
+}
+
+static char *get_first_line(char *txt)
+{
+ char *t = xstrdup(txt);
+ char *p = strchr(t, '\n');
+ if (p)
+ *p = '\0';
+ return t;
+}
+
+static void print_repo(FILE *f, struct cgit_repo *repo)