git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git bisect bad @

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 9, 2022, 19:54 UTC
Message-ID
<xmqqilus3ctf.fsf@gitster.g>
In-Reply-To
<1edfc6ff-4db8-447f-9eb7-85843258a286@www.fastmail.com>
"Ramkumar Ramachandra" <r@artagnon.com> writes:
Show 11 quoted lines
> I bumped my head thrice (yes, thrice!) by using `git bisect bad
> @`. The error displayed to me at the end of one run was the
> following:
>
>   Cela signifie que le bogue été corrigé entre ea3595845f5013359b2ba4402f948e454350a74c et 
>   [2e100906d5d0c276335665ffefedb906d21165ca ea3595845f5013359b2ba4402f948e454350a74c].
>   error: la bissection a échoué : 'git bisect--helper --bisect-state (null)' a retourné le code erreur -3
>
> After the third attempt, I realized: ah yes, computers aren't magic; git-bisect.sh is basically a stupid shell script (no offense!).
>
> Perhaps git-bisect.sh can ref-parse the arguments before starting its work? Agreed, none of the refs are expected to change during its operation, with the exception of the sneaky `@`.

As far as I know, the first thing it does to the command line is to turn them into concrete object names. I do not doubt that you had some problem, and I do not doubt that it was with "git bisect bad" with arguments, but I somehow doubt your diagnosis is correct.

In git-bisect.sh, we see:
        case "$#" in
        0)
                usage ;;
        *)
                cmd="$1"
                get_terms
                shift
                case "$cmd" in
                help)
                        git bisect -h ;;
                start)
                        git bisect--helper --bisect-start "$@" ;;
                bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD")
                        git bisect--helper --bisect-state "$cmd" "$@" ;;

So "git bisect--helper --bisect-state bad HEAD" is run in your case. Now in builtin/bisect--helper.c::bisect_state(), here is what happpens:

 * argc is checked to make sure at least one arg is there to give
   the 'state' (i.e. good or bad)
 * if there is no arg, the revision that is marked as the given
   'state' defaults to "HEAD"
 * each remaining arg is first passed to get_oid(), turned into a
   commit object.

All of the above should happen way before bisect_next_all() calls check_good_are_ancestors_of_bad(), that eventually calls handle_bad_merge_base() where your "The merge base X is bad" error message comes from.

So, perhaps there is something you are not quite telling us, e.g. your problem happens during a replay an old bisect session after HEAD has moved---if we had a bug that records symbolic object names in the replay log, it may produce a nonsense result in such a case (but I doubt that is the case---I am reasonably sure that the log also records concrete object names)?

Perhaps you can try again with a better minimum reproducible example?

Thanks.
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 2 of 31 in “git bisect bad @”
  1. Ramkumar RamachandraJan 9, 2022
  2. Junio C HamanoJan 9, 2022
  3. Ramkumar RamachandraJan 9, 2022
  4. bisect: report actual bisect_state() argument on errorRené Scharfe, Jan 10, 2022
  5. Ramkumar RamachandraJan 10, 2022
  6. Junio C HamanoJan 10, 2022
  7. Ramkumar RamachandraJan 10, 2022
  8. René ScharfeJan 12, 2022
  9. Junio C HamanoJan 12, 2022
  10. René ScharfeJan 12, 2022
  11. René ScharfeJan 13, 2022
  12. Ramkumar RamachandraJan 13, 2022
  13. Christian CouderJan 13, 2022
  14. René ScharfeJan 13, 2022
  15. Ramkumar RamachandraJan 13, 2022
  16. René ScharfeJan 14, 2022
  17. Ramkumar RamachandraJan 14, 2022
  18. René ScharfeJan 18, 2022
  19. Junio C HamanoJan 14, 2022
  20. Junio C HamanoJan 13, 2022
  21. 1/4 bisect--helper: report actual bisect_state() argument on errorRené Scharfe, Jan 18, 2022
  22. 2/4 bisect--helper: release strbuf and strvec on run errorRené Scharfe, Jan 18, 2022
  23. 3/4 bisect: document run behavior with exit codes 126 and 127René Scharfe, Jan 18, 2022
  24. 4/4 bisect--helper: double-check run command on exit code 126 and 127René Scharfe, Jan 18, 2022
  25. Junio C HamanoJan 19, 2022
  26. René ScharfeJan 19, 2022
  27. Junio C HamanoFeb 4, 2022
  28. René ScharfeFeb 4, 2022
  29. Ramkumar RamachandraFeb 4, 2022
  30. Junio C HamanoFeb 4, 2022
  31. Ramkumar RamachandraFeb 4, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.