Bug 2139883 - "git bisect run" strips "--log" from the list of arguments
Summary: "git bisect run" strips "--log" from the list of arguments
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: git
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Todd Zullinger
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-03 17:13 UTC by Lukáš Doktor
Modified: 2023-02-03 17:27 UTC (History)
7 users (show)

Fixed In Version: git-2.39.1-1.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-02-03 17:27:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lukáš Doktor 2022-11-03 17:13:06 UTC
Description of problem:
When running "git bisect run ./myscript --log arg" only "./myscript arg" is executed.

Version-Release number of selected component (if applicable):
git-2.38.1-1.fc36.x86_64

How reproducible:
Always

Steps to Reproduce:
1. git bisect start BAD GOOD
2. git bisect run ./myscript arg1 --log arg2 --log -- arg3 --log arg4

Actual results:
running  './myscript' 'arg1' 'arg2' '--' 'arg3' '--log' 'arg4'

Expected results:
running ./myscript arg1 --log arg2 --log -- arg3 --log arg4

Additional info:
The expected output was gathered on RHEL9 using git-2.31.1-2.el9.2.x86_64

Comment 1 Lukáš Doktor 2022-11-03 17:43:19 UTC
I tested:

git-2.35.1-1.fc36.x86_64 - bad
git-2.34.1-1.fc35.x86_64 - bad
git-2.33.0-1.fc36.x86_64 - good
git-2.32.0-1.fc36.2.x86_64 - good
git-2.31.1-3.fc35.1.x86_64 - good

Comment 2 Todd Zullinger 2022-11-03 20:59:45 UTC
Thanks Lukáš.  I would guess this is related to the conversion of git bisect run from shell to C which was released in 2.34.0.  In particular, d1bbbe45df (bisect--helper: reimplement `bisect_run` shell function in C, 2021-09-13) stands out as a possible suspect.

I'm not sure if this would be considered a bug or not by upstream.  If you're able, I would suggest asking git.org (no subscription required).  If it's not expected behavior, someone who knows the area well might provide a patch.

I think you may be able to avoid this by using sh -c 'command' to call the run command:

    git bisect run sh -c './myscript arg1 --log arg2 --log -- arg3 --log arg4'

Comment 3 Todd Zullinger 2022-11-04 15:25:00 UTC
Thanks for posting that to the git list.  I'm glad to see it's led to a lively discussion and several different patch series to fix things.  The folks on the git list are fantastic! :)

I'll keep any eye on that thread and see what gets merged.  Then we can see whether we should apply it to 2.38.x or wait a bit for 2.39.0.

Comment 4 Todd Zullinger 2023-02-03 17:27:38 UTC
This was fixed in git-2.39.0, which was pushed to Fedora 36 a few weeks ago.


Note You need to log in before you can comment on or make changes to this bug.