summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Kevin Daudt <me@ikke.info>2015-03-19 23:14:08 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-03-19 15:26:21 -0700
commitf88851c6376f0b2a4cf87c061a848e4ae4438e0a (patch)
treeea29f8f8bdc58aeeb3621673b309ee36f5204d90
parentMerge branch 'maint-1.9' into maint-2.0 (diff)
downloadtgif-f88851c6376f0b2a4cf87c061a848e4ae4438e0a.tar.xz
rev-list: refuse --first-parent combined with --bisect
rev-list --bisect is used by git bisect, but never together with --first-parent. Because rev-list --bisect together with --first-parent is not handled currently, and even leads to segfaults, refuse to use both options together. Because this is not supported, it makes little sense to use git log --bisect --first parent either, because refs/heads/bad is not limited to the first parent chain. Helped-by: Junio C. Hamano <gitster@pobox.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Kevin Daudt <me@ikke.info> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Documentation/rev-list-options.txt7
-rw-r--r--revision.c3
-rwxr-xr-xt/t6000-rev-list-misc.sh4
3 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index deb8cca917..9f78fca3f6 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -119,7 +119,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)
@@ -177,7 +178,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::
@@ -558,7 +559,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
diff --git a/revision.c b/revision.c
index 2571ada6bf..161cf73b10 100644
--- a/revision.c
+++ b/revision.c
@@ -2273,6 +2273,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;
}
diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index 3794e4ceaf..97a13a574e 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -73,4 +73,8 @@ test_expect_success 'symleft flag bit is propagated down from tag' '
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