]> git.ipfire.org Git - thirdparty/git.git/blobdiff - revision.c
refs: print error message in debug output
[thirdparty/git.git] / revision.c
index ab7c1358042fa18a996c66505eb6694b950c18fa..5390a479b30fb91222e2c326b6930182feb0620e 100644 (file)
@@ -44,10 +44,15 @@ static inline int want_ancestry(const struct rev_info *revs);
 
 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);
 }
@@ -2254,10 +2259,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
        } 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;
@@ -2651,13 +2652,8 @@ static int handle_revision_pseudo_opt(struct rev_info *revs,
        } 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.