{"thread":{"id":"65319","subject":"[PATCH] bisect: use selected alternate terms in status output","startedAt":"2026-03-21T01:13:56Z","lastAt":"2026-03-21T05:02:38Z","messageCount":3,"participants":["Jonas Rebmann","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"539583","messageId":"20260320-bisect-terms-v1-1-c30c9540542a@schlaraffenlan.de","threadId":"65319","inReplyTo":null,"subject":"[PATCH] bisect: use selected alternate terms in status output","fromName":"Jonas Rebmann","fromEmail":"kernel@schlaraffenlan.de","sentAt":"2026-03-20T18:07:52Z","receivedAt":"2026-03-21T01:13:56Z","isPatch":true,"sender":{"key":"kernel@schlaraffenlan.de","avatar":null},"body":"Alternate bisect terms are helpful when the terms \"good\" and \"bad\" are\nconfusing such as when bisecting for the resolution of an issue (the\nfirst good commit) rather than the introduction of a regression. If\nalternate terms are chosen, the terms \"good\" and \"bad\" should not be\nused in git's output to avoid confusion.\n\nAn old/new bisect should end with\n$ git bisect old\n[sha] is the first new commit\n\nnot with\n$ git bisect old\n[sha] is the first bad commit\n\nUsing hardcoded good/bad vocabulary can give confusion about what action\nis required:\n\n  status: waiting for bad commit, 1 good commit known\n  $ git bisect bad\n  error: Invalid command: you're currently in a new/old bisect\n  fatal: unknown command: 'bad'\n\nTo avoid confusion, use alternate terms consistently across the bisect\noutput.\n\nSigned-off-by: Jonas Rebmann <kernel@schlaraffenlan.de>\n---\n builtin/bisect.c | 23 +++++++++++++----------\n 1 file changed, 13 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin/bisect.c b/builtin/bisect.c\nindex 4520e585d0..ee6a2c83b8 100644\n--- a/builtin/bisect.c\n+++ b/builtin/bisect.c\n@@ -465,13 +465,16 @@ static void bisect_print_status(const struct bisect_terms *terms)\n \t\treturn;\n \n \tif (!state.nr_good && !state.nr_bad)\n-\t\tbisect_log_printf(_(\"status: waiting for both good and bad commits\\n\"));\n+\t\tbisect_log_printf(_(\"status: waiting for both %s and %s commits\\n\"),\n+\t\t\t\t  terms->term_good, terms->term_bad);\n \telse if (state.nr_good)\n-\t\tbisect_log_printf(Q_(\"status: waiting for bad commit, %d good commit known\\n\",\n-\t\t\t\t     \"status: waiting for bad commit, %d good commits known\\n\",\n-\t\t\t\t     state.nr_good), state.nr_good);\n+\t\tbisect_log_printf(Q_(\"status: waiting for %s commit, %d %s commit known\\n\",\n+\t\t\t\t     \"status: waiting for %s commit, %d %s commits known\\n\",\n+\t\t\t\t     state.nr_good),\n+\t\t\t\t  terms->term_bad, state.nr_good, terms->term_good);\n \telse\n-\t\tbisect_log_printf(_(\"status: waiting for good commit(s), bad commit known\\n\"));\n+\t\tbisect_log_printf(_(\"status: waiting for %s commit(s), %s commit known\\n\"),\n+\t\t\t\t  terms->term_good, terms->term_bad);\n }\n \n static int bisect_next_check(const struct bisect_terms *terms,\n@@ -1262,14 +1265,14 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv)\n \t\t\tint rc = verify_good(terms, command.buf);\n \t\t\tis_first_run = 0;\n \t\t\tif (rc < 0 || 128 <= rc) {\n-\t\t\t\terror(_(\"unable to verify %s on good\"\n-\t\t\t\t\t\" revision\"), command.buf);\n+\t\t\t\terror(_(\"unable to verify %s on %s\"\n+\t\t\t\t\t\" revision\"), command.buf, terms->term_good);\n \t\t\t\tres = BISECT_FAILED;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tif (rc == res) {\n-\t\t\t\terror(_(\"bogus exit code %d for good revision\"),\n-\t\t\t\t      rc);\n+\t\t\t\terror(_(\"bogus exit code %d for %s revision\"),\n+\t\t\t\t      rc, terms->term_good);\n \t\t\t\tres = BISECT_FAILED;\n \t\t\t\tbreak;\n \t\t\t}\n@@ -1314,7 +1317,7 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv)\n \t\t\tputs(_(\"bisect run success\"));\n \t\t\tres = BISECT_OK;\n \t\t} else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) {\n-\t\t\tputs(_(\"bisect found first bad commit\"));\n+\t\t\tprintf(_(\"bisect found first %s commit\\n\"), terms->term_bad);\n \t\t\tres = BISECT_OK;\n \t\t} else if (res) {\n \t\t\terror(_(\"bisect run failed: 'git bisect %s'\"\n\n---\nbase-commit: 1eceb487f285f1efa78465e6208770318f9f4892\nchange-id: 20260320-bisect-terms-76036676769c\n\nBest regards,\n-- \nJonas Rebmann <kernel@schlaraffenlan.de>\n\n"},{"id":"539589","messageId":"xmqqfr5tdbpc.fsf@gitster.g","threadId":"65319","inReplyTo":"20260320-bisect-terms-v1-1-c30c9540542a@schlaraffenlan.de","subject":"Re: [PATCH] bisect: use selected alternate terms in status output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-21T04:54:23Z","receivedAt":"2026-03-21T04:54:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonas Rebmann <kernel@schlaraffenlan.de> writes:\n\n> Alternate bisect terms are helpful when the terms \"good\" and \"bad\" are\n> confusing such as when bisecting for the resolution of an issue (the\n> first good commit) rather than the introduction of a regression. If\n> alternate terms are chosen, the terms \"good\" and \"bad\" should not be\n> used in git's output to avoid confusion.\n>\n> An old/new bisect should end with\n> $ git bisect old\n> [sha] is the first new commit\n>\n> not with\n> $ git bisect old\n> [sha] is the first bad commit\n\nWell articulated.\n\nTo clarify the status quo, you may probably want to describe what\nthese custom terms are currently used for.  As far as I can tell,\n\n * \"git bisect <good>/<bad>\" that marks the commit you just tested\n   accepts the custom term for *input*.\n\n * refs/bisect/<good>-<commit-object-name> (many good commits) and\n   refs/bisect/<bad> (a commit that is the oldest bad one currently\n   known) use the custom terms, which would show in \"git bisect\n   visualize\" for *output*\n\n * \"X is the first <bad> commit\" report should but currently does\n   not use the custom term, which you are addressing in this patch.\n\nDo we use good/bad or custom terms anywhere else?  There aren't too\nmany, so it would be good to be exhaustive in the proposed log\nmessage here.\n\n> Using hardcoded good/bad vocabulary can give confusion about what action\n> is required:\n\n\"can give confusion\" -> \"can cause confusion\", or, \"can be confusing\".\n\n>   status: waiting for bad commit, 1 good commit known\n>   $ git bisect bad\n>   error: Invalid command: you're currently in a new/old bisect\n>   fatal: unknown command: 'bad'\n>\n> To avoid confusion, use alternate terms consistently across the bisect\n> output.\n\nSounds good.\n\n> Signed-off-by: Jonas Rebmann <kernel@schlaraffenlan.de>\n> ---\n>  builtin/bisect.c | 23 +++++++++++++----------\n>  1 file changed, 13 insertions(+), 10 deletions(-)\n\nThe changes in the patch look good (but it is hard to tell if this\nis exhaustive, or there are places where good/bad are still used).\n\nThanks.\n\n\n> diff --git a/builtin/bisect.c b/builtin/bisect.c\n> index 4520e585d0..ee6a2c83b8 100644\n> --- a/builtin/bisect.c\n> +++ b/builtin/bisect.c\n> @@ -465,13 +465,16 @@ static void bisect_print_status(const struct bisect_terms *terms)\n>  \t\treturn;\n>  \n>  \tif (!state.nr_good && !state.nr_bad)\n> -\t\tbisect_log_printf(_(\"status: waiting for both good and bad commits\\n\"));\n> +\t\tbisect_log_printf(_(\"status: waiting for both %s and %s commits\\n\"),\n> +\t\t\t\t  terms->term_good, terms->term_bad);\n>  \telse if (state.nr_good)\n> -\t\tbisect_log_printf(Q_(\"status: waiting for bad commit, %d good commit known\\n\",\n> -\t\t\t\t     \"status: waiting for bad commit, %d good commits known\\n\",\n> -\t\t\t\t     state.nr_good), state.nr_good);\n> +\t\tbisect_log_printf(Q_(\"status: waiting for %s commit, %d %s commit known\\n\",\n> +\t\t\t\t     \"status: waiting for %s commit, %d %s commits known\\n\",\n> +\t\t\t\t     state.nr_good),\n> +\t\t\t\t  terms->term_bad, state.nr_good, terms->term_good);\n>  \telse\n> -\t\tbisect_log_printf(_(\"status: waiting for good commit(s), bad commit known\\n\"));\n> +\t\tbisect_log_printf(_(\"status: waiting for %s commit(s), %s commit known\\n\"),\n> +\t\t\t\t  terms->term_good, terms->term_bad);\n>  }\n>  \n>  static int bisect_next_check(const struct bisect_terms *terms,\n> @@ -1262,14 +1265,14 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv)\n>  \t\t\tint rc = verify_good(terms, command.buf);\n>  \t\t\tis_first_run = 0;\n>  \t\t\tif (rc < 0 || 128 <= rc) {\n> -\t\t\t\terror(_(\"unable to verify %s on good\"\n> -\t\t\t\t\t\" revision\"), command.buf);\n> +\t\t\t\terror(_(\"unable to verify %s on %s\"\n> +\t\t\t\t\t\" revision\"), command.buf, terms->term_good);\n>  \t\t\t\tres = BISECT_FAILED;\n>  \t\t\t\tbreak;\n>  \t\t\t}\n>  \t\t\tif (rc == res) {\n> -\t\t\t\terror(_(\"bogus exit code %d for good revision\"),\n> -\t\t\t\t      rc);\n> +\t\t\t\terror(_(\"bogus exit code %d for %s revision\"),\n> +\t\t\t\t      rc, terms->term_good);\n>  \t\t\t\tres = BISECT_FAILED;\n>  \t\t\t\tbreak;\n>  \t\t\t}\n> @@ -1314,7 +1317,7 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv)\n>  \t\t\tputs(_(\"bisect run success\"));\n>  \t\t\tres = BISECT_OK;\n>  \t\t} else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) {\n> -\t\t\tputs(_(\"bisect found first bad commit\"));\n> +\t\t\tprintf(_(\"bisect found first %s commit\\n\"), terms->term_bad);\n>  \t\t\tres = BISECT_OK;\n>  \t\t} else if (res) {\n>  \t\t\terror(_(\"bisect run failed: 'git bisect %s'\"\n>\n> ---\n> base-commit: 1eceb487f285f1efa78465e6208770318f9f4892\n> change-id: 20260320-bisect-terms-76036676769c\n>\n> Best regards,\n"},{"id":"539591","messageId":"xmqq7br5dbbo.fsf@gitster.g","threadId":"65319","inReplyTo":"xmqqfr5tdbpc.fsf@gitster.g","subject":"Re: [PATCH] bisect: use selected alternate terms in status output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-21T05:02:35Z","receivedAt":"2026-03-21T05:02:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Sounds good.\n>\n>> Signed-off-by: Jonas Rebmann <kernel@schlaraffenlan.de>\n>> ---\n>>  builtin/bisect.c | 23 +++++++++++++----------\n>>  1 file changed, 13 insertions(+), 10 deletions(-)\n>\n> The changes in the patch look good (but it is hard to tell if this\n> is exhaustive, or there are places where good/bad are still used).\n>\n> Thanks.\n\nOne thing I forgot to mention.  This lacks tests to protect the\nfeature against future breakage.\n\nThanks.\n"}]}