From patchwork Thu Jan 12 15:19:09 2023 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: 13098222 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 9DA6AC54EBC for ; Thu, 12 Jan 2023 15:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229639AbjALP1a (ORCPT ); Thu, 12 Jan 2023 10:27:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjALP0O (ORCPT ); Thu, 12 Jan 2023 10:26:14 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50EBF3DBDD for ; Thu, 12 Jan 2023 07:19:19 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id tz12so45579890ejc.9 for ; Thu, 12 Jan 2023 07:19:19 -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=yfSgPDChzhHBhmijf3/7kpdqA3N1N+gaTlurk7EXF0I=; b=XthLXwWxMUsNUcQDXgE/Lm6Bw5iFPK9fBfnG7t0RDqsnUGQTgPc9ZPH1rQe3OYLefI Sk+rJ/bqBTOTSD+u5u2KYXsZcKUBn4zIfEm6VM2UqLgBBq/kpw9N5+HBgvbbKH8MT7T0 52AP6mlJDgjwRwvU4dBRlr73TVV35cL9QvoU6/DkPK1xD0FpJONzlGAN8aWb5Z0+7Eup bZExP5gqRVw4i+6Q7n/pu9UCCPuVuNaKun+QdaAZxGaQeHAxczPGAXwvNQQwIDhaUfGk Rov8H0TkEV90FvqL2zmTJNh8bjxqDQpWatzIi1qBSE4B5kGFyOZLui6hs6AJddBaZnMP s8jA== 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=yfSgPDChzhHBhmijf3/7kpdqA3N1N+gaTlurk7EXF0I=; b=uISBRLTJVLNVDaD/rtQxWhPtYZqYpamufsdjf6bt1UZ1IUvqFAgDT0Rj+1WOhzTyQP TV6iJYEIN3LafkeRkHoJxgmdibgOuh4bJqeQFFj9dbfTpn06WznZd4+VDCsGk3Gbg8hg WI/k+X7wiaPGOd3fuJtaTniiFowbSPsHVL2dVdLoct+/+wNiEdGhgcKbRbb5D33+qhMk iyTxCECDSHar2/HZ+zgHp8UDDsLmPGoTvaSRJSdLijnVVbG5P0+XVsGWwKN0M0iCSlBQ 1tGsjofIYQvaDH2WKBqgzTp/P2PWvPaFS6/otRQmffNpTkWfD5APwoODn3C8ltEWlswl mLEQ== X-Gm-Message-State: AFqh2kr9ROvtXAdhJj+YFDR5msKbcSjMfGnm186CF2PEDAV80esmRxl+ g3jpz3Q1jrSUXnCb7WffgTIlMHE7KcF8pA== X-Google-Smtp-Source: AMrXdXuLuPlSnxWfzutGCHQ1YIdFMQ2a9EQ3CSOpsPaobfqPTEEPOSKBreuhDtbOe2Swgxu5oTbMxA== X-Received: by 2002:a17:907:3445:b0:7ad:c5b7:1c79 with SMTP id ac5-20020a170907344500b007adc5b71c79mr54695009ejc.45.1673536757433; Thu, 12 Jan 2023 07:19:17 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id kr12-20020a1709079a0c00b0084d44553af9sm5493291ejc.215.2023.01.12.07.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 07:19:16 -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 v2 1/6] bisect--helper: simplify exit code computation Date: Thu, 12 Jan 2023 16:19:09 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1215.g1ba3f685d4f 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 Jan 12 15:19:10 2023 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: 13098223 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 5E21AC54EBC for ; Thu, 12 Jan 2023 15:27:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240234AbjALP1d (ORCPT ); Thu, 12 Jan 2023 10:27:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240382AbjALP0O (ORCPT ); Thu, 12 Jan 2023 10:26:14 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53CDA3DBCA for ; Thu, 12 Jan 2023 07:19:20 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id c17so27228875edj.13 for ; Thu, 12 Jan 2023 07:19:20 -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=AoA8pEbbXazVu1tvgq8FHQTh/sUkrAffFRnsBdnSYkw=; b=XS6HkzLYpGhyVBqLL1wBuUP9KOgzn3DcJIRlweqcScSdn+89hbGXCifuyL/XXf21b9 dCWbzX3i4l4/tANOh0XCg8oQrRb6VmZ5OgOtnY63HU/FZ6q5Ys35zwjNoUEB+cpl3zcV CgkFMX07ywG4MgL5Fbn0n2ZvJqny5IkqwAImCeInFTXzZwT5MJ0HSRp5FgacarZvlmsh GKIRlMeicrMyME5Bxr7JKoHEzcP5rcj94lVgQwlq/Muy+6URkgMMHXjaiKibEnUmVIQX pjhHBqhvhD62yvh1fCvspE1BgJObwCIAbX6zxFy5o/JCRMpzJoB6E8XgbssN8IyqDgJ/ vCzA== 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=AoA8pEbbXazVu1tvgq8FHQTh/sUkrAffFRnsBdnSYkw=; b=QqkccAvIbprSSFPOAn8vs/WoUXIj+UJE+MENNAReyCm+RXIXe7akLCziO2V0kkInKZ /MIThopB+hGY/id2jixfz/JGJSX+NVkUkh8ojT6G9i2eFeIX0ENLx+IOqgjEZmSHO6tS TBMMpELNYM8MvKmEOgNiSa4X7d7KJHeC7cCLSanu1fUihSVe2qmSk12iaXdWm4BkEsFV Hv3keLkZEEEiDapSpxnVSKEp46vlMi4O5cGVCtjAAbX51Yo79M36EeMKzOpCKs+HX9Id bVYTPSQof5KVrtKP6N45N+0SfDs9w4jjwxO3xJccfCvQCEBrR+Rx5kAf4Dw0BOYP3Z7R qDog== X-Gm-Message-State: AFqh2koK/M8jZd8absywQoTDCFPh8nvwpm+JiaZmfpM6ZdMlXEdWGZRB Et12JBwuNKPED+CqAw2SVT9X17LR8dTBHA== X-Google-Smtp-Source: AMrXdXtPdhHbLipaedU0RWTZ5LONoxrkFaXAI278uluUjVZyechWpj0HdkwUfLUDj8+mLazVTKoXLw== X-Received: by 2002:aa7:de08:0:b0:472:7c75:832 with SMTP id h8-20020aa7de08000000b004727c750832mr62815444edv.16.1673536758457; Thu, 12 Jan 2023 07:19:18 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id kr12-20020a1709079a0c00b0084d44553af9sm5493291ejc.215.2023.01.12.07.19.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 07:19:17 -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 v2 2/6] bisect--helper: make the order consistently `argc, argv` Date: Thu, 12 Jan 2023 16:19:10 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1215.g1ba3f685d4f 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 Jan 12 15:19:11 2023 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: 13098225 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 3D74CC54EBC for ; Thu, 12 Jan 2023 15:27:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232384AbjALP1k (ORCPT ); Thu, 12 Jan 2023 10:27:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240383AbjALP0O (ORCPT ); Thu, 12 Jan 2023 10:26:14 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F5573DBDE for ; Thu, 12 Jan 2023 07:19:21 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id u19so45509919ejm.8 for ; Thu, 12 Jan 2023 07:19:21 -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=HU4jBHEtq4H9yhR9G2IqRBDDwpi/YLVLgEkvmAz0yUE=; b=kN2GJG0Y0bY5v9Zf8pxFCHIxYejxAgGzmHHTy+AQGzyH0TibfzHG9HJJoPwLgBnybS CpE8uBie4Yfy3YpiayJOGYwv/Oh1h3X5QDypfaUX+PKsLGRNnsJZTnkv65+tnqr3UR+u W7KRKMn+aBGzRiyNX5dSs37ZXZGoqj3ym0yXj48LulM9nlXdfkeBUlM87BFpjqoMMK47 m8amrlPESAYjW23jSUQHHnlEjvQbg1okU6DiTQhEfxrYZ4o9EElRN8/BhzdgO7JBVn8g jdXuSVTVfjhcZLoMbzkYzwprjNFIOL/uyNDnvNshGe8wRVxqtyGNNm5goVx7QK1O4Dz2 3ntw== 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=HU4jBHEtq4H9yhR9G2IqRBDDwpi/YLVLgEkvmAz0yUE=; b=K3gw8dGGvBr7mVFzyaDszIgPZnJhnpnfqEtUecteevECVIbbHm35EtX9beUi/JcsQT j7XltdzpthMEX92ppVESUSG4+HAhCLRshasuf5NKhyi7Hem+IRmJZEvH2L4qH5dG2wBQ 03CVfDrBed/O8puFEHZ9a4cLn6P1HUT1+4UfA2RwA5JFE0EvCmEyvKjhKAh7NVogwtaO /KOoAna4YPT6r4Zf44C7+L7avil3tdS5q9vjKJTNL5y3P7tvMb5/ZKs1wX8kYvJRZSXi j1MbDS3ovKSZV/IwWYq1awgVAEed+f2Slm8cdvuVu3sou6C4+3Ja6eWetjtgQWKjrg4w Dckg== X-Gm-Message-State: AFqh2kp3Y2gffcrQ17aIQ3JDbMkQKLiBBAznxxzuAJbhfo8v+lH0EIjO 88EI9NXfmMHEe6CwUDvhphWFu2O7lIacUw== X-Google-Smtp-Source: AMrXdXvyy4S9zldmD/lX6c6VN9Vsx5KxNkZg06ePWmAySpETdszQYV8R1Z9nniZ+smtRbieSustzfw== X-Received: by 2002:a17:906:144a:b0:7c0:f908:79f1 with SMTP id q10-20020a170906144a00b007c0f90879f1mr75805648ejc.60.1673536759467; Thu, 12 Jan 2023 07:19:19 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id kr12-20020a1709079a0c00b0084d44553af9sm5493291ejc.215.2023.01.12.07.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 07:19:18 -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 v2 3/6] bisect: verify that a bogus option won't try to start a bisection Date: Thu, 12 Jan 2023 16:19:11 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1215.g1ba3f685d4f 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 Jan 12 15:19:12 2023 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: 13098228 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 D755CC54EBC for ; Thu, 12 Jan 2023 15:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240369AbjALP1v (ORCPT ); Thu, 12 Jan 2023 10:27:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229972AbjALP0O (ORCPT ); Thu, 12 Jan 2023 10:26:14 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 361B8C21 for ; Thu, 12 Jan 2023 07:19:22 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id tz12so45580299ejc.9 for ; Thu, 12 Jan 2023 07:19:22 -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=IIkorZCai56vpMQTrRCkObBbdC1VRAPQrjHPRlPXwP4=; b=OeXGA4TCfCne2DvovdWaFCC+VemKHnMoluiQbljvgclFq4WTpdg0hNhfqjoGVCRpag C21QR2MGbMbXb9bZdPAcisZCKErI6tPnvogZtgRXx1Re+m7qZ+/fouIcVz4foz0iOY15 8oozKOXQzG6lBsGyj/Jc7vHMTtfgn/rf6E544xnxGIjnn99/eSMAGzbKmzksy7DYKKJj azZsiXiIcRRnaSAt4yWL6JaDxrE9oiniGva4pKq6VuWyTDW46Csfss2nSXAm0nbg98Pf rtutU/xoHmC1Ln4R1/CeXwz4dfHivCcTPHP60O8aYSnYNOOkIauIRB3riZJfx3DyzcMy 23EQ== 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=IIkorZCai56vpMQTrRCkObBbdC1VRAPQrjHPRlPXwP4=; b=gOP5CyyBANMvGTIw2cO0d0eGI0Yb3hjXuYGFhozcLUV+EfMcNeCql/uZgpNZvAt1AP /72BJNXIFPbJElIkSsV6YkuQRLdrecmbq0eh3dGe8wcv+2XOddXXBlrroXeg+7jT+1y3 4u/a5JrWSdamp6De2QsTLDxZAdZUAjM4vnBiyZAzFCE93GSCASHIvI5Xkx1rv/NswIQS 39mKQs/M2ZeUj4JaLWXNMBiR1udCAjBGFXjXkfLGC6Hd5np9Qos6B0LLoXUHAtTRV4JL en+jF9DdUkMLNiUibp6GDUbDfc6GIsaGPWLmAQ0UH8ecrwvJFFSHlO7IHFBg8nl3BPzc kXnQ== X-Gm-Message-State: AFqh2kq65aYyFlsnTftP5hsLMmjhfJLZe7irQY2Y9yMrPvSU2lqiXFrM 603oYQ2qotsXtrlU6+etHPN6jQZWy4O7aw== X-Google-Smtp-Source: AMrXdXu64u2Zia3Kg/yUZ2lazs1ujMaHD7nVAHSksWVSjpAv128MuSAHqqdY1UEHWILxhxfnseksGw== X-Received: by 2002:a17:907:8b12:b0:78d:f457:1062 with SMTP id sz18-20020a1709078b1200b0078df4571062mr66745554ejc.31.1673536760392; Thu, 12 Jan 2023 07:19:20 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id kr12-20020a1709079a0c00b0084d44553af9sm5493291ejc.215.2023.01.12.07.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 07:19:19 -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 v2 4/6] bisect run: fix the error message Date: Thu, 12 Jan 2023 16:19:12 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1215.g1ba3f685d4f 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 [1], but as of [2] (when `bisect--helper` was changed to the present `bisect-state') the error message still talks about implementation details that should not concern end users. Fix that, and add a regression test to ensure that the intended form of the error message. 1. 80c2e9657f2 (bisect--helper: report actual bisect_state() argument on error, 2022-01-18 2. f37d0bdd42d (bisect: fix output regressions in v2.30.0, 2022-11-10) 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 Jan 12 15:19:13 2023 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: 13098226 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 9D0E4C54EBD for ; Thu, 12 Jan 2023 15:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233651AbjALP1p (ORCPT ); Thu, 12 Jan 2023 10:27:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240385AbjALP0O (ORCPT ); Thu, 12 Jan 2023 10:26:14 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31C9A32E81 for ; Thu, 12 Jan 2023 07:19:23 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id cf18so39210816ejb.5 for ; Thu, 12 Jan 2023 07:19:23 -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=xcj5E7zQOZxU7olHhV+yi1f87auyKCpthVpK7AQq0vc=; b=Jf8/RJ0WRPR6fRAQdcQ7sbEd7BUC31tFdP+/ETqHLfduyi023X+1mC74mitSmcRp7o XhsG/gchpkvGg74yYQEYkABKxk7Foe/hzxxWLLs1XsGErpDTsTJU1/GCXnwz11dZn4dI 1AMeMNRNiJGgxzZLEP4TM2F1ES5tmW1qT2lkjmnv0ZkOSo5XjU9fWnHazQJ1dU84b2m6 thwa2/otxABuQYNwijabCNDuBx3Sw0Xq6kJUINBSm5nyNmH2QYOJLDkmJs668d5ZnP7M DnhhssvEXiA/6PYe3MDU2l/lbXRGEs0Wld9+U2q4W3KO0Sm7cR39YaAnyVl3Jrwg7zW+ UTOA== 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=xcj5E7zQOZxU7olHhV+yi1f87auyKCpthVpK7AQq0vc=; b=AOqeiDnZuY6jgMF7X9sL7B7XrFsi8ZaaG/kLlPwDcQ6/c2TXf6fPSrXs2J6cnM71vx 1w5WNkVsF8FCV7xZDWTjtQmDcEdqWvvD/bWxok7h9LhGlPFY184IgEmW7twRbW5cuP3h nizyp3Teb7o11ZFbi5HyaTuBDaQFa0dEVpGDFozDHntgHptQxyBcYer0N1LZ5Vv+9FdT 1aS0QksJe1sb6AdJLcQn+Rxi4Osha5k6g4dq74yg04+b4no/5CDyg89xsixitM2iTwVv Wh7s5GsNUg5Fr0y2fta1YziqKJPt8vNnJKHA0j4taV6O/drwRE9sUZzsQzYm4jDDJFhi ZZPg== X-Gm-Message-State: AFqh2kpPaXe09if354rJUXl7OUwlDvQ1dpLAtqMoKTYpvfTAjF3BZ2b+ 6Kv4JMqqOP+Etxl4WIyS5XGPjG9A9tSO8g== X-Google-Smtp-Source: AMrXdXvibW6zUXbY9MmJxLAzy48fN3bS/DMha1KdnCd5PGYpVZJFB6pkVo4fxoNBJP3lHvwUV/Cqgw== X-Received: by 2002:a17:906:338b:b0:84d:3d88:dff3 with SMTP id v11-20020a170906338b00b0084d3d88dff3mr14677359eja.25.1673536761342; Thu, 12 Jan 2023 07:19:21 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id kr12-20020a1709079a0c00b0084d44553af9sm5493291ejc.215.2023.01.12.07.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 07:19:20 -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 v2 5/6] bisect: remove Cogito-related code Date: Thu, 12 Jan 2023 16:19:13 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1215.g1ba3f685d4f 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 Jan 12 15:19:14 2023 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: 13098227 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 1E8D3C54EBC for ; Thu, 12 Jan 2023 15:27:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234633AbjALP1t (ORCPT ); Thu, 12 Jan 2023 10:27:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239292AbjALP0O (ORCPT ); Thu, 12 Jan 2023 10:26:14 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 141E3E0C7 for ; Thu, 12 Jan 2023 07:19:23 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id u19so45510355ejm.8 for ; Thu, 12 Jan 2023 07:19:23 -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=AQBppmkjnEU9rXnp2INgkkZByoXEMjRuQLd4wJVbvrk=; b=I2S9HYR0Wn5wGFUkGuIbnt9/iWn4RyhDJocvWh+X+9kmh9D/uCnvkPd0lj0/6tbUu0 wg1dxtU14rb8JfwRncGu0JkTcoJ+sCT78wjr6IkXER1sat9nX6b/luAWyd5lg5Rh1La7 996Iw31Ze2RaVviYCE81BY4FK9HqvZrbRlR5IMDJymf1MXc8UKTjdvjmzqcgk1YNnIAF CZnsXekSm8sOIKN2S/dfZTz84g9fX1Ts2BjPHigiGqgr7fYdK7XgbKowGK+SXGYkRUDc 3xt+WkDK9I3fB+DNTJe+h5ccU9DV5v2WYn3CZ/BpWuCu4QrumOVRhYqkjxXBQR7LBZlI 7ufw== 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=AQBppmkjnEU9rXnp2INgkkZByoXEMjRuQLd4wJVbvrk=; b=FjZZdohg17ZrLU1LkMDmHzwX/ZcG4KDXczqf5Omgu6mz+DKf80+7W6FNSYQsk0/Abh zJpZOZlm5odMWBaZg4+iDriu/dl5IhhM2cqbBKT8xsCO9NSeEbD5vlGm+G2WQSUHzvxi ammEkWvedeBUAL9ANmU5WkiYuRvEvNrngBRWUB4J3MKyNG/pBLSsHPTzkk5ItqeXCg+9 kwRBg+wd4XIZD4SNVNyd49e8chECd16OXZJeOqa965pjNATVc6YMnMIwJDpt+P7lHxcn lrgeuOUjN1KZb8cJu78SQKzXd1/1XQuD91fP/0tBjCqbB+V6Ijih9n8GPF2qsJBAPGIQ Pq+g== X-Gm-Message-State: AFqh2kqxmdFiDgxQJEBdqUUqPGUwiO5F9fyqkBPlfsmq4JpkR0uEN3O4 bhQ6/qNfWzwtGRcbi10M1hS7a78z2DaKKg== X-Google-Smtp-Source: AMrXdXuq/2t2A1cnB2TYe0csVD/qmH/EnftDqVsyACNUxj/bLLmGdcUqjC2M5MhkwO8gOS8EHV+DhA== X-Received: by 2002:a17:906:c2c9:b0:7b2:c227:126d with SMTP id ch9-20020a170906c2c900b007b2c227126dmr65517513ejb.20.1673536762341; Thu, 12 Jan 2023 07:19:22 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id kr12-20020a1709079a0c00b0084d44553af9sm5493291ejc.215.2023.01.12.07.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 07:19:21 -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 v2 6/6] bisect: no longer try to clean up left-over `.git/head-name` files Date: Thu, 12 Jan 2023 16:19:14 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1215.g1ba3f685d4f 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" '