From patchwork Thu Sep 2 09:04:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 12471057 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 1DB48C43214 for ; Thu, 2 Sep 2021 09:05:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0012161051 for ; Thu, 2 Sep 2021 09:05:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244944AbhIBJGS (ORCPT ); Thu, 2 Sep 2021 05:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244796AbhIBJGR (ORCPT ); Thu, 2 Sep 2021 05:06:17 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ED97C061575 for ; Thu, 2 Sep 2021 02:05:19 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id q14so1724085wrp.3 for ; Thu, 02 Sep 2021 02:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TDf4NR7irMIBPs6yfFlCt71FkrZC3JHtpdJMSAhYZAI=; b=Ah0FysJhNx8G2MmtI9K89ezT/eCm9oBERMkiwbXMOjQf4ZesTJNSfmeHF6DdQt16a7 7BcPvew3iu7MfQYiOGrgf16CgYHXnP3VIIJ5UL02Bh4+qigPPahkSjnvcAPqGwE3yN1Q UkjhOFAzKUtx+I2CJmYXJVuF+73rvcBrEwJmRWXiQIGb+rWgAcTHSbf5631rEuvGAgjJ xKdAGaxplbbDZLmEidYRhS3ebITmPEqiMIcwqfWPmYCKBA+INPsx3Ti5ehVTav6JRz/Y I66kWoump+Z7k9g6ADUzo0R3Ts0LM4XyfaSDTUalvZvK7fjrpxXMo7TbhFQDjsrcuVjN NNeg== 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=TDf4NR7irMIBPs6yfFlCt71FkrZC3JHtpdJMSAhYZAI=; b=Zzl2tdlF58uISnUKvAnUEMYRK+N0CdcXaruFivCaT8jPScQs8InRBBR/Rl+yQycfz7 KTSf9Ts4t6rN1ys/j2CGt7qkWa8UHq0G0b2iO9b+rIdH8gZMsfF4jBCwvq9uYIi3DtqH lQZgJdbSWUakMxBN5N/XLGjPt1vwYiB/yCWleTSmhpApf2f8HDcDlmxiYcaC/krbEpBQ M5zySSVypQ7+9EiffacI0f/spTyZHHf0GgUdL9doRxvuxjT8Op99/lqQTZGFkODh9B+C XyLBWXE3cjzRpu9aC8Zyx6PvswZC74QTeU3GulImIib+oddamNBRUtJf378dVclzcna2 RpoA== X-Gm-Message-State: AOAM53252fxXZtDogkRdW07Q+NEiHZPb+88CoFWr6G7ZEAsUNWxU4lOZ rlZewD9/XXFUGhwQKlW5m5MBZVp5PAc= X-Google-Smtp-Source: ABdhPJykafvrBftjXIMsRaTlu44h+JcaCjupWY8Xe4Q9X/35mO/RI1Mw9pyQALrLkq6orfJEuTlPGw== X-Received: by 2002:adf:eacb:: with SMTP id o11mr2442949wrn.418.1630573517927; Thu, 02 Sep 2021 02:05:17 -0700 (PDT) Received: from localhost.localdomain ([178.237.237.111]) by smtp.gmail.com with ESMTPSA id l17sm1262516wrz.35.2021.09.02.02.05.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Sep 2021 02:05:17 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Miriam Rubio Subject: [PATCH v6 1/6] t6030-bisect-porcelain: add tests to control bisect run exit cases Date: Thu, 2 Sep 2021 11:04:16 +0200 Message-Id: <20210902090421.93113-2-mirucam@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210902090421.93113-1-mirucam@gmail.com> References: <20210902090421.93113-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There is a gap on bisect run test coverage related with error exits. Add two tests to control these error cases. Signed-off-by: Miriam Rubio --- t/t6030-bisect-porcelain.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index a1baf4e451..e61b8143fd 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -962,4 +962,15 @@ test_expect_success 'bisect handles annotated tags' ' grep "$bad is the first bad commit" output ' +test_expect_success 'bisect run fails with exit code equals or greater than 128' ' + write_script test_script.sh <<-\EOF && + exit 128 >/dev/null + EOF + test_must_fail git bisect run ./test_script.sh > my_bisect_log.txt && + write_script test_script.sh <<-\EOF && + exit 255 >/dev/null + EOF + test_must_fail git bisect run ./test_script.sh >> my_bisect_log.txt +' + test_done From patchwork Thu Sep 2 09:04:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 12471059 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 5EC70C432BE for ; Thu, 2 Sep 2021 09:05:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BF0860F3A for ; Thu, 2 Sep 2021 09:05:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244959AbhIBJGU (ORCPT ); Thu, 2 Sep 2021 05:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244917AbhIBJGS (ORCPT ); Thu, 2 Sep 2021 05:06:18 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F3E8C061575 for ; Thu, 2 Sep 2021 02:05:20 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id q14so1724166wrp.3 for ; Thu, 02 Sep 2021 02:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hPiI6iYTFA/a2PMpNddc4bK5XRP/g0IXABNMsrGR6dE=; b=B4QKAhO9nE5Mr6boXRqVXXNLx204iA/S3K0mklXz2AOOJCzNp7XTbChBfBaqjN9Qb6 M6QNI80D6wTskvbn2BfSRFJKJKz4v82vCNcAF+XOltqtPrBga0vJV2P6bK6YPdPKuEsi etYgRbLoE63Acbfl5wft3gbSsn21zrLQKXy/luTOAcygeoT3xm9X6KyfarYnI/jspE22 KUGB30momRAU6TB7lFS/KYKdshGXtHG+H18Wy53cFreWyyyGGNStL0nXVYQUKNXPnR58 GF2anpZeRL262kmH85rzNU7KRS6FLguJ45Pj3GWhF3va47NrWbvqrMHUI7NGH2B/AJCh NLsg== 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=hPiI6iYTFA/a2PMpNddc4bK5XRP/g0IXABNMsrGR6dE=; b=Z/jPM+Ii8sR9zFSXqEGarPmD7aGTq6Ys5eSkSJ3TQGrn83AC20QsbIOvY5WbQj7WPd 0kSfcVLRkHBQBTsm1crcAmN0G5tpafCeYcqFwXe0pTBDt64LTNVtJTU6dz5Ti+05/8yI kEyEQ+mO5Z0u6pz2LX3QN55XfUkZhR4xg0bw/9WrsQxSuWLy/uFSvriLgJtghAGcGwM2 rRXy+if1SExxa07RMG2/+RoyeBUNt42+Iu6v94dY2G1rBfJFjrkNNVevF6CIvL8o1hTN fOf/RXP3anS5s0gmywahdJ18EI+0wP9p3JsAoAddXmQgXV6A2z7ihv679ekFQgwB8Gas Qg+g== X-Gm-Message-State: AOAM530WNm/UI1wHz2fn/v24MQPX8gnvNHOPWUTVY0a69lv4pldiMuAA iOFcNlnU4ygFeeWlayrUBRsEjGFXHxY= X-Google-Smtp-Source: ABdhPJz8uw3wyfWV/aQxeQcGU8AydpVRy8BA+Gxo9Gc527GFRUu4Poubt4tyW+ELgDofqtImxzDvmQ== X-Received: by 2002:a05:6000:22d:: with SMTP id l13mr2406458wrz.410.1630573518664; Thu, 02 Sep 2021 02:05:18 -0700 (PDT) Received: from localhost.localdomain ([178.237.237.111]) by smtp.gmail.com with ESMTPSA id l17sm1262516wrz.35.2021.09.02.02.05.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Sep 2021 02:05:18 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Miriam Rubio Subject: [PATCH v6 2/6] t6030-bisect-porcelain: add test for bisect visualize Date: Thu, 2 Sep 2021 11:04:17 +0200 Message-Id: <20210902090421.93113-3-mirucam@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210902090421.93113-1-mirucam@gmail.com> References: <20210902090421.93113-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add a test to control breakages in bisect visualize command. Signed-off-by: Miriam Rubio --- t/t6030-bisect-porcelain.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index e61b8143fd..f13eeac9ce 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -973,4 +973,11 @@ test_expect_success 'bisect run fails with exit code equals or greater than 128' test_must_fail git bisect run ./test_script.sh >> my_bisect_log.txt ' +test_expect_success 'bisect visualize with a filename with dash and space' ' + echo "My test line" >> -hello\ 2 && + git add -- -hello\ 2 && + git commit --quiet -m "Add test line" -- -hello\ 2 && + git bisect visualize -p -- -hello\ 2 > my_bisect_log.txt +' + test_done From patchwork Thu Sep 2 09:04:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 12471063 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 E8470C4320A for ; Thu, 2 Sep 2021 09:05:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC7EE61057 for ; Thu, 2 Sep 2021 09:05:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244971AbhIBJGV (ORCPT ); Thu, 2 Sep 2021 05:06:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244796AbhIBJGS (ORCPT ); Thu, 2 Sep 2021 05:06:18 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAA75C061757 for ; Thu, 2 Sep 2021 02:05:20 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id b10so1777818wru.0 for ; Thu, 02 Sep 2021 02:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ff1IbLdcvpD6MhimWYyxaTfLrj9k2S7N5XzYOYFduTA=; b=X6L+Xh5T5etPrZMSAbXMCEDfa00lEfA8CKb3DJJ8ajO6cBUAzZ7SeMRGcMWmNNg4sI rRgA2QsYBzmUlZxxQr7hqyAh6x2aFwt+lOmC3cmGncI00oaE8h/C/WjGXcBoWPpYsYEu hfxvVF/FcRBmZ9lNyLlF9rRvwFLY1PB50+4Fk46BG8wEils7/Yoon9Ni8dWZRiteH1YL 3p5D3hakd2+dQhjsF10g3HK2dWBIp1JlyeotNlNrjSdfY/vJ7HYURbi92ULE01B9VJ5O EFFgdUr4SkManqLNl0gWq9Me0rqJzQXxddqFXPJduY4/gv2p9lf82wNdTd+meeuJT9P+ Muqg== 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=ff1IbLdcvpD6MhimWYyxaTfLrj9k2S7N5XzYOYFduTA=; b=DxacWnQZVfWXkNO4vmW7GUaqzt83bwDj3A5GBibXIyFeBCw6WFbZcPCGR56p2OXZiH hZVdbNO+7zUt8AWckHVw6LnVPMSqN++zuJYCHM2dcjUdWaXBKC+E2R/zV67xJIKPzT0d kj/Q86y83X8Xt6kr7wN0KiTUCbElUBsd4IizzX+58s5P3hqVenxxWwDS0gXXxTYfysks roT0oCO0I2raAedvzeFU52WR4rGe2Uvqosf65PnsYATydH/U9nxKn6QA9EcNjNvaRGUh CFqVT/dTiLHjua1cjXxU1i7Ow2a2+wlqXSVxNrsi5ObTIYZpgbOXM53+19SecUin5TXe 6x+g== X-Gm-Message-State: AOAM531i3KR04Gy6Z/lwmV9iL9gTrVkm4eiVl9pyz/+WqF5+qsc1SHSO GgFV/LoT1qpGRllow01JpfJko9WhF7A= X-Google-Smtp-Source: ABdhPJzcStu5quGNtQTWBZWFC1cJ/mGvZmF/GauaVZKi7b2wlrC43YCKBpGMFKDwp/xjFCZYV3//wg== X-Received: by 2002:a5d:470b:: with SMTP id y11mr2380257wrq.213.1630573519411; Thu, 02 Sep 2021 02:05:19 -0700 (PDT) Received: from localhost.localdomain ([178.237.237.111]) by smtp.gmail.com with ESMTPSA id l17sm1262516wrz.35.2021.09.02.02.05.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Sep 2021 02:05:19 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Pranit Bauva , Tanushree Tumane , Miriam Rubio Subject: [PATCH v6 3/6] run-command: make `exists_in_PATH()` non-static Date: Thu, 2 Sep 2021 11:04:18 +0200 Message-Id: <20210902090421.93113-4-mirucam@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210902090421.93113-1-mirucam@gmail.com> References: <20210902090421.93113-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Pranit Bauva Removes the `static` keyword from `exists_in_PATH()` function and declares the function in `run-command.h` file. The function will be used in bisect_visualize() in a later commit. Mentored by: Christian Couder Mentored by: Johannes Schindelin Signed-off-by: Tanushree Tumane Signed-off-by: Miriam Rubio --- run-command.c | 2 +- run-command.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/run-command.c b/run-command.c index f72e72cce7..390f46819f 100644 --- a/run-command.c +++ b/run-command.c @@ -210,7 +210,7 @@ static char *locate_in_PATH(const char *file) return NULL; } -static int exists_in_PATH(const char *file) +int exists_in_PATH(const char *file) { char *r = locate_in_PATH(file); int found = r != NULL; diff --git a/run-command.h b/run-command.h index af1296769f..54d74b706f 100644 --- a/run-command.h +++ b/run-command.h @@ -182,6 +182,18 @@ void child_process_clear(struct child_process *); int is_executable(const char *name); +/** + * Search if a $PATH for a command exists. This emulates the path search that + * execvp would perform, without actually executing the command so it + * can be used before fork() to prepare to run a command using + * execve() or after execvp() to diagnose why it failed. + * + * The caller should ensure that file contains no directory separators. + * + * Returns 1 if it is found in $PATH or 0 if the command could not be found. + */ +int exists_in_PATH(const char *file); + /** * Start a sub-process. Takes a pointer to a `struct child_process` * that specifies the details and returns pipe FDs (if requested). From patchwork Thu Sep 2 09:04:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 12471061 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 14289C4320E for ; Thu, 2 Sep 2021 09:05:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3B5A61057 for ; Thu, 2 Sep 2021 09:05:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244983AbhIBJGV (ORCPT ); Thu, 2 Sep 2021 05:06:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244955AbhIBJGT (ORCPT ); Thu, 2 Sep 2021 05:06:19 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5521C061764 for ; Thu, 2 Sep 2021 02:05:21 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id m9so1735280wrb.1 for ; Thu, 02 Sep 2021 02:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ktl74k5Q2uTlQ9/SeSsFyS8i0Yj60tIMh0mbF+xmXEw=; b=GS90uK2B6bokkJzOaqz7kiYB4GJ97cP9Vq+bZpnKizSzl8YiRWoU71wgsculDft5sU 95Y9aKfDytOEVSerCRM4tXb98TXi/PkUFNT5wwZrERjZNWml+sWY9y0LNwN1g/KerwEB gMf0g8G/LuKDKi/vKGmi4FRNf6bHTFwMXVg19b8kqm0Xjl5KZf18c6EWJcvCn4weZO5B SoQGz30VH6JodL5+9kj5/pT/VIz4ZL60PUnC3ft4VHOl6dqVCJaGkXK4qcS1Rwd4xH9P 06W2kxBcFLFmDn/IENC6nJPEzrvttWNX6Nb5q9wrQY6yaul6Dc+IF8Rd1t77xrY4dITh k8OQ== 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=Ktl74k5Q2uTlQ9/SeSsFyS8i0Yj60tIMh0mbF+xmXEw=; b=otGpSeuTr7UIEsh5LDeex5PEpFRSPtUqP/Tis6fZcNXyYMDmABhd5PlT1sNONOP9vw AxiZoD56WD+GntqSzWc4xyDgSZP8GfNLF5sXQwfCiKaLKMNHhExB8HYYc1IQYRrwfYAT qRsgMFRNx0aYgFt9zXFBF/xYkutfY+LCBCkWZFJZzmMqwnNYhvWCXJRgLl1JuqRmPaBu bNarRotpTXW5Z33k+kfEkjTzDJ4tYnYHNjbD36N26T+SLYth7ZLZ+2NEhoosSGzOgBcF DwCE+krXGnhju9ZDn6EBPVffmDUkD2mYXLPgjeCKdrX7vfG73dgqWe6GQ9DzszxTUvEq vZZw== X-Gm-Message-State: AOAM533/r2LwU2M22fpjcDaYUlO7x+CyRa2F1Mxlp4Vhxrt2UDG9ks1U vuSmbDvei4CfAb6I6XuoqvRytstBros= X-Google-Smtp-Source: ABdhPJyE23HiCd4XBY425g8aJ6OozNUYoJVvKml78QzDu+0T3+08mFONmpqh1HlRSrXZnTYxldOliQ== X-Received: by 2002:a5d:5441:: with SMTP id w1mr2364625wrv.280.1630573520332; Thu, 02 Sep 2021 02:05:20 -0700 (PDT) Received: from localhost.localdomain ([178.237.237.111]) by smtp.gmail.com with ESMTPSA id l17sm1262516wrz.35.2021.09.02.02.05.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Sep 2021 02:05:20 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Pranit Bauva , Christian Couder , Johannes Schindelin , Tanushree Tumane , Miriam Rubio Subject: [PATCH v6 4/6] bisect--helper: reimplement `bisect_visualize()`shell function in C Date: Thu, 2 Sep 2021 11:04:19 +0200 Message-Id: <20210902090421.93113-5-mirucam@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210902090421.93113-1-mirucam@gmail.com> References: <20210902090421.93113-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_visualize()` shell function in C and also add `--bisect-visualize` subcommand to `git bisect--helper` to call it from git-bisect.sh. Mentored-by: Christian Couder Mentored-by: Johannes Schindelin Signed-off-by: Tanushree Tumane Signed-off-by: Miriam Rubio --- builtin/bisect--helper.c | 48 +++++++++++++++++++++++++++++++++++++++- git-bisect.sh | 25 +-------------------- 2 files changed, 48 insertions(+), 25 deletions(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index f184eaeac6..1e118a966a 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -30,6 +30,7 @@ static const char * const git_bisect_helper_usage[] = { N_("git bisect--helper --bisect-state (good|old) [...]"), N_("git bisect--helper --bisect-replay "), N_("git bisect--helper --bisect-skip [(|)...]"), + N_("git bisect--helper --bisect-visualize"), NULL }; @@ -1036,6 +1037,44 @@ static enum bisect_error bisect_skip(struct bisect_terms *terms, const char **ar return res; } +static int bisect_visualize(struct bisect_terms *terms, const char **argv, int argc) +{ + struct strvec args = STRVEC_INIT; + int flags = RUN_COMMAND_NO_STDIN, res = 0; + struct strbuf sb = STRBUF_INIT; + + if (bisect_next_check(terms, NULL) != 0) + return BISECT_FAILED; + + if (!argc) { + if ((getenv("DISPLAY") || getenv("SESSIONNAME") || getenv("MSYSTEM") || + getenv("SECURITYSESSIONID")) && exists_in_PATH("gitk")) + strvec_push(&args, "gitk"); + else { + strvec_push(&args, "log"); + flags |= RUN_GIT_CMD; + } + } else { + if (argv[0][0] == '-') { + strvec_push(&args, "log"); + flags |= RUN_GIT_CMD; + } else if (strcmp(argv[0], "tig") && !starts_with(argv[0], "git")) + flags |= RUN_GIT_CMD; + + strvec_pushv(&args, argv); + } + + strvec_pushl(&args, "--bisect", "--", NULL); + + strbuf_read_file(&sb, git_path_bisect_names(), 0); + sq_dequote_to_strvec(sb.buf, &args); + strbuf_release(&sb); + + res = run_command_v_opt(args.v, flags); + strvec_clear(&args); + return res; +} + int cmd_bisect__helper(int argc, const char **argv, const char *prefix) { enum { @@ -1048,7 +1087,8 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) BISECT_STATE, BISECT_LOG, BISECT_REPLAY, - BISECT_SKIP + BISECT_SKIP, + BISECT_VISUALIZE, } cmdmode = 0; int res = 0, nolog = 0; struct option options[] = { @@ -1070,6 +1110,8 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) N_("replay the bisection process from the given file"), BISECT_REPLAY), OPT_CMDMODE(0, "bisect-skip", &cmdmode, N_("skip some commits for checkout"), BISECT_SKIP), + OPT_CMDMODE(0, "bisect-visualize", &cmdmode, + N_("visualize the bisection"), BISECT_VISUALIZE), OPT_BOOL(0, "no-log", &nolog, N_("no log for BISECT_WRITE")), OPT_END() @@ -1131,6 +1173,10 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) get_terms(&terms); res = bisect_skip(&terms, argv, argc); break; + case BISECT_VISUALIZE: + get_terms(&terms); + res = bisect_visualize(&terms, argv, argc); + break; default: BUG("unknown subcommand %d", cmdmode); } diff --git a/git-bisect.sh b/git-bisect.sh index 6a7afaea8d..95f7f3fb8c 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -39,29 +39,6 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" TERM_BAD=bad TERM_GOOD=good -bisect_visualize() { - git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD fail || exit - - if test $# = 0 - then - if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" && - type gitk >/dev/null 2>&1 - then - set gitk - else - set git log - fi - else - case "$1" in - git*|tig) ;; - -*) set git log "$@" ;; - *) set git "$@" ;; - esac - fi - - eval '"$@"' --bisect -- $(cat "$GIT_DIR/BISECT_NAMES") -} - bisect_run () { git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD fail || exit @@ -152,7 +129,7 @@ case "$#" in # Not sure we want "next" at the UI level anymore. git bisect--helper --bisect-next "$@" || exit ;; visualize|view) - bisect_visualize "$@" ;; + git bisect--helper --bisect-visualize "$@" || exit;; reset) git bisect--helper --bisect-reset "$@" ;; replay) From patchwork Thu Sep 2 09:04:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 12471065 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 CD9A1C432BE for ; Thu, 2 Sep 2021 09:05:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B906661051 for ; Thu, 2 Sep 2021 09:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244987AbhIBJGX (ORCPT ); Thu, 2 Sep 2021 05:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244954AbhIBJGU (ORCPT ); Thu, 2 Sep 2021 05:06:20 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC652C061757 for ; Thu, 2 Sep 2021 02:05:22 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id g18so1709136wrc.11 for ; Thu, 02 Sep 2021 02:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u+U3A7uwrSjpldvMAPFF7E24CBpunjpwfcceQ3BE+94=; b=QSj1PtwJ7h/nWkhC2CJCGkW2CWja8Ws+txZPkZnCwwO5c4e8if5BhPhzaOjRB0FUdo sZ74y/vOcY1xITMnxOCIlFRRVy0atXFtvGqgs6KbT1sBbtP9rySV6fDgN8R4kcpRVYug hRnzhTWzuvX5OD6cnoSrTX1TrXARt9b+N0pmDv6lY5hlPQmvXZGzOCX+oXJqNSujUwVj MkWatQgQD8TtEvdZQIEjIi0NiIj4y27cP3QLPwhLcL9dWpk6G3LTFtqxaWVPZwBIyv7W vHtdZeZcesSvwCjHWjX2ZEksrd1ZsaH40tEOTpB+q0v8nu6gGVdWU6tsQFIpQxmwJV1W ScsA== 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=u+U3A7uwrSjpldvMAPFF7E24CBpunjpwfcceQ3BE+94=; b=qsg5FiSLC/3LHherCs7WSXwot/DZcpCpfft8NZGL3GoCs075dKMNJG3vGdOe8TYYJD Rr/+ucyqF1WcmAiorhuuK9s5mlO91/d/2M5Y407H7X3nPKa2/fycDmYoSGarYfUQAvlu DS4i3znzEbPwbXuHC9rOH9c5P4xWEXSXhOdvx8JGrFCZT8UkNvPYeA2ViRVWDrM1Hv93 DlkdneNAA/NYYWei8hQ+j826OqcpJaUFEfMNSTE57i4OaSqrRk4sUh6WktW8rNBrCwx5 K1ESbA+PJeJy0jeoNtZfc6H2YHqYhVF+iseiaDgCEfJBFVBPe9q1HPilwDixLWNdTwN2 ynfg== X-Gm-Message-State: AOAM5307pE/Mlm2KrnbKZISq6VMOB25INdxdQ/7eZGDHjOSiOwUy+SqG CHtK+XTtzHeM5WOEkrk1a/Y1CtQLyjw= X-Google-Smtp-Source: ABdhPJyXQBhi51haRL341Mso+g2vHxDfI4F/pnOviaQcuII/usEUCGGVg+V0VlDHDGNz5F1YLEAzVQ== X-Received: by 2002:adf:9e08:: with SMTP id u8mr2350082wre.383.1630573521325; Thu, 02 Sep 2021 02:05:21 -0700 (PDT) Received: from localhost.localdomain ([178.237.237.111]) by smtp.gmail.com with ESMTPSA id l17sm1262516wrz.35.2021.09.02.02.05.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Sep 2021 02:05:20 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Tanushree Tumane , Christian Couder , Miriam Rubio Subject: [PATCH v6 5/6] bisect--helper: reimplement `bisect_run` shell Date: Thu, 2 Sep 2021 11:04:20 +0200 Message-Id: <20210902090421.93113-6-mirucam@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210902090421.93113-1-mirucam@gmail.com> References: <20210902090421.93113-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Tanushree Tumane Reimplement the `bisect_run()` shell function in C and also add `--bisect-run` subcommand to `git bisect--helper` to call it from git-bisect.sh. Mentored-by: Christian Couder Signed-off-by: Tanushree Tumane Signed-off-by: Miriam Rubio --- builtin/bisect--helper.c | 97 ++++++++++++++++++++++++++++++++++++++++ git-bisect.sh | 62 +------------------------ 2 files changed, 98 insertions(+), 61 deletions(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 1e118a966a..8e9ed9c318 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -18,6 +18,7 @@ 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") static const char * const git_bisect_helper_usage[] = { N_("git bisect--helper --bisect-reset []"), @@ -31,6 +32,7 @@ static const char * const git_bisect_helper_usage[] = { N_("git bisect--helper --bisect-replay "), N_("git bisect--helper --bisect-skip [(|)...]"), N_("git bisect--helper --bisect-visualize"), + N_("git bisect--helper --bisect-run ..."), NULL }; @@ -144,6 +146,19 @@ static int append_to_file(const char *path, const char *format, ...) return res; } +static int print_file_to_stdout(const char *path) +{ + int fd = open(path, O_RDONLY); + int ret = 0; + + if (fd < 0) + return error_errno(_("cannot open file '%s' for reading"), path); + if (copy_fd(fd, 1) < 0) + ret = error_errno(_("failed to read '%s'"), path); + close(fd); + return ret; +} + static int check_term_format(const char *term, const char *orig_term) { int res; @@ -1075,6 +1090,79 @@ static int bisect_visualize(struct bisect_terms *terms, const char **argv, int a return res; } +static int bisect_run(struct bisect_terms *terms, const char **argv, int argc) +{ + int res = BISECT_OK; + struct strbuf command = STRBUF_INIT; + struct strvec args = STRVEC_INIT; + struct strvec run_args = STRVEC_INIT; + const char *new_state; + int temporary_stdout_fd, saved_stdout; + + if (bisect_next_check(terms, NULL)) + return BISECT_FAILED; + + if (argc) + sq_quote_argv(&command, argv); + else { + error(_("bisect run failed: no command provided.")); + return BISECT_FAILED; + } + + strvec_push(&run_args, command.buf); + + while (1) { + strvec_clear(&args); + + printf(_("running %s\n"), command.buf); + res = run_command_v_opt(run_args.v, RUN_USING_SHELL); + + if (res < 0 || 128 <= res) { + error(_("bisect run failed: exit code %d from" + " '%s' is < 0 or >= 128"), res, command.buf); + strbuf_release(&command); + return res; + } + + if (res == 125) + new_state = "skip"; + else + new_state = res > 0 ? terms->term_bad : terms->term_good; + + temporary_stdout_fd = open(git_path_bisect_run(), O_CREAT | O_WRONLY | O_TRUNC, 0666); + saved_stdout = dup(1); + dup2(temporary_stdout_fd, 1); + + res = bisect_state(terms, &new_state, 1); + + dup2(saved_stdout, 1); + close(saved_stdout); + close(temporary_stdout_fd); + + print_file_to_stdout(git_path_bisect_run()); + + if (res == BISECT_ONLY_SKIPPED_LEFT) + error(_("bisect run cannot continue any more")); + else if (res == BISECT_INTERNAL_SUCCESS_MERGE_BASE) { + printf(_("bisect run success")); + res = BISECT_OK; + } else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) { + printf(_("bisect found first bad commit")); + res = BISECT_OK; + } else if (res) { + error(_("bisect run failed:'git bisect--helper --bisect-state" + " %s' exited with error code %d"), args.v[0], res); + } else { + continue; + } + + strbuf_release(&command); + strvec_clear(&args); + strvec_clear(&run_args); + return res; + } +} + int cmd_bisect__helper(int argc, const char **argv, const char *prefix) { enum { @@ -1089,6 +1177,7 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) BISECT_REPLAY, BISECT_SKIP, BISECT_VISUALIZE, + BISECT_RUN, } cmdmode = 0; int res = 0, nolog = 0; struct option options[] = { @@ -1112,6 +1201,8 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) N_("skip some commits for checkout"), BISECT_SKIP), OPT_CMDMODE(0, "bisect-visualize", &cmdmode, N_("visualize the bisection"), BISECT_VISUALIZE), + OPT_CMDMODE(0, "bisect-run", &cmdmode, + N_("use ... to automatically bisect."), BISECT_RUN), OPT_BOOL(0, "no-log", &nolog, N_("no log for BISECT_WRITE")), OPT_END() @@ -1177,6 +1268,12 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) get_terms(&terms); res = bisect_visualize(&terms, argv, argc); break; + case BISECT_RUN: + if (!argc) + return error(_("bisect run failed: no command provided.")); + get_terms(&terms); + res = bisect_run(&terms, argv, argc); + break; default: BUG("unknown subcommand %d", cmdmode); } diff --git a/git-bisect.sh b/git-bisect.sh index 95f7f3fb8c..e83d011e17 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -39,66 +39,6 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" TERM_BAD=bad TERM_GOOD=good -bisect_run () { - git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD fail || exit - - test -n "$*" || die "$(gettext "bisect run failed: no command provided.")" - - while true - do - command="$@" - eval_gettextln "running \$command" - "$@" - res=$? - - # Check for really bad run error. - if [ $res -lt 0 -o $res -ge 128 ] - then - eval_gettextln "bisect run failed: -exit code \$res from '\$command' is < 0 or >= 128" >&2 - exit $res - fi - - # Find current state depending on run success or failure. - # A special exit code of 125 means cannot test. - if [ $res -eq 125 ] - then - state='skip' - elif [ $res -gt 0 ] - then - state="$TERM_BAD" - else - state="$TERM_GOOD" - fi - - git bisect--helper --bisect-state $state >"$GIT_DIR/BISECT_RUN" - res=$? - - cat "$GIT_DIR/BISECT_RUN" - - if sane_grep "first $TERM_BAD commit could be any of" "$GIT_DIR/BISECT_RUN" \ - >/dev/null - then - gettextln "bisect run cannot continue any more" >&2 - exit $res - fi - - if [ $res -ne 0 ] - then - eval_gettextln "bisect run failed: -'bisect-state \$state' exited with error code \$res" >&2 - exit $res - fi - - if sane_grep "is the first $TERM_BAD commit" "$GIT_DIR/BISECT_RUN" >/dev/null - then - gettextln "bisect run success" - exit 0; - fi - - done -} - get_terms () { if test -s "$GIT_DIR/BISECT_TERMS" then @@ -137,7 +77,7 @@ case "$#" in log) git bisect--helper --bisect-log || exit ;; run) - bisect_run "$@" ;; + git bisect--helper --bisect-run "$@" || exit;; terms) git bisect--helper --bisect-terms "$@" || exit;; *) From patchwork Thu Sep 2 09:04:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Miriam R." X-Patchwork-Id: 12471067 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 20376C43216 for ; Thu, 2 Sep 2021 09:05:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08FB1610A1 for ; Thu, 2 Sep 2021 09:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245002AbhIBJGY (ORCPT ); Thu, 2 Sep 2021 05:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244999AbhIBJGV (ORCPT ); Thu, 2 Sep 2021 05:06:21 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A7D7C061757 for ; Thu, 2 Sep 2021 02:05:23 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id q11so1713677wrr.9 for ; Thu, 02 Sep 2021 02:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U1IYr6wSLSOS9ynBQprCVzNN5PqVHGvk59TqSNhbNSc=; b=N1wwlQPDS9uQ4OoQS6u6h7WfFKtvKYhTp4nlGVs/wUk9sJIgAaqwvhM0DORvLr8VAq +ylkmYZdSx5EFWH66twUnnqqFshDp3/7f3RGbWdPLFouDx1aADDM0L314HqQde/0lZFC ncT7UCIEKWJmXDZbrJSH02I5Se3vivy+zwslNCGCPXk9paEuIEi6O+r4akY215pNddXH Ivo4dnIOUTrsxn+xxNsakjaTzu6QRdfGrAP5ArLkPOK0n6MbUGwOCh4HZxvohEXdUwea uZkC/ODGYjtSgFF0nqwPud7oSyRYKdc8t2hhsKKq983zzbxD8NLKdd/U5pD+R3+XUdV2 s40g== 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=U1IYr6wSLSOS9ynBQprCVzNN5PqVHGvk59TqSNhbNSc=; b=sRN2keFrrx6OinB7L/Tnz9LuOHOsG4hf/OqnJVbpvrjufEmFMajAZ2IRTWrDV5jW/S inhXu8UtRQF3jIIGkGmEFR+KbgouJiubMl/fNIH7YUal9ucRl2PEUC2YNjMWruQdu7S5 SXCv+UZAArMscOWIq0lJxJo2L0LXu9/7J7gbT3n6zh08ZswZLUrbvg/Ue/2mJ8uyxv98 30XdiFpZrtLRdtCMJ44YvjpULu/Y1s8KIZUx3jJIMTt1dANi0LVKsUfan19XRQup6HDH 9BB5tNIzL6iY6+ENKn7ncxnXTMIIn4mTa4nO2UYbyxDUrZVUwe7i6cL/zeA/qNTgPmbn P6kg== X-Gm-Message-State: AOAM530MOC/HhBBOozInE2gE2wrKmKfGBPmx9kex2teI9HnWnlBgW9Y1 pgCEDLT31dA+MEynnTQ4BXgt27H+4i8= X-Google-Smtp-Source: ABdhPJzEJg595Ieq13NnAx7opyDvDha8MxIA6/jkBNZL7iq0F1fZ0HBwZdi5DRaGsor3xLUemoMyqw== X-Received: by 2002:adf:80e2:: with SMTP id 89mr2341601wrl.43.1630573522108; Thu, 02 Sep 2021 02:05:22 -0700 (PDT) Received: from localhost.localdomain ([178.237.237.111]) by smtp.gmail.com with ESMTPSA id l17sm1262516wrz.35.2021.09.02.02.05.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Sep 2021 02:05:21 -0700 (PDT) From: Miriam Rubio To: git@vger.kernel.org Cc: Miriam Rubio Subject: [PATCH v6 6/6] bisect--helper: retire `--bisect-next-check` subcommand Date: Thu, 2 Sep 2021 11:04:21 +0200 Message-Id: <20210902090421.93113-7-mirucam@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210902090421.93113-1-mirucam@gmail.com> References: <20210902090421.93113-1-mirucam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org After reimplementation of `git bisect run` in C, `--bisect-next-check` subcommand is not needed anymore. Let's remove it from options list and code. Mentored by: Christian Couder Signed-off-by: Miriam Rubio --- builtin/bisect--helper.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 8e9ed9c318..10c4cd24a1 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -22,7 +22,6 @@ static GIT_PATH_FUNC(git_path_bisect_run, "BISECT_RUN") static const char * const git_bisect_helper_usage[] = { N_("git bisect--helper --bisect-reset []"), - N_("git bisect--helper --bisect-next-check []"), N_("git bisect--helper --bisect-terms [--term-good | --term-old | --term-bad | --term-new]"), N_("git bisect--helper --bisect-start [--term-{new,bad}= --term-{old,good}=]" " [--no-checkout] [--first-parent] [ [...]] [--] [...]"), @@ -1222,12 +1221,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) return error(_("--bisect-reset requires either no argument or a commit")); res = bisect_reset(argc ? argv[0] : NULL); break; - case BISECT_NEXT_CHECK: - if (argc != 2 && argc != 3) - return error(_("--bisect-next-check requires 2 or 3 arguments")); - set_terms(&terms, argv[1], argv[0]); - res = bisect_next_check(&terms, argc == 3 ? argv[2] : NULL); - break; case BISECT_TERMS: if (argc > 1) return error(_("--bisect-terms requires 0 or 1 argument"));