Skip to content

Commit a7df4f5

Browse files
committed
Revert "connected: do not sort input revisions"
This reverts commit f45022d, 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.
1 parent f559d6d commit a7df4f5

File tree

4 files changed

+1
-48
lines changed

4 files changed

+1
-48
lines changed

Documentation/rev-list-options.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -968,20 +968,14 @@ list of the missing objects. Object IDs are prefixed with a ``?'' character.
968968
objects.
969969
endif::git-rev-list[]
970970

971-
--unsorted-input::
972-
Show commits in the order they were given on the command line instead
973-
of sorting them in reverse chronological order by commit time. Cannot
974-
be combined with `--no-walk` or `--no-walk=sorted`.
975-
976971
--no-walk[=(sorted|unsorted)]::
977972
Only show the given commits, but do not traverse their ancestors.
978973
This has no effect if a range is specified. If the argument
979974
`unsorted` is given, the commits are shown in the order they were
980975
given on the command line. Otherwise (if `sorted` or no argument
981976
was given), the commits are shown in reverse chronological order
982977
by commit time.
983-
Cannot be combined with `--graph`. Cannot be combined with
984-
`--unsorted-input` if `sorted` or no argument was given.
978+
Cannot be combined with `--graph`.
985979

986980
--do-walk::
987981
Overrides a previous `--no-walk`.

connected.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
106106
if (opt->progress)
107107
strvec_pushf(&rev_list.args, "--progress=%s",
108108
_("Checking connectivity"));
109-
strvec_push(&rev_list.args, "--unsorted-input");
110109

111110
rev_list.git_cmd = 1;
112111
rev_list.env = opt->env;

revision.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,10 +2254,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
22542254
} else if (!strcmp(arg, "--author-date-order")) {
22552255
revs->sort_order = REV_SORT_BY_AUTHOR_DATE;
22562256
revs->topo_order = 1;
2257-
} else if (!strcmp(arg, "--unsorted-input")) {
2258-
if (revs->no_walk)
2259-
die(_("--unsorted-input is incompatible with --no-walk"));
2260-
revs->unsorted_input = 1;
22612257
} else if (!strcmp(arg, "--early-output")) {
22622258
revs->early_output = 100;
22632259
revs->topo_order = 1;
@@ -2653,13 +2649,8 @@ static int handle_revision_pseudo_opt(const char *submodule,
26532649
} else if (!strcmp(arg, "--not")) {
26542650
*flags ^= UNINTERESTING | BOTTOM;
26552651
} else if (!strcmp(arg, "--no-walk")) {
2656-
if (!revs->no_walk && revs->unsorted_input)
2657-
die(_("--no-walk is incompatible with --unsorted-input"));
26582652
revs->no_walk = 1;
26592653
} else if (skip_prefix(arg, "--no-walk=", &optarg)) {
2660-
if (!revs->no_walk && revs->unsorted_input)
2661-
die(_("--no-walk is incompatible with --unsorted-input"));
2662-
26632654
/*
26642655
* Detached form ("--no-walk X" as opposed to "--no-walk=X")
26652656
* not allowed, since the argument is optional.

t/t6000-rev-list-misc.sh

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -169,35 +169,4 @@ test_expect_success 'rev-list --count --objects' '
169169
test_line_count = $count actual
170170
'
171171

172-
test_expect_success 'rev-list --unsorted-input results in different sorting' '
173-
git rev-list --unsorted-input HEAD HEAD~ >first &&
174-
git rev-list --unsorted-input HEAD~ HEAD >second &&
175-
! test_cmp first second &&
176-
sort first >first.sorted &&
177-
sort second >second.sorted &&
178-
test_cmp first.sorted second.sorted
179-
'
180-
181-
test_expect_success 'rev-list --unsorted-input incompatible with --no-walk' '
182-
cat >expect <<-EOF &&
183-
fatal: --no-walk is incompatible with --unsorted-input
184-
EOF
185-
test_must_fail git rev-list --unsorted-input --no-walk HEAD 2>error &&
186-
test_cmp expect error &&
187-
test_must_fail git rev-list --unsorted-input --no-walk=sorted HEAD 2>error &&
188-
test_cmp expect error &&
189-
test_must_fail git rev-list --unsorted-input --no-walk=unsorted HEAD 2>error &&
190-
test_cmp expect error &&
191-
192-
cat >expect <<-EOF &&
193-
fatal: --unsorted-input is incompatible with --no-walk
194-
EOF
195-
test_must_fail git rev-list --no-walk --unsorted-input HEAD 2>error &&
196-
test_cmp expect error &&
197-
test_must_fail git rev-list --no-walk=sorted --unsorted-input HEAD 2>error &&
198-
test_cmp expect error &&
199-
test_must_fail git rev-list --no-walk=unsorted --unsorted-input HEAD 2>error &&
200-
test_cmp expect error
201-
'
202-
203172
test_done

0 commit comments

Comments
 (0)