void show_object_with_name(FILE *out, struct object *obj, const char *name)
{
- const char *p;
-
fprintf(out, "%s ", oid_to_hex(&obj->oid));
- for (p = name; *p && *p != '\n'; p++)
+ /*
+ * This "for (const char *p = ..." is made as a first step towards
+ * making use of such declarations elsewhere in our codebase. If
+ * it causes compilation problems on your platform, please report
+ * it to the Git mailing list at git@vger.kernel.org. In the meantime,
+ * adding -std=gnu99 to CFLAGS may help if you are with older GCC.
+ */
+ for (const char *p = name; *p && *p != '\n'; p++)
fputc(*p, out);
fputc('\n', out);
}
} else if (!strcmp(arg, "--author-date-order")) {
revs->sort_order = REV_SORT_BY_AUTHOR_DATE;
revs->topo_order = 1;
- } else if (!strcmp(arg, "--unsorted-input")) {
- if (revs->no_walk)
- die(_("--unsorted-input is incompatible with --no-walk"));
- revs->unsorted_input = 1;
} else if (!strcmp(arg, "--early-output")) {
revs->early_output = 100;
revs->topo_order = 1;
} else if (!strcmp(arg, "--not")) {
*flags ^= UNINTERESTING | BOTTOM;
} else if (!strcmp(arg, "--no-walk")) {
- if (!revs->no_walk && revs->unsorted_input)
- die(_("--no-walk is incompatible with --unsorted-input"));
revs->no_walk = 1;
} else if (skip_prefix(arg, "--no-walk=", &optarg)) {
- if (!revs->no_walk && revs->unsorted_input)
- die(_("--no-walk is incompatible with --unsorted-input"));
-
/*
* Detached form ("--no-walk X" as opposed to "--no-walk=X")
* not allowed, since the argument is optional.