]> git.ipfire.org Git - thirdparty/git.git/commit
bisect--helper: parse subcommand with OPT_SUBCOMMAND
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Thu, 10 Nov 2022 16:36:22 +0000 (23:36 +0700)
committerTaylor Blau <me@ttaylorr.com>
Fri, 11 Nov 2022 22:04:57 +0000 (17:04 -0500)
commite9011b6092411ca802907a1236d3137bf09081b6
treed316da1a54fa5b41bd64d32b093e8ad8124040c8
parent464ce0aba8526a287c13f96f8d774d7374b647b3
bisect--helper: parse subcommand with OPT_SUBCOMMAND

As of it is, we're parsing subcommand with OPT_CMDMODE, which will
continue to parse more options even if the command has been found.

When we're running "git bisect run" with a command that expecting
a "--log" or "--no-log" arguments, or one of those "--bisect-..."
arguments, bisect--helper may mistakenly think those options are
bisect--helper's option.

We may fix those problems by passing "--" when calling from
git-bisect.sh, and skip that "--" in bisect--helper. However, it may
interfere with user's "--".

Let's parse subcommand with OPT_SUBCOMMAND since that API was born for
this specific use-case.

Reported-by: Lukáš Doktor <ldoktor@redhat.com>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
builtin/bisect--helper.c
git-bisect.sh
t/t6030-bisect-porcelain.sh