From patchwork Sat Oct 10 14:07:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 11830461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37A84C433E7 for ; Sat, 10 Oct 2020 23:10:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBBAB20760 for ; Sat, 10 Oct 2020 23:10:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NnVkaCTs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731707AbgJJW4a (ORCPT ); Sat, 10 Oct 2020 18:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730617AbgJJTvB (ORCPT ); Sat, 10 Oct 2020 15:51:01 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F1C2C05BD18 for ; Sat, 10 Oct 2020 07:08:57 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id v12so12460461wmh.3 for ; Sat, 10 Oct 2020 07:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Ow+AP6QkVF3SaDeNeaXjVuBTnDhi9wPFPl7+V6ytus=; b=NnVkaCTsgR6+f08b6QYbWiN2QuX9Pf3OkVypZn1C1BjPX7m3Q7ik9fOw7epW4cc4Pv x4kloEuKMUizavaaRg/a50Zoy7iOOGJGIDtn4oHLMKpU601ZHUvyz+ZCUS6H3nTkuRo0 rOSLKwAxHHJr62v0nzOb43kFM2StOs0IVDMb9SY1rx+7+2IwVU8zrB7BZCrv/tyCSzj9 Zc5RXbb+gtBqKYyI6vnScjyvvs6Lk7mLT1rQdPXu1HImeoJehSKqvev+16K8Knm4fTvW 7KivT6a7l8dFT1auONv3fahlj+RIe3OMrZI5GD273thyo6NZ58WhIIiBOetTbjWGMZeO QbPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Ow+AP6QkVF3SaDeNeaXjVuBTnDhi9wPFPl7+V6ytus=; b=s874nda4taKqgW1BgUZ5Fw/3qI2S9AaTZkSZQdJom8aUpFX0CFdflp6MGUIyXdGnix 5CrON/rHJPbzOi9vN/OOkY4GwJqqLXPMnO4KawpYFE74E0otAroHQYoeVwBpmpjMHt2d ek80LfSyxHmKXkLdJwPk6+eq/Fl7AQgAlAaIpTnaiXGGo645e46KmYZFdgUaupaJNIeI 9LDuunumkc6aafShDt9c4EvcAtbcocAIk2ELTThSHRGPlrbAEGeUfb3can0G2tdwQI+q 48pu3L2TaIizsM/jd7jg9lT8T7Gt/SIKqIypMipJbQvTd6hM4AnC0yu+Lcs7I+wyAXUH BG1g== X-Gm-Message-State: AOAM532BGcAyMkcszHpJH4UCmWnXWJ3OvFDGgl/WY0Je9qAiW8vHTsJo MBbTRFi67JGjxsglei0MaD0X+O0inXc= X-Google-Smtp-Source: ABdhPJyPmctwu9brNJDyhKClAG3AcrwfM6Gb9FbsJJeX+8y6oDaa76hVK8nSLMRIyQW2WRn4orrCEA== X-Received: by 2002:a05:600c:2902:: with SMTP id i2mr2843643wmd.31.1602338935562; Sat, 10 Oct 2020 07:08:55 -0700 (PDT) Received: from localhost.localdomain ([91.242.153.231]) by smtp.gmail.com with ESMTPSA id g83sm15746737wmf.15.2020.10.10.07.08.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Oct 2020 07:08:54 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Pranit Bauva , Lars Schneider , Christian Couder , Tanushree Tumane , Miriam Rubio Subject: [PATCH v10 2/7] bisect--helper: retire `--bisect-clean-state` subcommand Date: Sat, 10 Oct 2020 16:07:38 +0200 Message-Id: <20201010140743.580-3-mirucam@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20201010140743.580-1-mirucam@gmail.com> References: <20201010140743.580-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Pranit Bauva The `--bisect-clean-state` subcommand is no longer used from the git-bisect.sh shell script. Instead the function `bisect_clean_state()` is directly called from the C implementation. Mentored-by: Lars Schneider Mentored-by: Christian Couder Signed-off-by: Pranit Bauva Signed-off-by: Tanushree Tumane Signed-off-by: Miriam Rubio --- builtin/bisect--helper.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 8adad68268..fbb9046737 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -22,7 +22,6 @@ static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT") static const char * const git_bisect_helper_usage[] = { N_("git bisect--helper --next-all"), N_("git bisect--helper --write-terms "), - N_("git bisect--helper --bisect-clean-state"), N_("git bisect--helper --bisect-reset []"), N_("git bisect--helper --bisect-write [--no-log] "), N_("git bisect--helper --bisect-check-and-set-terms "), @@ -861,7 +860,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) enum { NEXT_ALL = 1, WRITE_TERMS, - BISECT_CLEAN_STATE, CHECK_EXPECTED_REVS, BISECT_RESET, BISECT_WRITE, @@ -879,8 +877,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) N_("perform 'git bisect next'"), NEXT_ALL), OPT_CMDMODE(0, "write-terms", &cmdmode, N_("write the terms to .git/BISECT_TERMS"), WRITE_TERMS), - OPT_CMDMODE(0, "bisect-clean-state", &cmdmode, - N_("cleanup the bisection state"), BISECT_CLEAN_STATE), OPT_CMDMODE(0, "check-expected-revs", &cmdmode, N_("check for expected revs"), CHECK_EXPECTED_REVS), OPT_CMDMODE(0, "bisect-reset", &cmdmode, @@ -922,10 +918,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) if (argc != 2) return error(_("--write-terms requires two arguments")); return write_terms(argv[0], argv[1]); - case BISECT_CLEAN_STATE: - if (argc != 0) - return error(_("--bisect-clean-state requires no arguments")); - return bisect_clean_state(); case CHECK_EXPECTED_REVS: check_expected_revs(argv, argc); return 0; From patchwork Sat Oct 10 14:07:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 11830479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D60B8C3279D for ; Sat, 10 Oct 2020 23:10:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4D5F2075E for ; Sat, 10 Oct 2020 23:10:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gglXI6eb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388506AbgJJW41 (ORCPT ); Sat, 10 Oct 2020 18:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730456AbgJJTvA (ORCPT ); Sat, 10 Oct 2020 15:51:00 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926E1C05BD19 for ; Sat, 10 Oct 2020 07:08:58 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id p15so12450522wmi.4 for ; Sat, 10 Oct 2020 07:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2odWCcl+peeWRLiAEIKMZhirbEEEvODwaGttKMWIFr4=; b=gglXI6ebySWcvh4w3E7uyRVWALPV/JeBejrx39Z+roUDJlOpk6iT2mTXIY9OKfJvtL WPpsCouylEhZzuz7iqp4pMKAjvGHKFb8NtUx1k068ETinWhnK9AmQ66qKezIER3oUGvM kVYDHMTjJWZBVlMlJw8nN0RpGJr/vqv4qkdwa8GQO3yF1r4qRO5z20ZSu+B1V/quPSXt 8r8x481oWTNITQVYke+gVsfsuIpiQArfZMW2fVyNyXoKAB/J85vKyl2P2vWh2DYVnB5s OGstycAq1GM0dRaKzsh38OC4teUUTOCnhWfqUikxsoZdjC1m7hEThu0JsPcDmb6qe6vf lc1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2odWCcl+peeWRLiAEIKMZhirbEEEvODwaGttKMWIFr4=; b=tIC2sm5aSrVql3wQBaMCoA4mhkHGFJVaSOgEJnuKIyd+3ATXgw/uWpcQB/HLSKFG7X mGglaL6lm+4nUZ7B0J6Uve+0qGVKClK+Sa2H9xncQ7H/LYe/B65E23ov89xOEbX6v5x7 8O0G0t4pU0zFLd3kVPc+lrP7GNbFC381DmGXMV54XWuXsIP6veFvcoNiBV6pGHYCLsSK 1hwgxE40gpJOnKCmsWQDE/NyByO1W/i+hHK/x05dVHKiOnhVVjszD03/X0KOzA2pyjd9 b2YoJgyV5VnaAv46nGUntbWg9nRhwMY+cqu1nSEKj80uPe2wQh9bT+ufknG082P0vgHW qqyg== X-Gm-Message-State: AOAM533YeOUClCkCS1lrOR2jHIlL2Hip8gpLV148Utkb9QTfPCdMOuDM BhxgSA3TrcMVX3dWtv71B4RBSzlYF3g= X-Google-Smtp-Source: ABdhPJy6LraP9nHMss+2Dv86CjhViAlvCmTiEb6jN6mNOrrt4UTIN+XZPUj2sA2qqzTGPOaBdEQwDw== X-Received: by 2002:a1c:87:: with SMTP id 129mr2847075wma.103.1602338936841; Sat, 10 Oct 2020 07:08:56 -0700 (PDT) Received: from localhost.localdomain ([91.242.153.231]) by smtp.gmail.com with ESMTPSA id g83sm15746737wmf.15.2020.10.10.07.08.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Oct 2020 07:08:56 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Pranit Bauva , Lars Schneider , Christian Couder , Tanushree Tumane , Miriam Rubio Subject: [PATCH v10 3/7] bisect--helper: retire `--next-all` subcommand Date: Sat, 10 Oct 2020 16:07:39 +0200 Message-Id: <20201010140743.580-4-mirucam@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20201010140743.580-1-mirucam@gmail.com> References: <20201010140743.580-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Pranit Bauva The `--next-all` subcommand is no longer used from the git-bisect.sh shell script. Instead the function `bisect_next_all()` is called from the C implementation of `bisect_next()`. Mentored-by: Lars Schneider Mentored-by: Christian Couder Signed-off-by: Pranit Bauva Signed-off-by: Tanushree Tumane Signed-off-by: Miriam Rubio --- builtin/bisect--helper.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index fbb9046737..f1a7cfbfaf 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -20,7 +20,6 @@ static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES") static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT") static const char * const git_bisect_helper_usage[] = { - N_("git bisect--helper --next-all"), N_("git bisect--helper --write-terms "), N_("git bisect--helper --bisect-reset []"), N_("git bisect--helper --bisect-write [--no-log] "), @@ -858,8 +857,7 @@ static int bisect_autostart(struct bisect_terms *terms) int cmd_bisect__helper(int argc, const char **argv, const char *prefix) { enum { - NEXT_ALL = 1, - WRITE_TERMS, + WRITE_TERMS = 1, CHECK_EXPECTED_REVS, BISECT_RESET, BISECT_WRITE, @@ -873,8 +871,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) } cmdmode = 0; int res = 0, nolog = 0; struct option options[] = { - OPT_CMDMODE(0, "next-all", &cmdmode, - N_("perform 'git bisect next'"), NEXT_ALL), OPT_CMDMODE(0, "write-terms", &cmdmode, N_("write the terms to .git/BISECT_TERMS"), WRITE_TERMS), OPT_CMDMODE(0, "check-expected-revs", &cmdmode, @@ -911,9 +907,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) usage_with_options(git_bisect_helper_usage, options); switch (cmdmode) { - case NEXT_ALL: - res = bisect_next_all(the_repository, prefix); - break; case WRITE_TERMS: if (argc != 2) return error(_("--write-terms requires two arguments")); From patchwork Sat Oct 10 14:07:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 11830459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C427C2BD0C for ; Sat, 10 Oct 2020 23:10:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23B582075E for ; Sat, 10 Oct 2020 23:10:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oc2zQGYE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390048AbgJJW43 (ORCPT ); Sat, 10 Oct 2020 18:56:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730600AbgJJTvA (ORCPT ); Sat, 10 Oct 2020 15:51:00 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2375AC05BD1A for ; Sat, 10 Oct 2020 07:09:00 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id v12so12460593wmh.3 for ; Sat, 10 Oct 2020 07:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=by3iRDMlk3KSH3j9BsojlrItvA6EQjr2c+PpEbJBCbQ=; b=oc2zQGYEloWCTvO4nj81INAebiTZhf2onW7QI4em9+IU5+68G5ZmHnRgXdznPyeAHo JH4X/aTHYMF3hTYmZObILoYm0p3R7TA23L6JzC+Q552wjwr48xZKxCrkt2I1h8tMlRLQ WjavpmtFTJjoJ4UgBxInELkedPeqJ0gGZO2IeOi/jbioFAqhaGzwWOAYZl2JnUGiJqFJ FaxbJGv9nrIA2jHGKE1EtnoVxAQVI4/wLcmImOKL2TyrnD+wP7dMw+sCngdGGHdtRNxJ tceRzluyxSxBk7AmazUVtCWi25n1nCathLbwMTYAsxd3eSFfqxi5Xi4zmQP1QhbMZ47W e/0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=by3iRDMlk3KSH3j9BsojlrItvA6EQjr2c+PpEbJBCbQ=; b=MIcr8HrfGjnT1Ba7rgP26+hFXwAk4gGM6JnrRU4QFhMaYV/HyJ0dO5kLI1+uAh5Z8E 8er6Y7Lm3nTzn0Jr77mw9/QyhugKCFInIUr0hF+DpwuACePYBzcZKH+GLEG0dMw72XhV H//cnvR+wgYPe4DN2RlLxqdo/CckmYJ/XIe+/d9yf/zUYliPmxufnDMivUKkfFYV4Ud+ ywsCc2isn1BW1reB18GzbXGmnqo2BEQShm6sbDnaOlhzYUDygyd8MfFa5tn6wbb4hWdU nBghsDMizZEfUKvWBj85zgzs/4RDtjPaeS/qaT/QRim1ShACERBKY0/zyILhFJplzrdw KSoQ== X-Gm-Message-State: AOAM5312c8b4celmxJy5aEp600tow675t/JZoBzixrKfMoZ6zQrIco8u HjNGgFqO1bWS8VcHGElXgFll6HZfYvQ= X-Google-Smtp-Source: ABdhPJwgYs1O2gm879X+AVSrSmC4bdjPFZmIEFoM7op1e38t4EsTV5eS4moV/kjOKvm/iiyGgAwPAQ== X-Received: by 2002:a1c:5f46:: with SMTP id t67mr2830091wmb.173.1602338938163; Sat, 10 Oct 2020 07:08:58 -0700 (PDT) Received: from localhost.localdomain ([91.242.153.231]) by smtp.gmail.com with ESMTPSA id g83sm15746737wmf.15.2020.10.10.07.08.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Oct 2020 07:08:57 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Pranit Bauva , Lars Schneider , Christian Couder , Johannes Schindelin , Tanushree Tumane , Miriam Rubio Subject: [PATCH v10 4/7] bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C Date: Sat, 10 Oct 2020 16:07:40 +0200 Message-Id: <20201010140743.580-5-mirucam@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20201010140743.580-1-mirucam@gmail.com> References: <20201010140743.580-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Pranit Bauva Reimplement the `bisect_state()` shell functions in C and also add a subcommand `--bisect-state` to `git-bisect--helper` to call them from git-bisect.sh . Using `--bisect-state` subcommand is a temporary measure to port shell function to C so as to use the existing test suite. As more functions are ported, this subcommand will be retired and will be called by some other methods. `bisect_head()` is only called from `bisect_state()`, thus it is not required to introduce another subcommand. Note that the `eval` in the changed line of `git-bisect.sh` cannot be dropped: it is necessary because the `rev` and the `tail` variables may contain multiple, quoted arguments that need to be passed to `bisect--helper` (without the quotes, naturally). Mentored-by: Lars Schneider Mentored-by: Christian Couder Mentored-by: Johannes Schindelin Signed-off-by: Pranit Bauva Signed-off-by: Tanushree Tumane Signed-off-by: Miriam Rubio --- builtin/bisect--helper.c | 84 +++++++++++++++++++++++++++++++++++++++- git-bisect.sh | 55 ++------------------------ 2 files changed, 87 insertions(+), 52 deletions(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index f1a7cfbfaf..66b5346e42 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -31,6 +31,8 @@ static const char * const git_bisect_helper_usage[] = { N_("git bisect--helper --bisect-next"), N_("git bisect--helper --bisect-auto-next"), N_("git bisect--helper --bisect-autostart"), + N_("git bisect--helper --bisect-state (bad|new) []"), + N_("git bisect--helper --bisect-state (good|old) [...]"), NULL }; @@ -854,6 +856,78 @@ static int bisect_autostart(struct bisect_terms *terms) return res; } +static enum bisect_error bisect_state(struct bisect_terms *terms, const char **argv, + int argc) +{ + const char *state; + int i, verify_expected = 1; + struct object_id oid, expected; + struct strbuf buf = STRBUF_INIT; + struct oid_array revs = OID_ARRAY_INIT; + + if (!argc) + return error(_("Please call `--bisect-state` with at least one argument")); + + if (bisect_autostart(terms)) + return BISECT_FAILED; + + state = argv[0]; + if (check_and_set_terms(terms, state) || + !one_of(state, terms->term_good, terms->term_bad, "skip", NULL)) + return BISECT_FAILED; + + argv++; + argc--; + if (argc > 1 && !strcmp(state, terms->term_bad)) + return error(_("'git bisect %s' can take only one argument."), terms->term_bad); + + if (argc == 0) { + const char *head = "BISECT_HEAD"; + enum get_oid_result res_head = get_oid(head, &oid); + + if (res_head == MISSING_OBJECT) { + head = "HEAD"; + res_head = get_oid(head, &oid); + } + + if (res_head) + error(_("Bad rev input: %s"), head); + oid_array_append(&revs, &oid); + } + + /* + * All input revs must be checked before executing bisect_write() + * to discard junk revs. + */ + + for (; argc; argc--, argv++) { + if (get_oid(*argv, &oid)){ + error(_("Bad rev input: %s"), *argv); + return BISECT_FAILED; + } + oid_array_append(&revs, &oid); + } + + if (strbuf_read_file(&buf, git_path_bisect_expected_rev(), 0) < the_hash_algo->hexsz || + get_oid_hex(buf.buf, &expected) < 0) + verify_expected = 0; /* Ignore invalid file contents */ + strbuf_release(&buf); + + for (i = 0; i < revs.nr; i++) { + if (bisect_write(state, oid_to_hex(&revs.oid[i]), terms, 0)) + return BISECT_FAILED; + + if (verify_expected && !oideq(&revs.oid[i], &expected)) { + unlink_or_warn(git_path_bisect_ancestors_ok()); + unlink_or_warn(git_path_bisect_expected_rev()); + verify_expected = 0; + } + } + + oid_array_clear(&revs); + return bisect_auto_next(terms, NULL); +} + int cmd_bisect__helper(int argc, const char **argv, const char *prefix) { enum { @@ -867,7 +941,8 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) BISECT_START, BISECT_AUTOSTART, BISECT_NEXT, - BISECT_AUTO_NEXT + BISECT_AUTO_NEXT, + BISECT_STATE } cmdmode = 0; int res = 0, nolog = 0; struct option options[] = { @@ -893,6 +968,8 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) N_("verify the next bisection state then checkout the next bisection commit"), BISECT_AUTO_NEXT), OPT_CMDMODE(0, "bisect-autostart", &cmdmode, N_("start the bisection if it has not yet been started"), BISECT_AUTOSTART), + OPT_CMDMODE(0, "bisect-state", &cmdmode, + N_("mark the state of ref (or refs)"), BISECT_STATE), OPT_BOOL(0, "no-log", &nolog, N_("no log for BISECT_WRITE")), OPT_END() @@ -963,6 +1040,11 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) set_terms(&terms, "bad", "good"); res = bisect_autostart(&terms); break; + case BISECT_STATE: + set_terms(&terms, "bad", "good"); + get_terms(&terms); + res = bisect_state(&terms, argv, argc); + break; default: BUG("unknown subcommand %d", cmdmode); } diff --git a/git-bisect.sh b/git-bisect.sh index dda386bc3a..1f3f6e9fc5 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -39,16 +39,6 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" TERM_BAD=bad TERM_GOOD=good -bisect_head() -{ - if git rev-parse --verify -q BISECT_HEAD > /dev/null - then - echo BISECT_HEAD - else - echo HEAD - fi -} - bisect_skip() { all='' for arg in "$@" @@ -61,43 +51,7 @@ bisect_skip() { esac all="$all $revs" done - eval bisect_state 'skip' $all -} - -bisect_state() { - git bisect--helper --bisect-autostart || exit - state=$1 - git bisect--helper --check-and-set-terms $state $TERM_GOOD $TERM_BAD || exit - get_terms - case "$#,$state" in - 0,*) - die "Please call 'bisect_state' with at least one argument." ;; - 1,"$TERM_BAD"|1,"$TERM_GOOD"|1,skip) - bisected_head=$(bisect_head) - rev=$(git rev-parse --verify "$bisected_head") || - die "$(eval_gettext "Bad rev input: \$bisected_head")" - git bisect--helper --bisect-write "$state" "$rev" "$TERM_GOOD" "$TERM_BAD" || exit - git bisect--helper --check-expected-revs "$rev" ;; - 2,"$TERM_BAD"|*,"$TERM_GOOD"|*,skip) - shift - hash_list='' - for rev in "$@" - do - sha=$(git rev-parse --verify "$rev^{commit}") || - die "$(eval_gettext "Bad rev input: \$rev")" - hash_list="$hash_list $sha" - done - for rev in $hash_list - do - git bisect--helper --bisect-write "$state" "$rev" "$TERM_GOOD" "$TERM_BAD" || exit - done - git bisect--helper --check-expected-revs $hash_list ;; - *,"$TERM_BAD") - die "$(eval_gettext "'git bisect \$TERM_BAD' can take only one argument.")" ;; - *) - usage ;; - esac - git bisect--helper --bisect-auto-next + eval git bisect--helper --bisect-state 'skip' $all } bisect_visualize() { @@ -187,8 +141,7 @@ exit code \$res from '\$command' is < 0 or >= 128" >&2 state="$TERM_GOOD" fi - # We have to use a subshell because "bisect_state" can exit. - ( bisect_state $state >"$GIT_DIR/BISECT_RUN" ) + git bisect--helper --bisect-state $state >"$GIT_DIR/BISECT_RUN" res=$? cat "$GIT_DIR/BISECT_RUN" @@ -203,7 +156,7 @@ exit code \$res from '\$command' is < 0 or >= 128" >&2 if [ $res -ne 0 ] then eval_gettextln "bisect run failed: -'bisect_state \$state' exited with error code \$res" >&2 +'bisect-state \$state' exited with error code \$res" >&2 exit $res fi @@ -244,7 +197,7 @@ case "$#" in start) git bisect--helper --bisect-start "$@" ;; bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD") - bisect_state "$cmd" "$@" ;; + git bisect--helper --bisect-state "$cmd" "$@" ;; skip) bisect_skip "$@" ;; next) From patchwork Sat Oct 10 14:07:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 11830457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEA12C2D0A4 for ; Sat, 10 Oct 2020 23:10:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 713192075E for ; Sat, 10 Oct 2020 23:10:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kiIUtyHz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731537AbgJJW4j (ORCPT ); Sat, 10 Oct 2020 18:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731124AbgJJTw4 (ORCPT ); Sat, 10 Oct 2020 15:52:56 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E534C05BD1B for ; Sat, 10 Oct 2020 07:09:01 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id q5so12462568wmq.0 for ; Sat, 10 Oct 2020 07:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jIyb7pJOsAWnA5uhbu51zZFPPl3NYttft0D1Uusla58=; b=kiIUtyHz7QGbjryC5gqHZbDf5/7r0T9SB298f1/Wxvk2IGZXOPbpkSZa+gn2+vVqkH EKNdvoqapeP93dNdE5B2kRz+r0eiwt5p1peTdSwXyCwK0ZUpAFBcUAWN13yzpjGOnWe2 WKQhgYeIvSyeggUvd/7NVJm6kN3AqhIxs0MaELGX8/Ad5qwJ0Ppu5NklHTZOSQgC2ERm 4tZCH9U7wWp9MWFMID/d/8NU5VP7hP6yV0HNro2I1Z8KzBd1tR7hFE1TjBc0cxuou+RJ PpkNnq40Vo8bvu74WaHqMA3s1gOsVA7yVSBoCm6x86IEAThvZvVlvmgwxB5NVLiAGArJ tfHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jIyb7pJOsAWnA5uhbu51zZFPPl3NYttft0D1Uusla58=; b=CKol7MJmAaS9myWAn313wxsukytTTf22SgLaUDKu7MmWTNwHvEF3Dirf0vfBDe/K1w V5rKBxF5vqkob9zS2qou2wg2HIlMTnDByv0j66Vouc1CFOcS6M+t5U4JmMNzgoNrKaL5 9u/dCYE88Mc0yzYI+csJQuXGtw+DNTrANd0oevRevhApST/qf6qYNngqG6oip1bDs0b+ D8xIMdaAP1cCc+JVNFOX7k4u/GY/nl4yfpEQkOkJmytD5pTFUqez116CUSX8t2jZY4/w Td2acyq0ffvQOb67eTccKm4DTOlyK3GU952Vl0qw3cLLHhVj/vM7DiPM58TiW5p7/qNA zgeA== X-Gm-Message-State: AOAM533CntPYgPCfjBo0LGn3RhHxXrxliDzEtjLsx9g55iOCMCKHrBRZ yw/SUUQ551mkyaSFv/iF84hfndoDg5s= X-Google-Smtp-Source: ABdhPJxcO/rbm9reXgZGqLlYxEuTZoHPJwe6wtbGqAmfLDRYvi9ShB26I5dn8Rh6HoA+9/5qRGNjxA== X-Received: by 2002:a1c:b386:: with SMTP id c128mr2856283wmf.82.1602338939645; Sat, 10 Oct 2020 07:08:59 -0700 (PDT) Received: from localhost.localdomain ([91.242.153.231]) by smtp.gmail.com with ESMTPSA id g83sm15746737wmf.15.2020.10.10.07.08.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Oct 2020 07:08:59 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Pranit Bauva , Lars Schneider , Christian Couder , Johannes Schindelin , Tanushree Tumane , Miriam Rubio Subject: [PATCH v10 5/7] bisect--helper: retire `--check-expected-revs` subcommand Date: Sat, 10 Oct 2020 16:07:41 +0200 Message-Id: <20201010140743.580-6-mirucam@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20201010140743.580-1-mirucam@gmail.com> References: <20201010140743.580-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Pranit Bauva The `--check-expected-revs` subcommand is no longer used from the git-bisect.sh shell script. Functions `check_expected_revs` and `is_expected_revs` are also deleted. Mentored-by: Lars Schneider Mentored-by: Christian Couder Mentored-by: Johannes Schindelin Signed-off-by: Pranit Bauva Signed-off-by: Tanushree Tumane Signed-off-by: Miriam Rubio --- builtin/bisect--helper.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 66b5346e42..14a8f2b9df 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -187,30 +187,6 @@ static int write_terms(const char *bad, const char *good) return res; } -static int is_expected_rev(const char *expected_hex) -{ - struct strbuf actual_hex = STRBUF_INIT; - int res = 0; - if (strbuf_read_file(&actual_hex, git_path_bisect_expected_rev(), 0) >= 40) { - strbuf_trim(&actual_hex); - res = !strcmp(actual_hex.buf, expected_hex); - } - strbuf_release(&actual_hex); - return res; -} - -static void check_expected_revs(const char **revs, int rev_nr) -{ - int i; - - for (i = 0; i < rev_nr; i++) { - if (!is_expected_rev(revs[i])) { - unlink_or_warn(git_path_bisect_ancestors_ok()); - unlink_or_warn(git_path_bisect_expected_rev()); - } - } -} - static int bisect_reset(const char *commit) { struct strbuf branch = STRBUF_INIT; @@ -932,7 +908,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) { enum { WRITE_TERMS = 1, - CHECK_EXPECTED_REVS, BISECT_RESET, BISECT_WRITE, CHECK_AND_SET_TERMS, @@ -948,8 +923,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) struct option options[] = { OPT_CMDMODE(0, "write-terms", &cmdmode, N_("write the terms to .git/BISECT_TERMS"), WRITE_TERMS), - OPT_CMDMODE(0, "check-expected-revs", &cmdmode, - N_("check for expected revs"), CHECK_EXPECTED_REVS), OPT_CMDMODE(0, "bisect-reset", &cmdmode, N_("reset the bisection state"), BISECT_RESET), OPT_CMDMODE(0, "bisect-write", &cmdmode, @@ -988,9 +961,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) if (argc != 2) return error(_("--write-terms requires two arguments")); return write_terms(argv[0], argv[1]); - case CHECK_EXPECTED_REVS: - check_expected_revs(argv, argc); - return 0; case BISECT_RESET: if (argc > 1) return error(_("--bisect-reset requires either no argument or a commit")); From patchwork Sat Oct 10 14:07:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 11830455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24871C43467 for ; Sat, 10 Oct 2020 23:10:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E51A12075E for ; Sat, 10 Oct 2020 23:10:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a8RUq4rK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390066AbgJJW4b (ORCPT ); Sat, 10 Oct 2020 18:56:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730912AbgJJTwD (ORCPT ); Sat, 10 Oct 2020 15:52:03 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5047C05BD1C for ; Sat, 10 Oct 2020 07:09:02 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id e18so13196099wrw.9 for ; Sat, 10 Oct 2020 07:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kis2M38+KigRUHpZkMWQTHtObAnQ5SZYj6k8yZUSu34=; b=a8RUq4rKEc/TTzJGGa3sUN9oIauVKbFsM7Fq0BmkUiqZMV9hT1xn4g7kwmJ9ymPXQu qCt56ovhvAA1t7GhOUJG2kJQdI5awwFMNJK1kAEEjQamLr+aUmmMS6CiX9/rPDFZIQ6j J5ghVG7VTRpGlwsykM+cdBNfs0yUDh31zmGdIo00BZKKyWPJRwZvE6+QOpFESft7V26r wxA0ZMgy2M1iehWxEFiVP3Zy1IVHWT4MqW59vQGoL76QK7pQO2x+8LWZOQfDuIeEWw3O uWkrJfNl7KOgueM94B0G0BjaptZzvbbI4iCp4Vrpj167IN21tEqF1cUquQrmt1mA/0OF kFZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kis2M38+KigRUHpZkMWQTHtObAnQ5SZYj6k8yZUSu34=; b=NPvIBK139X3s0DrRihFQnGA9/4mRB8qnD9/WFbW+6xcpUe1BFpdL79RA2AG9nTbAgU iDtc3mePy19kh7qT51Z7KaciRP4AerUz0sI61Q9AnMDrJ0anNelENRYNihgozsQzhls7 NmgqPiRk6xYVMbRlOwX/flM0hC1enMR/E7Hn0ltxtO4gWHQ+b2YPrQi74rEb1Uyx4ifw L88Abmg+07vR5soyoAL1CQnBK8tBjwAEUgSzEtt2hOfh/ywOIFiMxbRmOoJ7nK/sGFLM Cz0kV5ywdWIGgdmkkbaMajCzLFaEos1x4J5XAGJgZU7+EEGbMysGJZIxCe5fAmdOflCG E3Jg== X-Gm-Message-State: AOAM5322PZXmKQ3BtCdwws7MVoGYpVZmX//QRD+fb43AnEEzwrKsFPFq ctzNiXNG3Ic5zY8JVjzS8JbH9rW1dl8= X-Google-Smtp-Source: ABdhPJzZmDWFzYYBEE6jwXsBCHQi1OkTXbr6/n4ZEY6qzv2mByj8qixCCKgmKji5AEpMo7rxE8FNsQ== X-Received: by 2002:adf:e741:: with SMTP id c1mr8425066wrn.16.1602338941354; Sat, 10 Oct 2020 07:09:01 -0700 (PDT) Received: from localhost.localdomain ([91.242.153.231]) by smtp.gmail.com with ESMTPSA id g83sm15746737wmf.15.2020.10.10.07.08.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Oct 2020 07:09:00 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Pranit Bauva , Lars Schneider , Christian Couder , Johannes Schindelin , Tanushree Tumane , Miriam Rubio Subject: [PATCH v10 6/7] bisect--helper: retire `--write-terms` subcommand Date: Sat, 10 Oct 2020 16:07:42 +0200 Message-Id: <20201010140743.580-7-mirucam@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20201010140743.580-1-mirucam@gmail.com> References: <20201010140743.580-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Pranit Bauva The `--write-terms` subcommand is no longer used from the git-bisect.sh shell script. Instead the function `write_terms()` is called from the C implementation of `set_terms()` and `bisect_start()`. Mentored-by: Lars Schneider Mentored-by: Christian Couder Mentored-by: Johannes Schindelin Signed-off-by: Pranit Bauva Signed-off-by: Tanushree Tumane Signed-off-by: Miriam Rubio --- builtin/bisect--helper.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 14a8f2b9df..f90b3efdd1 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -20,7 +20,6 @@ static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES") static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT") static const char * const git_bisect_helper_usage[] = { - N_("git bisect--helper --write-terms "), N_("git bisect--helper --bisect-reset []"), N_("git bisect--helper --bisect-write [--no-log] "), N_("git bisect--helper --bisect-check-and-set-terms "), @@ -907,8 +906,7 @@ static enum bisect_error bisect_state(struct bisect_terms *terms, const char **a int cmd_bisect__helper(int argc, const char **argv, const char *prefix) { enum { - WRITE_TERMS = 1, - BISECT_RESET, + BISECT_RESET = 1, BISECT_WRITE, CHECK_AND_SET_TERMS, BISECT_NEXT_CHECK, @@ -921,8 +919,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) } cmdmode = 0; int res = 0, nolog = 0; struct option options[] = { - OPT_CMDMODE(0, "write-terms", &cmdmode, - N_("write the terms to .git/BISECT_TERMS"), WRITE_TERMS), OPT_CMDMODE(0, "bisect-reset", &cmdmode, N_("reset the bisection state"), BISECT_RESET), OPT_CMDMODE(0, "bisect-write", &cmdmode, @@ -957,10 +953,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) usage_with_options(git_bisect_helper_usage, options); switch (cmdmode) { - case WRITE_TERMS: - if (argc != 2) - return error(_("--write-terms requires two arguments")); - return write_terms(argv[0], argv[1]); case BISECT_RESET: if (argc > 1) return error(_("--bisect-reset requires either no argument or a commit"));