]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Revert "connected: do not sort input revisions"
authorJunio C Hamano <gitster@pobox.com>
Thu, 11 Nov 2021 20:34:41 +0000 (12:34 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Nov 2021 20:34:41 +0000 (12:34 -0800)
This reverts commit f45022dc2fd692fd024f2eb41a86a66f19013d43,
as this is like breakage in the traversal more likely.  In a
history with 10 single strand of pearls,

   1-->2-->3--...->7-->8-->9-->10

asking "rev-list --unsorted-input 1 10 --not 9 8 7 6 5 4" fails to
paint the bottom 1 uninteresting as the traversal stops, without
completing the propagation of uninteresting bit starting at 4 down
through 3 and 2 to 1.

Documentation/rev-list-options.txt
connected.c
revision.c
t/t6000-rev-list-misc.sh

index b7bd27e1713be969b9e2fdc5a7c88cf1d1a5ebe8..24569b06d19d1df690d180000a133008e381d4a3 100644 (file)
@@ -968,11 +968,6 @@ list of the missing objects.  Object IDs are prefixed with a ``?'' character.
        objects.
 endif::git-rev-list[]
 
---unsorted-input::
-       Show commits in the order they were given on the command line instead
-       of sorting them in reverse chronological order by commit time. Cannot
-       be combined with `--no-walk` or `--no-walk=sorted`.
-
 --no-walk[=(sorted|unsorted)]::
        Only show the given commits, but do not traverse their ancestors.
        This has no effect if a range is specified. If the argument
@@ -980,8 +975,7 @@ endif::git-rev-list[]
        given on the command line. Otherwise (if `sorted` or no argument
        was given), the commits are shown in reverse chronological order
        by commit time.
-       Cannot be combined with `--graph`. Cannot be combined with
-       `--unsorted-input` if `sorted` or no argument was given.
+       Cannot be combined with `--graph`.
 
 --do-walk::
        Overrides a previous `--no-walk`.
index b5f9523a5f8633abf32fbc9231784dab9eca708b..b18299fdf0e5224924915810d66196a1d38cbe56 100644 (file)
@@ -106,7 +106,6 @@ no_promisor_pack_found:
        if (opt->progress)
                strvec_pushf(&rev_list.args, "--progress=%s",
                             _("Checking connectivity"));
-       strvec_push(&rev_list.args, "--unsorted-input");
 
        rev_list.git_cmd = 1;
        rev_list.env = opt->env;
index 0dabb5a0bcfe929124677a34d0fd94831d346c57..037b632d1c54b595913f7c17ef07e2e221440777 100644 (file)
@@ -2254,10 +2254,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;
@@ -2653,13 +2649,8 @@ static int handle_revision_pseudo_opt(const char *submodule,
        } 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.
index ef849e5bc88b88a9630671ea2d90a03436dc6c55..12def7bcbf91949a90066b04cb0b9fddeb3f656d 100755 (executable)
@@ -169,35 +169,4 @@ test_expect_success 'rev-list --count --objects' '
        test_line_count = $count actual
 '
 
-test_expect_success 'rev-list --unsorted-input results in different sorting' '
-       git rev-list --unsorted-input HEAD HEAD~ >first &&
-       git rev-list --unsorted-input HEAD~ HEAD >second &&
-       ! test_cmp first second &&
-       sort first >first.sorted &&
-       sort second >second.sorted &&
-       test_cmp first.sorted second.sorted
-'
-
-test_expect_success 'rev-list --unsorted-input incompatible with --no-walk' '
-       cat >expect <<-EOF &&
-               fatal: --no-walk is incompatible with --unsorted-input
-       EOF
-       test_must_fail git rev-list --unsorted-input --no-walk HEAD 2>error &&
-       test_cmp expect error &&
-       test_must_fail git rev-list --unsorted-input --no-walk=sorted HEAD 2>error &&
-       test_cmp expect error &&
-       test_must_fail git rev-list --unsorted-input --no-walk=unsorted HEAD 2>error &&
-       test_cmp expect error &&
-
-       cat >expect <<-EOF &&
-               fatal: --unsorted-input is incompatible with --no-walk
-       EOF
-       test_must_fail git rev-list --no-walk --unsorted-input HEAD 2>error &&
-       test_cmp expect error &&
-       test_must_fail git rev-list --no-walk=sorted --unsorted-input HEAD 2>error &&
-       test_cmp expect error &&
-       test_must_fail git rev-list --no-walk=unsorted --unsorted-input HEAD 2>error &&
-       test_cmp expect error
-'
-
 test_done