From patchwork Thu Dec 15 09:47:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13074049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B90A5C4332F for ; Thu, 15 Dec 2022 09:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230179AbiLOJtL (ORCPT ); Thu, 15 Dec 2022 04:49:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbiLOJsV (ORCPT ); Thu, 15 Dec 2022 04:48:21 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 907681573E for ; Thu, 15 Dec 2022 01:47:55 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id r26so26228326edc.10 for ; Thu, 15 Dec 2022 01:47:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KnI2cH4O3a3tNirB2lYT/fFM72fZeXH2zRp5TYQlzaM=; b=fsekMkKrU16k7NQs3tStawLOEXF9mXLjW9pgU7uaFOOSgR3FIEnTlJbhPVTqElPS06 XvPg2dGhhmGea/D8y1g91ra00P2U3ectBeLZQT4ynVidaNf1bM2Q+y21LYq3o7CO/jAZ T/Cyl69uXEFGUhpmZzhtyDLNPdQgdeyant0/lU49AWg+HgvoAacZ97yk9LqH+SuYF8Sy 5GaKSWpL4B9B5CBOMkE5sdmYbwIfFzVthuAolOoQQXfYMGsOryt2fXIDA/UT9+8xa3xX UJTg9eOW8bnuS7oI1wGsxpMJFcPbZRXTG5ipTqHfoFeJN0KfKjP2E5cYyb2wnLuLoX9s X4WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KnI2cH4O3a3tNirB2lYT/fFM72fZeXH2zRp5TYQlzaM=; b=WX+C01D4XI7kNj3NZ76kti9hPPezIvpBrQrNgOQzrRIDwYS58LqzU/dVz1fu5zQWEG pHsPTLVwp52AbJhWQlLkdoKa0feOxbETzrRFzrzsY8hjVvYIDK8kiX6FPxaG1qjN+arK Vctm1ZVXS20Ai6tkFLBv2bbJA44cKL3sHCL//9FjQ5L/hg9Pg7C8u3ovJlasqwVMfrLc cBsz37PvNVdROf0HHpDrowh4vMvbOTv59EtfMxJ8P/oN9zpNXJ/EDMbB0JBkmgCOBAHF VB9kK2ZjToL/NnbYN6+ed83kVwVZnMClDZw6kDVWZU6qFAvXo0buv/NeFZe78oiUK0iQ iIag== X-Gm-Message-State: ANoB5pkCk4NBqj38PJzhQPZFUmqsu2j54AIW/NFA1wZFxLJi5xQ7k44U 1x5uVlUTgdBQTyiZh/A4A3t7mcP3XhF2BQ== X-Google-Smtp-Source: AA0mqf5o3AcKb8g3RwX3pBFLu8tQOU63SdGYK6Fe20iL74b0kW2+r2EfEtrkICWmvHtOcPnKCWIduw== X-Received: by 2002:aa7:c40c:0:b0:46c:a1f7:d9c5 with SMTP id j12-20020aa7c40c000000b0046ca1f7d9c5mr24945166edq.38.1671097673867; Thu, 15 Dec 2022 01:47:53 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id i15-20020a50fd0f000000b0046b4e0fae75sm7189155eds.40.2022.12.15.01.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 01:47:53 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , =?utf-8?b?xJBvw6BuIFRy?= =?utf-8?b?4bqnbiBDw7RuZyBEYW5o?= , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH 1/6] bisect--helper: simplify exit code computation Date: Thu, 15 Dec 2022 10:47:44 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.rc2.1048.g0e5493b8d5b In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin We _already_ have a function to determine whether a given `enum bisect_error` value is non-zero but still _actually_ indicates success. Let's use it instead of duplicating the logic. Signed-off-by: Johannes Schindelin Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/bisect.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/builtin/bisect.c b/builtin/bisect.c index cc9483e8515..09505fc4dce 100644 --- a/builtin/bisect.c +++ b/builtin/bisect.c @@ -1440,12 +1440,5 @@ int cmd_bisect(int argc, const char **argv, const char *prefix) res = fn(argc, argv, prefix); } - /* - * Handle early success - * From check_merge_bases > check_good_are_ancestors_of_bad > bisect_next_all - */ - if ((res == BISECT_INTERNAL_SUCCESS_MERGE_BASE) || (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND)) - res = BISECT_OK; - - return -res; + return is_bisect_success(res) ? 0 : -res; } From patchwork Thu Dec 15 09:47:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13074050 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4308C4332F for ; Thu, 15 Dec 2022 09:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230181AbiLOJtO (ORCPT ); Thu, 15 Dec 2022 04:49:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbiLOJsV (ORCPT ); Thu, 15 Dec 2022 04:48:21 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 766FB1A210 for ; Thu, 15 Dec 2022 01:47:56 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id i15so26259964edf.2 for ; Thu, 15 Dec 2022 01:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8g14qzqOQmrzhPKkA+Q/2ZjyiCJPPVSjgnglTNRfBbQ=; b=j8lpTGNezTq2hl8559lT5gq+WBl2mu7BUPxpvUQX4DdC24nDWBxsKcaCdrdTUEJkQW tiRQ7h2AxEG2c3bw5lsDVFuvd10DnSWCP3Q1YVV4auTFFDJ5sr8x1PxPBBddeQGWvUiV bV1igD05uEuKkzNV9tuDAf7cqNmJcaGz7/jo1TypNbQPtdOiMLvqSkb2u/Y0buRowX/q j0x/AEx8ZgmYBbJqUU714LgEdXGsyU/hqMHtVIRIxWfzTp2k9cS8hnLe4lw8DKg70sQG zg673gDpiqD58xr4fl0Uv7zKgV/BHGK+ERttMwn4JcxK83xWuNPBBe92KvrW5xSNREbG x8SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8g14qzqOQmrzhPKkA+Q/2ZjyiCJPPVSjgnglTNRfBbQ=; b=dXZv+iIPqIYFUHubc+errYCbFk05t2f/sE/pEgblWe9xVAqty2stWHraTyZencvByu TsfeLRCxD0+mGihxHDTFe2iBybAa2epHWpqdFNw/7qpysgdorWmGQnA5K+xLa4UuBi7X mnxRV9HMn5Aycd0VV2zCbZlYttTitMYejSjOs4r+b7ePDu1Ps7qYHyyd+NPDYydvioen UrN2uHBBODp7BhzYXsUgH5aXe+/9Q5gVQ8YkylJvgSkiao6TD2UxWS9vi0QllwGMo5Tr vfxu05LLRpgEUlesUSwibyA5ryamzT8sKu1G9/986Vy+ltDRucEdl95d3nQK+wcdHmmp gB+w== X-Gm-Message-State: AFqh2kpVTwxz9EPTqg71+sMfpatm2XxuX++UmAoziYU8908euFd9oK1m +9+2nklJBOqCJDSxQoxKrbGQ1FJcEXBE6A== X-Google-Smtp-Source: AMrXdXszuI8UBpDwaiU7mY5z2eRibIdDR5ICa6JEQ40mhjhyTebJgM3onKlTt5B1ySJ082TcQn3zOg== X-Received: by 2002:aa7:d384:0:b0:472:7c75:832 with SMTP id x4-20020aa7d384000000b004727c750832mr4710708edq.16.1671097674724; Thu, 15 Dec 2022 01:47:54 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id i15-20020a50fd0f000000b0046b4e0fae75sm7189155eds.40.2022.12.15.01.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 01:47:54 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , =?utf-8?b?xJBvw6BuIFRy?= =?utf-8?b?4bqnbiBDw7RuZyBEYW5o?= , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Johannes Schindelin Subject: [PATCH 2/6] bisect--helper: make the order consistently `argc, argv` Date: Thu, 15 Dec 2022 10:47:45 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.rc2.1048.g0e5493b8d5b In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In C, the natural order is for `argc` to come before `argv` by virtue of the `main()` function declaring the parameters in precisely that order. It is confusing & distracting, then, when readers familiar with the C language read code where that order is switched around. Let's just change the order and avoid that type of developer friction. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Johannes Schindelin --- builtin/bisect.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/builtin/bisect.c b/builtin/bisect.c index 09505fc4dce..9fc8db06944 100644 --- a/builtin/bisect.c +++ b/builtin/bisect.c @@ -678,7 +678,8 @@ static enum bisect_error bisect_auto_next(struct bisect_terms *terms, const char return bisect_next(terms, prefix); } -static enum bisect_error bisect_start(struct bisect_terms *terms, const char **argv, int argc) +static enum bisect_error bisect_start(struct bisect_terms *terms, int argc, + const char **argv) { int no_checkout = 0; int first_parent_only = 0; @@ -908,13 +909,13 @@ static int bisect_autostart(struct bisect_terms *terms) yesno = git_prompt(_("Do you want me to do it for you " "[Y/n]? "), PROMPT_ECHO); res = tolower(*yesno) == 'n' ? - -1 : bisect_start(terms, empty_strvec, 0); + -1 : bisect_start(terms, 0, empty_strvec); return res; } -static enum bisect_error bisect_state(struct bisect_terms *terms, const char **argv, - int argc) +static enum bisect_error bisect_state(struct bisect_terms *terms, int argc, + const char **argv) { const char *state; int i, verify_expected = 1; @@ -1033,7 +1034,7 @@ static int process_replay_line(struct bisect_terms *terms, struct strbuf *line) struct strvec argv = STRVEC_INIT; int res; sq_dequote_to_strvec(rev, &argv); - res = bisect_start(terms, argv.v, argv.nr); + res = bisect_start(terms, argv.nr, argv.v); strvec_clear(&argv); return res; } @@ -1083,7 +1084,8 @@ static enum bisect_error bisect_replay(struct bisect_terms *terms, const char *f return bisect_auto_next(terms, NULL); } -static enum bisect_error bisect_skip(struct bisect_terms *terms, const char **argv, int argc) +static enum bisect_error bisect_skip(struct bisect_terms *terms, int argc, + const char **argv) { int i; enum bisect_error res; @@ -1113,13 +1115,14 @@ static enum bisect_error bisect_skip(struct bisect_terms *terms, const char **ar strvec_push(&argv_state, argv[i]); } } - res = bisect_state(terms, argv_state.v, argv_state.nr); + res = bisect_state(terms, argv_state.nr, argv_state.v); strvec_clear(&argv_state); return res; } -static int bisect_visualize(struct bisect_terms *terms, const char **argv, int argc) +static int bisect_visualize(struct bisect_terms *terms, int argc, + const char **argv) { struct child_process cmd = CHILD_PROCESS_INIT; struct strbuf sb = STRBUF_INIT; @@ -1202,7 +1205,7 @@ static int verify_good(const struct bisect_terms *terms, const char *command) return rc; } -static int bisect_run(struct bisect_terms *terms, const char **argv, int argc) +static int bisect_run(struct bisect_terms *terms, int argc, const char **argv) { int res = BISECT_OK; struct strbuf command = STRBUF_INIT; @@ -1271,7 +1274,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc) saved_stdout = dup(1); dup2(temporary_stdout_fd, 1); - res = bisect_state(terms, &new_state, 1); + res = bisect_state(terms, 1, &new_state); fflush(stdout); dup2(saved_stdout, 1); @@ -1328,7 +1331,7 @@ static int cmd_bisect__start(int argc, const char **argv, const char *prefix UNU struct bisect_terms terms = { 0 }; set_terms(&terms, "bad", "good"); - res = bisect_start(&terms, argv, argc); + res = bisect_start(&terms, argc, argv); free_terms(&terms); return res; } @@ -1372,7 +1375,7 @@ static int cmd_bisect__skip(int argc, const char **argv, const char *prefix UNUS set_terms(&terms, "bad", "good"); get_terms(&terms); - res = bisect_skip(&terms, argv, argc); + res = bisect_skip(&terms, argc, argv); free_terms(&terms); return res; } @@ -1383,7 +1386,7 @@ static int cmd_bisect__visualize(int argc, const char **argv, const char *prefix struct bisect_terms terms = { 0 }; get_terms(&terms); - res = bisect_visualize(&terms, argv, argc); + res = bisect_visualize(&terms, argc, argv); free_terms(&terms); return res; } @@ -1396,7 +1399,7 @@ static int cmd_bisect__run(int argc, const char **argv, const char *prefix UNUSE if (!argc) return error(_("'%s' failed: no command provided."), "git bisect run"); get_terms(&terms); - res = bisect_run(&terms, argv, argc); + res = bisect_run(&terms, argc, argv); free_terms(&terms); return res; } @@ -1432,7 +1435,7 @@ int cmd_bisect(int argc, const char **argv, const char *prefix) if (check_and_set_terms(&terms, argv[0])) usage_msg_optf(_("unknown command: '%s'"), git_bisect_usage, options, argv[0]); - res = bisect_state(&terms, argv, argc); + res = bisect_state(&terms, argc, argv); free_terms(&terms); } else { argc--; From patchwork Thu Dec 15 09:47:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13074051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4A2EC4167B for ; Thu, 15 Dec 2022 09:49:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbiLOJtP (ORCPT ); Thu, 15 Dec 2022 04:49:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230233AbiLOJsW (ORCPT ); Thu, 15 Dec 2022 04:48:22 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56B1B1BEA0 for ; Thu, 15 Dec 2022 01:47:57 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id c66so26251320edf.5 for ; Thu, 15 Dec 2022 01:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rf43tipxSVafZ6e68cmXdyGjRFRmawZcs5en6ZDQI8o=; b=HpguxYzZJpnwevMApOnicAwyAxsI+QniTSbCLDqhvnhTAbKbyqd4MRhHVNsNnN+whx KkwgVh5f9m21laNWeT0TbicVvKa4FRRVYbV0DEpv3wRbx/uwXYptdI3jocloiRhMEXaH Y4AfMsTEfSYnZ2gpQPIIkCw8XR9px1UQT+0Q2WxT7lGpATecT8iRT4EpNyHLidPFj6iV 01QgFfSieBYprTgLBFGxBuSdIBJJRR7Dh1+A4lp/pBjYtxYiWJ+QdmPF0r5rfeZ1g+Wz mzp9emVEop/GMzUTc7wZJjaodR5TSfQGJgojI6rgMgonEU/kfbUl8/FV3MsKH2s6u7kd LBcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rf43tipxSVafZ6e68cmXdyGjRFRmawZcs5en6ZDQI8o=; b=EpUOw+RG0HymV8LG5JpZbJ4aAl+/r4uws2B2A/YeLxF0X0BwUgmGN4/EpA+CV0/eji ei9Ogx0CLLvO+OHGQSlX/AXD7e4RfTFMRUm+8di09seH69o7o9QpKKW+RjyGDDwFGdom 3KxRA1+dcbiEXGlHvEmijMGe/vWXDHKfwUPQ7emo25rVmX1oAD5C5fFZEY++VWHk0XdO bQzpSueg7Znwl16jo4UBpzCIfn1ojLUBwMb5eG9qL+ZelOsMIhEZsiPeWOguSZziy7fB v6LBKDTJnyoXDB0HqZ7YJqdHqMMK0RMOJXixZ2El+WAMWoTcknQiurNmgQZ9vSVK3pkX 8Ucg== X-Gm-Message-State: ANoB5pm0IpxFqa4D6E0iteXj/cDMNALGTniJqdNnd6UNWDSmOvfeYEqM SCZEJr+4MhRcOUp5mkFuxHnUuJ9bPqoTAQ== X-Google-Smtp-Source: AA0mqf4z1ItunovXCa5AKlhtq+cf0a+pdQxeD6ib+xGi584oDu3FtjZXk+czPoWFpR/4+pSTxowZdQ== X-Received: by 2002:a05:6402:540b:b0:461:75f1:9254 with SMTP id ev11-20020a056402540b00b0046175f19254mr23871225edb.2.1671097675578; Thu, 15 Dec 2022 01:47:55 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id i15-20020a50fd0f000000b0046b4e0fae75sm7189155eds.40.2022.12.15.01.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 01:47:54 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , =?utf-8?b?xJBvw6BuIFRy?= =?utf-8?b?4bqnbiBDw7RuZyBEYW5o?= , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH 3/6] bisect: verify that a bogus option won't try to start a bisection Date: Thu, 15 Dec 2022 10:47:46 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.rc2.1048.g0e5493b8d5b In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin We do not want `git bisect --bogus-option` to start a bisection. To verify that, we look for the tell-tale error message `You need to start by "git bisect start"` and fail if it was found. Signed-off-by: Johannes Schindelin Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t6030-bisect-porcelain.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index 98a72ff78a7..9e56b42b5da 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -1058,6 +1058,16 @@ test_expect_success 'bisect start with one term1 and term2' ' git bisect reset ' +test_expect_success 'bogus command does not start bisect' ' + git bisect reset && + test_must_fail git bisect --bisect-terms 1 2 2>out && + ! grep "You need to start" out && + test_must_fail git bisect --bisect-terms 2>out && + ! grep "You need to start" out && + grep "git bisect.*visualize" out && + git bisect reset +' + test_expect_success 'bisect replay with term1 and term2' ' git bisect replay log_to_replay.txt >bisect_result && grep "$HASH2 is the first term1 commit" bisect_result && From patchwork Thu Dec 15 09:47:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13074052 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8578C4332F for ; Thu, 15 Dec 2022 09:49:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230196AbiLOJtR (ORCPT ); Thu, 15 Dec 2022 04:49:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230014AbiLOJsX (ORCPT ); Thu, 15 Dec 2022 04:48:23 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3487A175B5 for ; Thu, 15 Dec 2022 01:47:58 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id z92so26282844ede.1 for ; Thu, 15 Dec 2022 01:47:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7oRSP9ylVY+u3I9qZWduucl7hj24t2hz/kVFpAbwKug=; b=P/J4UTaI6N22nHP+glGCLpVLxrSWTUxkCNHW557gWsrNR216pC5k7+FsGPlXYR/ryL 80HSq5hc98GK5Zw3egalxU++yP6c+UCFQjlTwM5FnZuX2Wu3VEOjVJbREVfgo+b/PjVW m3PLRJZraJZ+MWjo+HzzlKl1FN1N3NZjlmfjymuyMYITooyboDl9WZpuYTIDvM4d0t3V M4KLanPavLkSDkR+8xTKLJxv1hDf2ZCKLOpcfaD08IAfnz0IMXCsnMHa4jWVB9oxFuaV vt5+4PGow07u4GbujHlk1TvVEXoCJ6qw5+RepqSdZWcwR2UanpZBcn07gBBejDZEEh7s FTxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7oRSP9ylVY+u3I9qZWduucl7hj24t2hz/kVFpAbwKug=; b=UAj/kcWdpdJdfkxUe+Etw3gIkfDH12VyHxoGNVmsIT3NovnnVmmff6bx7lkI5zIs3Q 6Cc9uIkw/8Nwp6OuzhaErEkyM90H8zBIf7caHK9APcfpY2AqyFK+FfQ33MwoLEoJRlqm QlyDbK+bOnXhHszR2lzEMn9Pkj3uXvIt2tsJNpsJe8tmBKDOzxzIQsu2qWvBmEHvVRFw 7vU1deUYWcMN5b/ZHxl63vrpRJAZrCbn1nBYBkphWOMST9lFAlmiuTsD0KQB0jCLxITq hYKkiytIYhgX3Lwd5N6K/bz8+mUxHwX4wpuMwj+1zUNBYNONjXNXC+/wCGiCf3PVKdNG YOJw== X-Gm-Message-State: ANoB5pmLWm9psRZoT6bKhbUudpil3BRrmbNe+XGIKVUqFvb1SbHoD1fJ T6HUwvG4qYlyIWKAgntFsK+eB3aJIZHxwg== X-Google-Smtp-Source: AA0mqf5lX4skORTyHmELMBPFeN9+ycgD/Q1qUS8PDw+m6WAczrN36+yRTPnL5xynYkzx0MzXm23ZWw== X-Received: by 2002:a05:6402:500c:b0:45c:835c:c6f4 with SMTP id p12-20020a056402500c00b0045c835cc6f4mr26274314eda.37.1671097676483; Thu, 15 Dec 2022 01:47:56 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id i15-20020a50fd0f000000b0046b4e0fae75sm7189155eds.40.2022.12.15.01.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 01:47:55 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , =?utf-8?b?xJBvw6BuIFRy?= =?utf-8?b?4bqnbiBDw7RuZyBEYW5o?= , Johannes Schindelin , Elijah Newren , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFy?= =?utf-8?b?bWFzb24=?= Subject: [PATCH 4/6] bisect run: fix the error message Date: Thu, 15 Dec 2022 10:47:47 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.rc2.1048.g0e5493b8d5b In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin In d1bbbe45df8 (bisect--helper: reimplement `bisect_run` shell function in C, 2021-09-13), we ported the `bisect run` subcommand to C, including the part that prints out an error message when the implicit `git bisect bad` or `git bisect good` failed. However, the error message was supposed to print out whether the state was "good" or "bad", but used a bogus (because non-populated) `args` variable for it. This was fixed in 80c2e9657f2 (bisect--helper: report actual bisect_state() argument on error, 2022-01-18), but the error message still talks about `bisect--helper`, which is an implementation detail that should not concern end users. Fix that, and add a regression test to ensure that the intended form of the error message. Helped-by: Elijah Newren Signed-off-by: Johannes Schindelin Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/bisect.c | 2 +- t/t6030-bisect-porcelain.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/builtin/bisect.c b/builtin/bisect.c index 9fc8db06944..0786ebf4012 100644 --- a/builtin/bisect.c +++ b/builtin/bisect.c @@ -1292,7 +1292,7 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv) puts(_("bisect found first bad commit")); res = BISECT_OK; } else if (res) { - error(_("bisect run failed: 'bisect-state %s'" + error(_("bisect run failed: 'git bisect %s'" " exited with error code %d"), new_state, res); } else { continue; diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index 9e56b42b5da..0a62ea2b3ce 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -1221,4 +1221,14 @@ test_expect_success 'bisect state output with bad commit' ' grep -F "waiting for good commit(s), bad commit known" output ' +test_expect_success 'verify correct error message' ' + git bisect reset && + git bisect start $HASH4 $HASH1 && + write_script test_script.sh <<-\EOF && + rm .git/BISECT* + EOF + test_must_fail git bisect run ./test_script.sh 2>error && + grep "git bisect good.*exited with error code" error +' + test_done From patchwork Thu Dec 15 09:47:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13074053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04063C4332F for ; Thu, 15 Dec 2022 09:49:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbiLOJtV (ORCPT ); Thu, 15 Dec 2022 04:49:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbiLOJsY (ORCPT ); Thu, 15 Dec 2022 04:48:24 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6455654346 for ; Thu, 15 Dec 2022 01:47:59 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id c66so26251441edf.5 for ; Thu, 15 Dec 2022 01:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GHoa6tQ9uSFmkPS8uvYT2dfq6EvyqyL5umDCDYl2POU=; b=UhYlWAUtX6prQhdfIBmBZPoxZtP2R6MOL3zU9sF8vclNHqadBRHjCjB4vEpgfwl/70 cupWzLE0FxVwFut+RCpFVfy9d6UrJ7pnAe9089Rza78uot/b1/2hTmhCBtimAfWlWaDD f7YWG3wFv9vNSwImm5pIxhBg9znCkExvpIlR7Te6Dj2F9ObGNgvpLt5yUAhI4eZOr2RP EPK4SCcNU/t4YSEf9GE1GKo8MYBxMcppKlNUAIjkA59NJjq/QYqurZ17gfXBcktmNBLu +BgL+F7cDeNXMs6iKhmycpoYQfUB+aShJ8gib0fsg/GX+4hlsWlRMPXP/LCQzlsyDRVl J2kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GHoa6tQ9uSFmkPS8uvYT2dfq6EvyqyL5umDCDYl2POU=; b=asBaFihRPV0Canl4N9w4Rbn7FyE6IekYcuUEspQVCjlUzEYEzOZhVuYAvX2KkQ6p7d fx2DEKBqW1O20SyFva36E/yZkppATFDOFDeTutlD1TcsXxAF2W354vWdjbm1buvotsM9 UwyS0odqDWvo2b+46Q+derE235gCs/SV4ehdZHUNWWrRggV+pTWMnucetZlAq7gw82yl 72USymv6S3sBmYTYgJVkO0KDnEDHO1LjLV4P3spVJha3iCD+G/zC1X7gIoTdahtDY6wY kl4+sFSrY0yYKm+L3B2CKf2Y16jIt4WbnkSqyk7cV/aZFFPjjZZB2Gr9UdoySpYrjAhV DigQ== X-Gm-Message-State: ANoB5pnyihT/Vb5ohRsoxwLhCiIMGgyzb1QHEKm6iTpjo54E1+Ogl4Ci dib2APxbYafbeHsd86T9BdHxSSeQvt3lAA== X-Google-Smtp-Source: AA0mqf4vO1Y5vld6dJDSTRPJnEp00aYyMa7X7x2vUm9/8rIBsj1QPFQ++mjRCY2jl+FQbFJ9VX2Sfg== X-Received: by 2002:aa7:cb4d:0:b0:46c:7035:2f6d with SMTP id w13-20020aa7cb4d000000b0046c70352f6dmr25032407edt.38.1671097677336; Thu, 15 Dec 2022 01:47:57 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id i15-20020a50fd0f000000b0046b4e0fae75sm7189155eds.40.2022.12.15.01.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 01:47:56 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , =?utf-8?b?xJBvw6BuIFRy?= =?utf-8?b?4bqnbiBDw7RuZyBEYW5o?= , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH 5/6] bisect: remove Cogito-related code Date: Thu, 15 Dec 2022 10:47:48 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.rc2.1048.g0e5493b8d5b In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin Once upon a time, there was this idea that Git would not actually be a single coherent program, but rather a set of low-level programs that users cobble together via shell scripts, or develop high-level user interfaces for Git, or both. Cogito was such a high-level user interface, incidentally implemented via shell scripts that cobble together Git calls. It did turn out relatively quickly that Git would much rather provide a useful high-level user interface itself. As of April 19th, 2007, Cogito was therefore discontinued (see https://lore.kernel.org/git/20070419124648.GL4489@pasky.or.cz/). Nevertheless, for almost 15 years after that announcement, Git carried special code in `git bisect` to accommodate Cogito. Since it is beyond doubt that there are no more Cogito users, let's remove the last remnant of Cogito-accommodating code. Signed-off-by: Johannes Schindelin Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/bisect.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/builtin/bisect.c b/builtin/bisect.c index 0786ebf4012..73017402671 100644 --- a/builtin/bisect.c +++ b/builtin/bisect.c @@ -15,7 +15,6 @@ static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV") static GIT_PATH_FUNC(git_path_bisect_ancestors_ok, "BISECT_ANCESTORS_OK") static GIT_PATH_FUNC(git_path_bisect_start, "BISECT_START") static GIT_PATH_FUNC(git_path_bisect_log, "BISECT_LOG") -static GIT_PATH_FUNC(git_path_head_name, "head-name") static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES") static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT") static GIT_PATH_FUNC(git_path_bisect_run, "BISECT_RUN") @@ -808,13 +807,6 @@ static enum bisect_error bisect_start(struct bisect_terms *terms, int argc, strbuf_addstr(&start_head, oid_to_hex(&head_oid)); } else if (!get_oid(head, &head_oid) && skip_prefix(head, "refs/heads/", &head)) { - /* - * This error message should only be triggered by - * cogito usage, and cogito users should understand - * it relates to cg-seek. - */ - if (!is_empty_or_missing_file(git_path_head_name())) - return error(_("won't bisect on cg-seek'ed tree")); strbuf_addstr(&start_head, head); } else { return error(_("bad HEAD - strange symbolic ref")); From patchwork Thu Dec 15 09:47:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13074054 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DF3FC46467 for ; Thu, 15 Dec 2022 09:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230240AbiLOJtZ (ORCPT ); Thu, 15 Dec 2022 04:49:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbiLOJsY (ORCPT ); Thu, 15 Dec 2022 04:48:24 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29B8F16494 for ; Thu, 15 Dec 2022 01:48:00 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id a16so26251532edb.9 for ; Thu, 15 Dec 2022 01:48:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=olJQKL9TqTGrOrUL+vKYll7Hi9WvDdR4cxWu0HGyV+g=; b=o0gTZ63Pj6c3DCFbtIjzdx+zLOWB02qViuLvKf1n+1IEAFqi5MgGYKANRjmvWx6oOw OO/HVjS8f8UsgGX0v7IGrsZHB8Zvdtn92tGlNiTbRKaVh89+2hcUoLMbk+THhBcFHo3r G9NiFcy/SKJvpJq0C3ElKKHNCYxjI6vKSRoCXmXpx+moSYhEbyJ4Yu4TxFwojTBlD8Zc 9SRit/h7nM9EwdwnGyUKZUc+r18qSAeles3dEBvuTLWrdwOJEL+48NY9A/YKMXNpBlML SnKjrAMzN9sUOCeZR8Ov0N/rPJCHdEQjLDGSXm0ZUMOnlshO+H3o9QI5OiZPq9op8d0Y i/gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=olJQKL9TqTGrOrUL+vKYll7Hi9WvDdR4cxWu0HGyV+g=; b=KXU2QILCCFl6pudG6x4Kleq+xhUmRe5WtScA+ADITOmV6/r2oZNZRrt18+hIZC5uPY 86mx8LtoWu6NLx5YQQnkv8GAvCFmXD426qvFk/nmSlSJpF0hJOa5yNmRQe7j+Lrspb9m VwdArUmgwIQckQBgy+Eh6Zf2lo61t5LI9HDIo7OMUG4o3GVLxYlWSD/2FwupPfEP84RR 1KywNGXQch4VyT+BOhx4gE4vqRNvSuOSmGz32BCqwzDwS2KO58rHSDI+cW6ynNwl88iq xYeFwZDq2g1ckeN2NFL8s/Xq/aJ8UZxLskb6S6MRuPnjj5H9bb0LI9bryhYjOwb8OS8j uITw== X-Gm-Message-State: ANoB5pkoequR1ZEO+8GbpNl6VDBshMTOWOSkRGGBWsmhdeFkAUDRN+1r jLLDPPomoau6t7I/idHVdcXQ7lLR08zTKQ== X-Google-Smtp-Source: AA0mqf6I4wEYa3Vsqd4/kP4dmbqnp+kTPQAbTMTn4nOQQNITKmXb9OJtTtDmPzC8rzMD1/LaUZpzdQ== X-Received: by 2002:a05:6402:1cce:b0:470:49a2:ad7d with SMTP id ds14-20020a0564021cce00b0047049a2ad7dmr8077121edb.25.1671097678313; Thu, 15 Dec 2022 01:47:58 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id i15-20020a50fd0f000000b0046b4e0fae75sm7189155eds.40.2022.12.15.01.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 01:47:57 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , =?utf-8?b?xJBvw6BuIFRy?= =?utf-8?b?4bqnbiBDw7RuZyBEYW5o?= , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH 6/6] bisect: no longer try to clean up left-over `.git/head-name` files Date: Thu, 15 Dec 2022 10:47:49 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.rc2.1048.g0e5493b8d5b In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin As per the code comment, the `.git/head-name` files were cleaned up for backwards-compatibility: an old version of `git bisect` could have left them behind. Now, just how old would such a version be? As of 0f497e75f05 (Eliminate confusing "won't bisect on seeked tree" failure, 2008-02-23), `git bisect` does not write that file anymore. Which corresponds to Git v1.5.4.4. Even if the likelihood is non-nil that there might still be users out there who use such an old version to start a bisection, but then decide to continue bisecting with a current Git version, it is highly improbable. So let's remove that code, at long last. Signed-off-by: Johannes Schindelin Signed-off-by: Ævar Arnfjörð Bjarmason --- bisect.c | 3 --- t/t6030-bisect-porcelain.sh | 1 - 2 files changed, 4 deletions(-) diff --git a/bisect.c b/bisect.c index ec7487e6836..ef5ee5a6436 100644 --- a/bisect.c +++ b/bisect.c @@ -472,7 +472,6 @@ static GIT_PATH_FUNC(git_path_bisect_start, "BISECT_START") static GIT_PATH_FUNC(git_path_bisect_log, "BISECT_LOG") static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS") static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT") -static GIT_PATH_FUNC(git_path_head_name, "head-name") static void read_bisect_paths(struct strvec *array) { @@ -1188,8 +1187,6 @@ int bisect_clean_state(void) unlink_or_warn(git_path_bisect_run()); unlink_or_warn(git_path_bisect_terms()); unlink_or_warn(git_path_bisect_first_parent()); - /* Cleanup head-name if it got left by an old version of git-bisect */ - unlink_or_warn(git_path_head_name()); /* * Cleanup BISECT_START last to support the --no-checkout option * introduced in the commit 4796e823a. diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index 0a62ea2b3ce..3ba4fdf6153 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -1158,7 +1158,6 @@ test_expect_success 'git bisect reset cleans bisection state properly' ' test_path_is_missing ".git/BISECT_LOG" && test_path_is_missing ".git/BISECT_RUN" && test_path_is_missing ".git/BISECT_TERMS" && - test_path_is_missing ".git/head-name" && test_path_is_missing ".git/BISECT_HEAD" && test_path_is_missing ".git/BISECT_START" '