Skip to content

Commit 257b204

Browse files
committed
Merge branch 'kd/rev-list-bisect-first-parent'
"git rev-list --bisect --first-parent" does not work (yet) and can even cause SEGV; forbid it. "git log --bisect --first-parent" would not be useful until "git bisect --first-parent" materializes, so it is also forbidden for now. * kd/rev-list-bisect-first-parent: rev-list: refuse --first-parent combined with --bisect
2 parents 01c057d + f88851c commit 257b204

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Documentation/rev-list-options.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ parents) and `--max-parents=-1` (negative numbers denote no upper limit).
123123
because merges into a topic branch tend to be only about
124124
adjusting to updated upstream from time to time, and
125125
this option allows you to ignore the individual commits
126-
brought in to your history by such a merge.
126+
brought in to your history by such a merge. Cannot be
127+
combined with --bisect.
127128

128129
--not::
129130
Reverses the meaning of the '{caret}' prefix (or lack thereof)
@@ -185,7 +186,7 @@ ifndef::git-rev-list[]
185186
Pretend as if the bad bisection ref `refs/bisect/bad`
186187
was listed and as if it was followed by `--not` and the good
187188
bisection refs `refs/bisect/good-*` on the command
188-
line.
189+
line. Cannot be combined with --first-parent.
189190
endif::git-rev-list[]
190191

191192
--stdin::
@@ -566,7 +567,7 @@ outputs 'midpoint', the output of the two commands
566567
would be of roughly the same length. Finding the change which
567568
introduces a regression is thus reduced to a binary search: repeatedly
568569
generate and test new 'midpoint's until the commit chain is of length
569-
one.
570+
one. Cannot be combined with --first-parent.
570571

571572
--bisect-vars::
572573
This calculates the same as `--bisect`, except that refs in

revision.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,6 +2342,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
23422342
if (!revs->reflog_info && revs->grep_filter.use_reflog_filter)
23432343
die("cannot use --grep-reflog without --walk-reflogs");
23442344

2345+
if (revs->first_parent_only && revs->bisect)
2346+
die(_("--first-parent is incompatible with --bisect"));
2347+
23452348
return left;
23462349
}
23472350

t/t6000-rev-list-misc.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,8 @@ test_expect_success 'rev-list can show index objects' '
9696
test_cmp expect actual
9797
'
9898

99+
test_expect_success '--bisect and --first-parent can not be combined' '
100+
test_must_fail git rev-list --bisect --first-parent HEAD
101+
'
102+
99103
test_done

0 commit comments

Comments
 (0)