Skip to content

Commit

Permalink
Merge branch 'kd/rev-list-bisect-first-parent'
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
Junio C Hamano committed Mar 25, 2015
2 parents 01c057d + f88851c commit 257b204
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Documentation/rev-list-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ parents) and `--max-parents=-1` (negative numbers denote no upper limit).
because merges into a topic branch tend to be only about
adjusting to updated upstream from time to time, and
this option allows you to ignore the individual commits
brought in to your history by such a merge.
brought in to your history by such a merge. Cannot be
combined with --bisect.

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

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

--bisect-vars::
This calculates the same as `--bisect`, except that refs in
Expand Down
3 changes: 3 additions & 0 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -2342,6 +2342,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
if (!revs->reflog_info && revs->grep_filter.use_reflog_filter)
die("cannot use --grep-reflog without --walk-reflogs");

if (revs->first_parent_only && revs->bisect)
die(_("--first-parent is incompatible with --bisect"));

return left;
}

Expand Down
4 changes: 4 additions & 0 deletions t/t6000-rev-list-misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,8 @@ test_expect_success 'rev-list can show index objects' '
test_cmp expect actual
'

test_expect_success '--bisect and --first-parent can not be combined' '
test_must_fail git rev-list --bisect --first-parent HEAD
'

test_done

0 comments on commit 257b204

Please sign in to comment.