mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ktest: Accept quoted bad term in git bisect output
@ 2026-10-10  1:13 Ricardo B. Marlière (SUSE)
  2026-10-20 18:02 ` Steven Rostedt
  2026-10-20 18:17 ` Steven Rostedt
  0 siblings, 2 replies; 5+ messages in thread
From: Ricardo B. Marlière (SUSE) @ 2026-10-10  1:13 UTC (permalink / raw)
  To: Steven Rostedt, John Hawley; +Cc: linux-kernel, Ricardo B. Marlière (SUSE)

Git commit 0c0f93e7fa64 ("bisect: print bisect terms in single quotes")
changed the completion message to put single quotes around the bisect term.
run_git_bisect() only recognizes "is the first bad commit", so it misses
completion and continues the bisect loop with newer Git.

Accept both quoted and unquoted forms to retain compatibility with older
Git versions.

Link: https://git.kernel.org/pub/scm/git/git.git/commit/?id=0c0f93e7fa645c1058226a9bfde9e2b4441edf96
Assisted-by: LLM
Signed-off-by: Ricardo B. Marlière (SUSE) <ricardo@marliere.net>
---
 tools/testing/ktest/ktest.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index f94ed2e98887..9d63a1dcdb3e 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -3019,7 +3019,7 @@ sub run_git_bisect {
     doprint "SUCCESS\n";
     if ($output =~ m/^(Bisecting: .*\(roughly \d+ steps?\))\s+\[([[:xdigit:]]+)\]/) {
 	doprint "$1 [$2]\n";
-    } elsif ($output =~ m/^([[:xdigit:]]+) is the first bad commit/) {
+    } elsif ($output =~ m/^([[:xdigit:]]+) is the first (?:bad|'bad') commit/) {
 	$bisect_bad_commit = $1;
 	doprint "Found bad commit... $1\n";
 	return 0;

---
base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e
change-id: 20261009-ktest-git-bisect-a894f472843e

Best regards,
--  
Ricardo B. Marlière (SUSE) <ricardo@marliere.net>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ktest: Accept quoted bad term in git bisect output
  2026-10-10  1:13 [PATCH] ktest: Accept quoted bad term in git bisect output Ricardo B. Marlière (SUSE)
@ 2026-10-20 18:02 ` Steven Rostedt
  2026-10-20 18:17 ` Steven Rostedt
  1 sibling, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2026-10-20 18:02 UTC (permalink / raw)
  To: Ricardo B. Marlière (SUSE); +Cc: John Hawley, linux-kernel

On Fri, 09 Oct 2026 22:13:23 -0300
Ricardo B. Marlière (SUSE) <ricardo@marliere.net> wrote:

> Git commit 0c0f93e7fa64 ("bisect: print bisect terms in single quotes")
> changed the completion message to put single quotes around the bisect term.
> run_git_bisect() only recognizes "is the first bad commit", so it misses
> completion and continues the bisect loop with newer Git.
> 
> Accept both quoted and unquoted forms to retain compatibility with older
> Git versions.

Thanks for this fix.

I think we need to let the git folks know that the output is being used by
other tooling so they don't change messages so easily.

I'll go and do that.

-- Steve


> 
> Link: https://git.kernel.org/pub/scm/git/git.git/commit/?id=0c0f93e7fa645c1058226a9bfde9e2b4441edf96
> Assisted-by: LLM
> Signed-off-by: Ricardo B. Marlière (SUSE) <ricardo@marliere.net>
> ---
>  tools/testing/ktest/ktest.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
> index f94ed2e98887..9d63a1dcdb3e 100755
> --- a/tools/testing/ktest/ktest.pl
> +++ b/tools/testing/ktest/ktest.pl
> @@ -3019,7 +3019,7 @@ sub run_git_bisect {
>      doprint "SUCCESS\n";
>      if ($output =~ m/^(Bisecting: .*\(roughly \d+ steps?\))\s+\[([[:xdigit:]]+)\]/) {
>  	doprint "$1 [$2]\n";
> -    } elsif ($output =~ m/^([[:xdigit:]]+) is the first bad commit/) {
> +    } elsif ($output =~ m/^([[:xdigit:]]+) is the first (?:bad|'bad') commit/) {
>  	$bisect_bad_commit = $1;
>  	doprint "Found bad commit... $1\n";
>  	return 0;
> 
> ---
> base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e
> change-id: 20261009-ktest-git-bisect-a894f472843e
> 
> Best regards,
> --  
> Ricardo B. Marlière (SUSE) <ricardo@marliere.net>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ktest: Accept quoted bad term in git bisect output
  2026-10-10  1:13 [PATCH] ktest: Accept quoted bad term in git bisect output Ricardo B. Marlière (SUSE)
  2026-10-20 18:02 ` Steven Rostedt
@ 2026-10-20 18:17 ` Steven Rostedt
  2026-10-20 19:29   ` Ricardo B. Marlière (SUSE)
  1 sibling, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2026-10-20 18:17 UTC (permalink / raw)
  To: Ricardo B. Marlière (SUSE); +Cc: John Hawley, linux-kernel

On Fri, 09 Oct 2026 22:13:23 -0300
Ricardo B. Marlière (SUSE) <ricardo@marliere.net> wrote:

> Git commit 0c0f93e7fa64 ("bisect: print bisect terms in single quotes")
> changed the completion message to put single quotes around the bisect term.
> run_git_bisect() only recognizes "is the first bad commit", so it misses
> completion and continues the bisect loop with newer Git.
> 
> Accept both quoted and unquoted forms to retain compatibility with older
> Git versions.
> 
> Link: https://git.kernel.org/pub/scm/git/git.git/commit/?id=0c0f93e7fa645c1058226a9bfde9e2b4441edf96
> Assisted-by: LLM

I'm guessing you let an LLM fix this?

> Signed-off-by: Ricardo B. Marlière (SUSE) <ricardo@marliere.net>
> ---
>  tools/testing/ktest/ktest.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
> index f94ed2e98887..9d63a1dcdb3e 100755
> --- a/tools/testing/ktest/ktest.pl
> +++ b/tools/testing/ktest/ktest.pl
> @@ -3019,7 +3019,7 @@ sub run_git_bisect {
>      doprint "SUCCESS\n";
>      if ($output =~ m/^(Bisecting: .*\(roughly \d+ steps?\))\s+\[([[:xdigit:]]+)\]/) {
>  	doprint "$1 [$2]\n";
> -    } elsif ($output =~ m/^([[:xdigit:]]+) is the first bad commit/) {
> +    } elsif ($output =~ m/^([[:xdigit:]]+) is the first (?:bad|'bad') commit/) {

Please nuke the "?:" from the above. It's not needed and I never use it. It
only makes the code more complex. Yes, it's because we don't care about
saving what is in the "()", but I never remember how to do that and thus I
never do. The perl code in ktest.pl is meant to be easy to read by those
that know sed and C, and things like this just make it hard to understand.

Thanks,

-- Steve



>  	$bisect_bad_commit = $1;
>  	doprint "Found bad commit... $1\n";
>  	return 0;
> 
> ---
> base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e
> change-id: 20261009-ktest-git-bisect-a894f472843e
> 
> Best regards,
> --  
> Ricardo B. Marlière (SUSE) <ricardo@marliere.net>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ktest: Accept quoted bad term in git bisect output
  2026-10-20 18:17 ` Steven Rostedt
@ 2026-10-20 19:29   ` Ricardo B. Marlière (SUSE)
  2026-10-20 19:34     ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo B. Marlière (SUSE) @ 2026-10-20 19:29 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: John Hawley, linux-kernel

On Tue Oct 20, 2026 at 3:17 PM -03, Steven Rostedt wrote:
> On Fri, 09 Oct 2026 22:13:23 -0300
> Ricardo B. Marlière (SUSE) <ricardo@marliere.net> wrote:
>
>> Git commit 0c0f93e7fa64 ("bisect: print bisect terms in single quotes")
>> changed the completion message to put single quotes around the bisect term.
>> run_git_bisect() only recognizes "is the first bad commit", so it misses
>> completion and continues the bisect loop with newer Git.
>> 
>> Accept both quoted and unquoted forms to retain compatibility with older
>> Git versions.
>> 
>> Link: https://git.kernel.org/pub/scm/git/git.git/commit/?id=0c0f93e7fa645c1058226a9bfde9e2b4441edf96
>> Assisted-by: LLM
>
> I'm guessing you let an LLM fix this?

Yes, it actually hit the problem while running a test then I just accepted
the fix.

>
>> Signed-off-by: Ricardo B. Marlière (SUSE) <ricardo@marliere.net>
>> ---
>>  tools/testing/ktest/ktest.pl | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
>> index f94ed2e98887..9d63a1dcdb3e 100755
>> --- a/tools/testing/ktest/ktest.pl
>> +++ b/tools/testing/ktest/ktest.pl
>> @@ -3019,7 +3019,7 @@ sub run_git_bisect {
>>      doprint "SUCCESS\n";
>>      if ($output =~ m/^(Bisecting: .*\(roughly \d+ steps?\))\s+\[([[:xdigit:]]+)\]/) {
>>  	doprint "$1 [$2]\n";
>> -    } elsif ($output =~ m/^([[:xdigit:]]+) is the first bad commit/) {
>> +    } elsif ($output =~ m/^([[:xdigit:]]+) is the first (?:bad|'bad') commit/) {
>
> Please nuke the "?:" from the above. It's not needed and I never use it. It
> only makes the code more complex. Yes, it's because we don't care about
> saving what is in the "()", but I never remember how to do that and thus I
> never do. The perl code in ktest.pl is meant to be easy to read by those
> that know sed and C, and things like this just make it hard to understand.

Sure thing! Thank you.
By the way, I just saw the thread on the git ML, are you planning to do any
update to ktest?

>
> Thanks,
>
> -- Steve
>
>
>
>>  	$bisect_bad_commit = $1;
>>  	doprint "Found bad commit... $1\n";
>>  	return 0;
>> 
>> ---
>> base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e
>> change-id: 20261009-ktest-git-bisect-a894f472843e
>> 
>> Best regards,
>> --  
>> Ricardo B. Marlière (SUSE) <ricardo@marliere.net>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ktest: Accept quoted bad term in git bisect output
  2026-10-20 19:29   ` Ricardo B. Marlière (SUSE)
@ 2026-10-20 19:34     ` Steven Rostedt
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2026-10-20 19:34 UTC (permalink / raw)
  To: Ricardo B. Marlière (SUSE); +Cc: John Hawley, linux-kernel

On Tue, 20 Oct 2026 16:29:04 -0300
Ricardo B. Marlière (SUSE) <ricardo@marliere.net> wrote:

> Sure thing! Thank you.
> By the way, I just saw the thread on the git ML, are you planning to do any
> update to ktest?

Probably have something for git 3.0, but we still need to support older
versions of git. Thus, we still need this patch.

Thanks,

-- Steve

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-20 19:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-10  1:13 [PATCH] ktest: Accept quoted bad term in git bisect output Ricardo B. Marlière (SUSE)
2026-10-20 18:02 ` Steven Rostedt
2026-10-20 18:17 ` Steven Rostedt
2026-10-20 19:29   ` Ricardo B. Marlière (SUSE)
2026-10-20 19:34     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®