From patchwork Thu Sep 2 16:01:08 2021 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: 12471967 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 27A08C4320E for ; Thu, 2 Sep 2021 16:01:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FBF2610A1 for ; Thu, 2 Sep 2021 16:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346070AbhIBQCY (ORCPT ); Thu, 2 Sep 2021 12:02:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346051AbhIBQCX (ORCPT ); Thu, 2 Sep 2021 12:02:23 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A532C061575 for ; Thu, 2 Sep 2021 09:01:24 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id x2-20020a1c7c02000000b002e6f1f69a1eso1822145wmc.5 for ; Thu, 02 Sep 2021 09:01:24 -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=RtUsyAeUJ/k3K/euNY0PPsbF71kIwpn8u21Z004kHhI=; b=d8FRVNa0MZ3aeF6uppFFkrVfddc4cdbthjQ8mZoqYEtpGtTBkq8i4wo0rS/Dzbnr6D hBtfuSV6sYO3EeiHutbFG0GryCAi+IdGzkfmAAJII1LCwPaF2bP5QZf2VSFj4wFcZZmk zzffVbw2gZa7/tn2PMLtx7QQ+Lkw1y8caq+uE2z4UDXjja916lMtyicdLS2C9uruVrIP KZ/civ8V+DN/zT4blTBNIilqT93cYQF7TL/6VFUgb1iKcZ5toZEpK7yFOzxIDEq67Ku2 d0H6gULN2RiYGvWFyBeDPe7Rbtx8c/3E02AEVBwhQj7dla58rmWk/QZGLjvlMCae5dVD x8Gw== 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=RtUsyAeUJ/k3K/euNY0PPsbF71kIwpn8u21Z004kHhI=; b=Bsqmv0nXaSYi5XYBOFRNSe8HWtPQZxOgkSmkSYGhhM9vxO5GKDTS04JpUpN6jVPMes b2k1tj7u+/BLp/BY5FzQGVe5G55oFBBCAXmc3edXndcRPI1QjCJruz/Juf1rQ3/GLgbh 56zHW/c7Vs4NVZxjF+TcNBJm6maAJppgCVQTl9HREWwLcSqT5fG1u6C8/eccAOKMTPWi nvzOaWLqFF15Yvmo1537KAdP7sVvIOug8Cfriw6KXc8cbyq3kAxCDDiduYT5q0RHGCzO viyuDbbIJHlLoyu4QyTaFKZW9AFvsDEupiqEZH2uPDilbsXCuOH4AT0wtsXDWe4jocn1 ZrQw== X-Gm-Message-State: AOAM532C83JWPtNjWzkqfFhd916CrOjnB38fNIE68+fux5V4B/4AzCVB 1ZxegkjFPauNl5BYdir2zZZt2eeGPL6DYQ== X-Google-Smtp-Source: ABdhPJy42zVvB4MYk4nbuWsBY8ewrT2hx6lI/fs9zfV6+h1msQ16LRY1qo8FrehwsRGESaguROtLBQ== X-Received: by 2002:a7b:c097:: with SMTP id r23mr3956492wmh.114.1630598482761; Thu, 02 Sep 2021 09:01:22 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id u26sm2403215wrd.32.2021.09.02.09.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 09:01:22 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Johannes Schindelin , Eric Wong , Prathamesh Chavan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 1/9] git-sh-setup: remove unused set_reflog_action() function Date: Thu, 2 Sep 2021 18:01:08 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.814.gb82868f05f3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove the set_reflog_action() function last used in the git-legacy-rebase.sh script removed in d03ebd411c6 (rebase: remove the rebase.useBuiltin setting, 2019-03-18). When the documentation I'm removing from git.txt was added in c3e2d18996e (setup_reflog_action: document the rules for using GIT_REFLOG_ACTION, 2013-06-19) we had git-pull.sh, git-am.sh and git-rebase.sh using this in-tree, an addition to various example scripts later removed in 49eb8d39c78 (Remove contrib/examples/*, 2018-03-25). Since this part of the documentation was aimed at those writing scripts in git.git we're long past the point where we should remove it, this still leaves the description of the GIT_REFLOG_ACTION variable. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/git-sh-setup.txt | 7 ------ Documentation/git.txt | 4 ---- git-sh-setup.sh | 42 ---------------------------------- 3 files changed, 53 deletions(-) diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt index 8632612c31d..1ae15905492 100644 --- a/Documentation/git-sh-setup.txt +++ b/Documentation/git-sh-setup.txt @@ -40,13 +40,6 @@ die:: usage:: die with the usage message. -set_reflog_action:: - Set `GIT_REFLOG_ACTION` environment to a given string (typically - the name of the program) unless it is already set. Whenever - the script runs a `git` command that updates refs, a reflog - entry is created using the value of this string to leave the - record of what command updated the ref. - git_editor:: runs an editor of user's choice (GIT_EDITOR, core.editor, VISUAL or EDITOR) on a given file, but error out if no editor is specified diff --git a/Documentation/git.txt b/Documentation/git.txt index 6dd241ef838..38bc1403313 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -857,10 +857,6 @@ for full details. track of the reason why the ref was updated (which is typically the name of the high-level command that updated the ref), in addition to the old and new values of the ref. - A scripted Porcelain command can use set_reflog_action - helper function in `git-sh-setup` to set its name to this - variable when it is invoked as the top level command by the - end user, to be recorded in the body of the reflog. `GIT_REF_PARANOIA`:: If set to `1`, include broken or badly named refs when iterating diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 10d97641856..ee6935ca455 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -106,48 +106,6 @@ $LONG_USAGE")" esac fi -# Set the name of the end-user facing command in the reflog when the -# script may update refs. When GIT_REFLOG_ACTION is already set, this -# will not overwrite it, so that a scripted Porcelain (e.g. "git -# rebase") can set it to its own name (e.g. "rebase") and then call -# another scripted Porcelain (e.g. "git am") and a call to this -# function in the latter will keep the name of the end-user facing -# program (e.g. "rebase") in GIT_REFLOG_ACTION, ensuring whatever it -# does will be record as actions done as part of the end-user facing -# operation (e.g. "rebase"). -# -# NOTE NOTE NOTE: consequently, after assigning a specific message to -# GIT_REFLOG_ACTION when calling a "git" command to record a custom -# reflog message, do not leave that custom value in GIT_REFLOG_ACTION, -# after you are done. Other callers of "git" commands that rely on -# writing the default "program name" in reflog expect the variable to -# contain the value set by this function. -# -# To use a custom reflog message, do either one of these three: -# -# (a) use a single-shot export form: -# GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: preparing frotz" \ -# git command-that-updates-a-ref -# -# (b) save the original away and restore: -# SAVED_ACTION=$GIT_REFLOG_ACTION -# GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: preparing frotz" -# git command-that-updates-a-ref -# GIT_REFLOG_ACITON=$SAVED_ACTION -# -# (c) assign the variable in a subshell: -# ( -# GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: preparing frotz" -# git command-that-updates-a-ref -# ) -set_reflog_action() { - if [ -z "${GIT_REFLOG_ACTION:+set}" ] - then - GIT_REFLOG_ACTION="$*" - export GIT_REFLOG_ACTION - fi -} - git_editor() { if test -z "${GIT_EDITOR:+set}" then From patchwork Thu Sep 2 16:01:09 2021 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: 12471969 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 0429CC432BE for ; Thu, 2 Sep 2021 16:01:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF54B610A4 for ; Thu, 2 Sep 2021 16:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346078AbhIBQCZ (ORCPT ); Thu, 2 Sep 2021 12:02:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346068AbhIBQCY (ORCPT ); Thu, 2 Sep 2021 12:02:24 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7798EC061575 for ; Thu, 2 Sep 2021 09:01:25 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 79-20020a1c0452000000b002e6cf79e572so1840717wme.1 for ; Thu, 02 Sep 2021 09:01:25 -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=1r/Sx1tYCdPTm8SfL6TPtqQYj+vz+2NjwlOh67XSVLY=; b=Kc0p5GPZdIPbcGHpaz4nycXyUXCwBSGc3U/5avn3fYJFnUK48qTJqyl3ROwAuFqNU3 jB6JeJjLdPrb2NxCy7MDL/Dq19QBhNiFk/cYiLC5LhkUc17kKEUcI8dbjxe33/eGVZxZ bQ8nKViaz5733dFxWvky2kbglmcDtVDo5L18W3+jpVLZFCLh3SAa0XAkBTy3t6XF/eGm XSWXrc6g3KozjdT33szOyGstnn4+Uxf78oCbhp2d1NpGNKrHAwB8+XSIsIG6Rv0Gevf8 HNCE8UAiUdG0mqhgrVl3DF4RrPy3vdtParUVLCMZsbmET+GX5rITE6nXQSIZA5I21QMz bRdQ== 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=1r/Sx1tYCdPTm8SfL6TPtqQYj+vz+2NjwlOh67XSVLY=; b=qYUi3ApW0vC2DoAWtBORXHjrb2QgHj2NJ3pI4WKa8rTuc1tVTfxmbcrNPzWMPZElHw ha3lcDZDmlE8FrdbUpsvTbxl6s/7zLIJX00XkCOn2dAVcYzCnFIqFLmZRDGiGmSIZmhF D7EkRigVAuezX2EukOHplfBMXy7+ZLdWYWkW8XSASkkBdgMxC5ERaetRjDQGhMFYvtz9 J3Hu5Bpy5OnywpfVQs07u2zlBy2oRWtkRv1o5FjTc17eUzdbTWYbuvUZ+vYEsU8XJHLC FqB5RthRLl++DD/sSaexfZaihdE78a9x75S3j/XqxR8+UDfDgKfMHka6knWvNOhbvsVw FZdQ== X-Gm-Message-State: AOAM531ZqvAuSQDOhInoI1ND/vkbCNqd/huSXlzG12siW1FttEIigNHH A3sndKri/yDEGTlheixDQgVGcNtaWcmLzw== X-Google-Smtp-Source: ABdhPJwJruxb5F6e/pUEEo0zTz4qU/Oz3yS6X0j/EYBTzs4mwoSR9WwYTmbS6btM5yKY1nDc5uxDRQ== X-Received: by 2002:a7b:c855:: with SMTP id c21mr4003796wml.0.1630598483821; Thu, 02 Sep 2021 09:01:23 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id u26sm2403215wrd.32.2021.09.02.09.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 09:01:23 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Johannes Schindelin , Eric Wong , Prathamesh Chavan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 2/9] git-sh-setup: remove unused git_editor() function Date: Thu, 2 Sep 2021 18:01:09 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.814.gb82868f05f3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove the git_editor() function last referenced in 49eb8d39c78 (Remove contrib/examples/*, 2018-03-25). Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/git-sh-setup.txt | 5 ----- git-sh-setup.sh | 9 --------- 2 files changed, 14 deletions(-) diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt index 1ae15905492..2a28361cf66 100644 --- a/Documentation/git-sh-setup.txt +++ b/Documentation/git-sh-setup.txt @@ -40,11 +40,6 @@ die:: usage:: die with the usage message. -git_editor:: - runs an editor of user's choice (GIT_EDITOR, core.editor, VISUAL or - EDITOR) on a given file, but error out if no editor is specified - and the terminal is dumb. - is_bare_repository:: outputs `true` or `false` to the standard output stream to indicate if the repository is a bare repository diff --git a/git-sh-setup.sh b/git-sh-setup.sh index ee6935ca455..cfedda79471 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -106,15 +106,6 @@ $LONG_USAGE")" esac fi -git_editor() { - if test -z "${GIT_EDITOR:+set}" - then - GIT_EDITOR="$(git var GIT_EDITOR)" || return $? - fi - - eval "$GIT_EDITOR" '"$@"' -} - git_pager() { if test -t 1 then From patchwork Thu Sep 2 16:01:10 2021 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: 12471971 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 BC759C43214 for ; Thu, 2 Sep 2021 16:01:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9FCA260FDA for ; Thu, 2 Sep 2021 16:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346077AbhIBQC0 (ORCPT ); Thu, 2 Sep 2021 12:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346074AbhIBQCZ (ORCPT ); Thu, 2 Sep 2021 12:02:25 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9472BC061575 for ; Thu, 2 Sep 2021 09:01:26 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id b10so3812485wru.0 for ; Thu, 02 Sep 2021 09:01:26 -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=PlY8tfqzNoNZPApKXO/wLV251WT7R8KTVw5X+1l2V9Y=; b=XQkK+jfiEDHuk3VudNN3pOODUR1EH17po5SFmmJHgSyjAPL0h7ciH5jq3FnpIsOe+g AoiVBs4evfdurXTQwR3eIMaYhAaugW3BpTpv1BtUuFnUrtLg/RLdX5T6QsBtH9clZUYp yLR6pVVxWvH0Lqqn/L33saKnKIUxLjNDE7whaidrExArLzkdOjOKMYyN30DFzNQ0jmhk ELjVxE76zU/y1E3jWqIrXUGTp3ytWIxFVFDTsD1KbUylMYqgtC3d3Ozlbto1GmSIuPfq dPhWP4dnCwr+2w5ppJpK9o2DcYyD1Chn326dFHvai1bK0SPwXHAYayvQWZUxqLngNTdv MO4w== 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=PlY8tfqzNoNZPApKXO/wLV251WT7R8KTVw5X+1l2V9Y=; b=Ok6ByUz60qF2cnkk6k+U4btyuCikHK8uosxnRm786wtuwDf3M26JMy7w726nQlfqjj Pj+fBUFAWGVexwDjXa+CRNXq0EvVzR5sqHvG++chW9wvbvQyRoTjOElMmd4Qb9N4Rc97 09CvISinMDheNG7blAgByQ+NK6qOV0nKiHRK5tplj8kjU9lo8FaR8LqnHqzOMdneZaLH 703at+97GGAeGVxYxuYBkNWrGAFJWrjTURvVR1orwxgZLiIg8xr1KyvWr2E3s7JwZhDr 6tQIl+fTrKrGirlRWOeBqj73Gc1JUDxdtbDcwoMrFFZ9czJrP81Kc1dptOrVlTWjN9xF KZTQ== X-Gm-Message-State: AOAM5309Tmta9JT1b2lftb4D9Wk6w3iqtH6A087vilZv2P4vPbstRT4O d+SCsA8YS+Y2q1+VAzRrOOebtxLh2CQHRA== X-Google-Smtp-Source: ABdhPJzVv8yXuHoqjAKtSiDWSjcmnRigDd3AjCNU2YZYMMpnoLzL4hJw3Ea3MlwkOvQjvRPg4cnz9Q== X-Received: by 2002:adf:c149:: with SMTP id w9mr4631062wre.126.1630598484835; Thu, 02 Sep 2021 09:01:24 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id u26sm2403215wrd.32.2021.09.02.09.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 09:01:24 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Johannes Schindelin , Eric Wong , Prathamesh Chavan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 3/9] git-sh-setup: remove unused git_pager() function Date: Thu, 2 Sep 2021 18:01:10 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.814.gb82868f05f3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove the git_editor() function last referenced by non-test code code in 49eb8d39c78 (Remove contrib/examples/*, 2018-03-25). We can also remove the test for this added in 995bc22d7f8 (pager: move pager-specific setup into the build, 2016-08-04), the test that actually matters is the one added in e54c1f2d253 (pager: set LV=-c alongside LESS=FRSX, 2014-01-06) just above the removed test. I.e. we don't care if the "LESS" and "LV" variables are set by git-sh-setup anymore, no built-in uses them, we do care that pager.c sets them, which we still test for. Signed-off-by: Ævar Arnfjörð Bjarmason --- git-sh-setup.sh | 16 ---------------- t/t7006-pager.sh | 13 ------------- 2 files changed, 29 deletions(-) diff --git a/git-sh-setup.sh b/git-sh-setup.sh index cfedda79471..d4e8225affa 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -106,22 +106,6 @@ $LONG_USAGE")" esac fi -git_pager() { - if test -t 1 - then - GIT_PAGER=$(git var GIT_PAGER) - else - GIT_PAGER=cat - fi - for vardef in @@PAGER_ENV@@ - do - var=${vardef%%=*} - eval ": \"\${$vardef}\" && export $var" - done - - eval "$GIT_PAGER" '"$@"' -} - sane_grep () { GREP_OPTIONS= LC_ALL=C grep @@SANE_TEXT_GREP@@ "$@" } diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh index 0e7cf75435e..08f712a4497 100755 --- a/t/t7006-pager.sh +++ b/t/t7006-pager.sh @@ -49,19 +49,6 @@ test_expect_success TTY 'LESS and LV envvars are set for pagination' ' grep ^LV= pager-env.out ' -test_expect_success !MINGW,TTY 'LESS and LV envvars set by git-sh-setup' ' - ( - sane_unset LESS LV && - PAGER="env >pager-env.out; wc" && - export PAGER && - PATH="$(git --exec-path):$PATH" && - export PATH && - test_terminal sh -c ". git-sh-setup && git_pager" - ) && - grep ^LESS= pager-env.out && - grep ^LV= pager-env.out -' - test_expect_success TTY 'some commands do not use a pager' ' rm -f paginated.out && test_terminal git rev-list HEAD && From patchwork Thu Sep 2 16:01:11 2021 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: 12471973 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 17F00C4320E for ; Thu, 2 Sep 2021 16:01:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01D69610A2 for ; Thu, 2 Sep 2021 16:01:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346082AbhIBQC1 (ORCPT ); Thu, 2 Sep 2021 12:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346072AbhIBQC0 (ORCPT ); Thu, 2 Sep 2021 12:02:26 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60F4FC061575 for ; Thu, 2 Sep 2021 09:01:27 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id b6so3751620wrh.10 for ; Thu, 02 Sep 2021 09:01:27 -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=u8a5Vuu6yPoZU9MjFcGZGGWQiy3kcWsPYU19eTRnzTI=; b=nsc+5NwLRz0yTSDoCwXMvETTQi91uOCXL2TVma5Yw5ZUdCnEADqRj29RcHNkzeETUb LqJXTHa/xmgV+F72hmvefW51LE5+ml3c+W8YLXNcMuK/KWvPg8v6UT2qF79xAGsb67fC 5RodgiB7tuxLzuoAn1qvIGL1wMSOQbqnpzi2paa0ICVdJsVz2GajND1d9PYv0DHQYsPm OMvkWI0NBlsv6VHAmDjCnaawI5zkyFwlmhSM+XsnV4KI6MYEehyx9Q5N46Y8l/sNl9W1 3viT8OcFYSowCuhF9yRigqwYqdFGp35ULwwRZM6IA13SztV+53tK1cBqp93vCeme7QGc Hy+g== 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=u8a5Vuu6yPoZU9MjFcGZGGWQiy3kcWsPYU19eTRnzTI=; b=CpxX0uxCX1xZDBfB76GgBZB1G1NPUJ1/WPi0OMOWZPknLVe0zVTYIjjoW9itdT46Ia zC4Lf0P9TRBPGItN/Es4GG0ks9OfskAP/T/vZFF7BSNHhMObn+00E4+ei4z2PmNgLM8f 4H9RAQQaya8aepcNBPZygp4w+NwXxF9BpiT9J8s7TbO9SFOpP2pvgVjn6H2rVxd+hwce kq8C9hvFpZYKQICquRwLy5SrSaY9cFy+k7Zl5lqJFXIXSwfjbMK5suA65eZOKnrWTwCX urCNPazAuK7N1ExIgc0CAJJenVbzOaAD/yfiS8Ygmily3Eh/Ipzdl9sDKKGo65aj4yH2 ca9g== X-Gm-Message-State: AOAM532DrX+KLliXgqNr/v9qoUqY9IAB+PVOtnwXsKuHLJj5b0liQOXh OA9gE/O7aIG13g8as02J956t9NfCYvwjmg== X-Google-Smtp-Source: ABdhPJwEhNjpQhHiyYy2GlQxcNQxZ9Fh4K0aEyHqoQdCr+oa3WTN3yTc2nXW/FMPUODQTbOf2JCJig== X-Received: by 2002:adf:fb91:: with SMTP id a17mr4425282wrr.376.1630598485723; Thu, 02 Sep 2021 09:01:25 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id u26sm2403215wrd.32.2021.09.02.09.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 09:01:25 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Johannes Schindelin , Eric Wong , Prathamesh Chavan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 4/9] git-sh-setup: remove unused sane_egrep() function Date: Thu, 2 Sep 2021 18:01:11 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.814.gb82868f05f3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The is_zero_oid() function in git-submodule.sh has not been used since e83e3333b57 (submodule: port submodule subcommand 'summary' from shell to C, 2020-08-13), so we can remove it, and the sane_egrep() function, dead is_zero_oid() was the only function which still referenced it. Signed-off-by: Ævar Arnfjörð Bjarmason --- git-sh-setup.sh | 4 ---- git-submodule.sh | 5 ----- 2 files changed, 9 deletions(-) diff --git a/git-sh-setup.sh b/git-sh-setup.sh index d4e8225affa..a2a28982b6d 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -110,10 +110,6 @@ sane_grep () { GREP_OPTIONS= LC_ALL=C grep @@SANE_TEXT_GREP@@ "$@" } -sane_egrep () { - GREP_OPTIONS= LC_ALL=C egrep @@SANE_TEXT_GREP@@ "$@" -} - is_bare_repository () { git rev-parse --is-bare-repository } diff --git a/git-submodule.sh b/git-submodule.sh index dbd2ec20503..aeb96c58243 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -63,11 +63,6 @@ isnumber() n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1" } -# Given a full hex object ID, is this the zero OID? -is_zero_oid () { - echo "$1" | sane_egrep '^0+$' >/dev/null 2>&1 -} - # Sanitize the local git environment for use within a submodule. We # can't simply use clear_local_git_env since we want to preserve some # of the settings from GIT_CONFIG_PARAMETERS. From patchwork Thu Sep 2 16:01:12 2021 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: 12471975 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 005C7C433ED for ; Thu, 2 Sep 2021 16:01:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC3C560FDA for ; Thu, 2 Sep 2021 16:01:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346088AbhIBQCe (ORCPT ); Thu, 2 Sep 2021 12:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346094AbhIBQCd (ORCPT ); Thu, 2 Sep 2021 12:02:33 -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 3293CC061796 for ; Thu, 2 Sep 2021 09:01:30 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id u26-20020a05600c441a00b002f66b2d8603so1832257wmn.4 for ; Thu, 02 Sep 2021 09:01:30 -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=SdmvmXia+y1op93cYXwKOTbgaIO/dzVub4roa1ellm4=; b=ZXReraJO3ZRvY4mY3StrM99Twkc/lgbj++caSETetndG5CyHYq39dA2lkIGfRN52d2 W9Uq8oros4UI2Q//F97pZZWzpSLU8SaGUjfGPIQ5KZ4WZksBu4GVpdKxNVbqYw2eVqvb 4uoJPdxsalef4jbBWCcqIrR41YbMbjzmYLzI4R02+PZZYRA7s0B6zMgp/IMl8riExcHj cWmoO7ppll2ViAPTV/h7JMzdQnrfp601Fme7vm5Oc5PMupi+tou4vLbUSxIvR3VQdSwQ ADFSuq3A53BZY9D35gbEQIPRa7G/APY5Fz+l4Bw3Wa69VhOZAHEV5mp8oi7X6MrqgIhJ MAgw== 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=SdmvmXia+y1op93cYXwKOTbgaIO/dzVub4roa1ellm4=; b=lhXsMfwGqfbubFcazBOsbz2dKCGmU6yMSR+g1Jn2kekhNuxQmnhgpzCgjs1oGI6qua zE5uGEOzATq9A18b8d+kDaT+LesBkatWe/pYB0vli4ZqM24fog7SyD696911lrZYZQa3 vm+qZE/3/PZF5yKnoOSuQCpdHOFUPrTlJ9IgTe9btztCfddI/PBgZ6gbCdwk6yWZ0Zpy tCx1JaqF0VDeztFU+t9wjVZrd8lXWXKXXXAAMtg0FYHkSar93lVHzqxIHlpDPccSE6IQ HPpBQ2dCN57Vw4IpxAuq5baWIofe07+HehaJznjgh+0sHob0854zIlSDgYVhuieibwRv 7htA== X-Gm-Message-State: AOAM530nM53J8uiYDNVVFe2YfNa24xEklaVfRTmE6xjzfkFoicORD0Fp 2ECctV1K4iI0GLcGTTVAFNHQuqO6vI2ckQ== X-Google-Smtp-Source: ABdhPJxgTl29bFSotIXga6w+SEswlBehtJ5cFtCgydYklx1sLYuqFxfgsa6AMT+Q+E0hrSxzWr7WIw== X-Received: by 2002:a1c:2246:: with SMTP id i67mr3585054wmi.179.1630598486707; Thu, 02 Sep 2021 09:01:26 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id u26sm2403215wrd.32.2021.09.02.09.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 09:01:26 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Johannes Schindelin , Eric Wong , Prathamesh Chavan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 5/9] git-sh-setup: remove unused require_work_tree_exists() function Date: Thu, 2 Sep 2021 18:01:12 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.814.gb82868f05f3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The last code that used the require_work_tree_exists() function went away in d03ebd411c6 (rebase: remove the rebase.useBuiltin setting, 2019-03-18), let's remove it. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/git-sh-setup.txt | 6 ------ git-sh-setup.sh | 8 -------- 2 files changed, 14 deletions(-) diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt index 2a28361cf66..1d8c87e9b2f 100644 --- a/Documentation/git-sh-setup.txt +++ b/Documentation/git-sh-setup.txt @@ -52,12 +52,6 @@ require_work_tree:: checks if the current directory is within the working tree of the repository, and otherwise dies. -require_work_tree_exists:: - checks if the working tree associated with the repository - exists, and otherwise dies. Often done before calling - cd_to_toplevel, which is impossible to do if there is no - working tree. - require_clean_work_tree []:: checks that the working tree and index associated with the repository have no uncommitted changes to tracked files. diff --git a/git-sh-setup.sh b/git-sh-setup.sh index a2a28982b6d..363c0096842 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -122,14 +122,6 @@ cd_to_toplevel () { } } -require_work_tree_exists () { - if test "z$(git rev-parse --is-bare-repository)" != zfalse - then - program_name=$0 - die "$(eval_gettext "fatal: \$program_name cannot be used without a working tree.")" - fi -} - require_work_tree () { test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true || { program_name=$0 From patchwork Thu Sep 2 16:01:13 2021 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: 12471977 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 EABE3C433B4 for ; Thu, 2 Sep 2021 16:01:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA8B06101A for ; Thu, 2 Sep 2021 16:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346096AbhIBQCf (ORCPT ); Thu, 2 Sep 2021 12:02:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346101AbhIBQCd (ORCPT ); Thu, 2 Sep 2021 12:02:33 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3249FC0613A3 for ; Thu, 2 Sep 2021 09:01:31 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id i6so3763947wrv.2 for ; Thu, 02 Sep 2021 09:01:31 -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=JafKzOC3zrlYrSW/uLPW3JVRbuHlrT5H1URgR28LLiA=; b=NKIrZKimDq8rdhYD67I0wujhBVwZ1G9X/x8pP2JShUtH5IaKS8BttNtyU9bUHzwa/3 aHBoXUX1AF8Zr6DkkWQrgZhwatPRUmUK1JoUhuTqZyPAHApAtBhUPkRdC//4b3JGMwst nshL72UWLpI0NUxpb45INHKV7RvoF/tINwoXn1YKI1phUrTP80RahZeViMrTcaHEkbm0 0BQKGz7obFn7/99hGJluJsfTdDlFVWd1ENhMNeanbBPSMhOBbAhyURpGyhDNoS87mD3Z qBtwa71hFHpWEQqhTMI5YzgujXY2ydZ996vjlL1JfaL55ho6ssXPmx2eadKrCJbqJxNr 1e1g== 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=JafKzOC3zrlYrSW/uLPW3JVRbuHlrT5H1URgR28LLiA=; b=omY79Up0F2mrmVFam4oasOjeN7ze3+o8UVQfZnA7vOCHPekrNoLKyZVMbchVPDfAK6 ORLcnkyGV2hgWKZL+me4jgbbEGiavrwRcFDu80bt6gppJ0jrPYOr1dy6F6JP75fr5w67 4DNijACdeekr4v26JFwAzX1Oc+iL6ocvxZlr8Fcd+uCxt19OOW0CEG9CFXTVhGZbGQSm JjTnRtnuBnZUEIbY4kEgFSBQjH27gj7U0y1pqtrf+7cm4+B9rLPKn5WJ4Yl02zjxPJnM X7E4Whkh1o5S0CcYmqSBFeJ/qdhUG+QFzpHt/LuNQf/5uvwZCtdfUNKbJDjLsdKznDEx XSjA== X-Gm-Message-State: AOAM531Yx9JORnbD1nhzZKtYJE/rxQH3zrbqb6X6ZgACbjkPr2h5YrKX WwVAShs1u8PBojTBRn9edNAPqResROZN2Q== X-Google-Smtp-Source: ABdhPJzYW9T8hWztuZfpedA482avnPiZDhln8EhQTdSFboEvGxoMaD4RuptjpoH5b4XGmBDNix9+1g== X-Received: by 2002:adf:eb89:: with SMTP id t9mr4855913wrn.66.1630598489518; Thu, 02 Sep 2021 09:01:29 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id u26sm2403215wrd.32.2021.09.02.09.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 09:01:28 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Johannes Schindelin , Eric Wong , Prathamesh Chavan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 6/9] git-sh-setup: move create_virtual_base() to mergetools/p4merge Date: Thu, 2 Sep 2021 18:01:13 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.814.gb82868f05f3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Move the create_virtual_base() function out of "git-sh-setup" to its only user, "mergetools/p4merge". Since 1a92e53ba36 (merge-one-file: use empty blob for add/add base, 2016-02-23) when git-merge-one-file.sh stopped using it, it has only been used in "mergetools/p4merge". Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/git-sh-setup.txt | 6 ------ git-sh-setup.sh | 12 ------------ mergetools/p4merge | 12 ++++++++++++ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt index 1d8c87e9b2f..2febe754206 100644 --- a/Documentation/git-sh-setup.txt +++ b/Documentation/git-sh-setup.txt @@ -66,12 +66,6 @@ get_author_ident_from_commit:: outputs code for use with eval to set the GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE variables for a given commit. -create_virtual_base:: - modifies the first file so only lines in common with the - second file remain. If there is insufficient common material, - then the first file is left empty. The result is suitable - as a virtual base input for a 3-way merge. - GIT --- Part of the linkgit:git[1] suite diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 363c0096842..6a21238dc0e 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -238,18 +238,6 @@ clear_local_git_env() { unset $(git rev-parse --local-env-vars) } -# Generate a virtual base file for a two-file merge. Uses git apply to -# remove lines from $1 that are not in $2, leaving only common lines. -create_virtual_base() { - sz0=$(wc -c <"$1") - @@DIFF@@ -u -La/"$1" -Lb/"$1" "$1" "$2" | git apply --no-add - sz1=$(wc -c <"$1") - - # If we do not have enough common material, it is not - # worth trying two-file merge using common subsections. - expr $sz0 \< $sz1 \* 2 >/dev/null || : >"$1" -} - # Platform specific tweaks to work around some commands case $(uname -s) in diff --git a/mergetools/p4merge b/mergetools/p4merge index 7a5b291dd28..23f8735efa2 100644 --- a/mergetools/p4merge +++ b/mergetools/p4merge @@ -19,6 +19,18 @@ diff_cmd () { fi } +# Generate a virtual base file for a two-file merge. Uses git apply to +# remove lines from $1 that are not in $2, leaving only common lines. +create_virtual_base() { + sz0=$(wc -c <"$1") + @@DIFF@@ -u -La/"$1" -Lb/"$1" "$1" "$2" | git apply --no-add + sz1=$(wc -c <"$1") + + # If we do not have enough common material, it is not + # worth trying two-file merge using common subsections. + expr $sz0 \< $sz1 \* 2 >/dev/null || : >"$1" +} + merge_cmd () { if ! $base_present then From patchwork Thu Sep 2 16:01:14 2021 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: 12471979 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 2D20CC433ED for ; Thu, 2 Sep 2021 16:01:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1267B60FDA for ; Thu, 2 Sep 2021 16:01:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232103AbhIBQCg (ORCPT ); Thu, 2 Sep 2021 12:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346107AbhIBQCd (ORCPT ); Thu, 2 Sep 2021 12:02:33 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EBA2C061292 for ; Thu, 2 Sep 2021 09:01:32 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id v10so3756803wrd.4 for ; Thu, 02 Sep 2021 09:01:32 -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=qolNeKZxYbSuGw0L4nFMrT6UXk5Hcoeke3BEUa3OocA=; b=lslreY2dXoQFiFTQO+dq4NqNUUoYVGx5PWUmXIJp8Ch27AsxsjOIsEr5eiYShAc1xx dKaMTzVYIrOa9DICCLZAoGmKMjWZSK9bmvhOy7pPIFSWm/2BP1dieuWUvi9gd4frF+Ky JRsYtanTTjE3Nqe/WMmoxYeY2PgtnChbM2hUZa1rNmpQniKyjYo4e01KAVpnHHB/vDu+ 8atljkLbCkgUQFcCjQRFORDbVu8/qfHr6X54L751jOgy0qnAa2U5CEadFFHUvHvM2yla McmbXrUGYFLFCU47NOW9FXu4SGn+Uy40ySkxyfw0MKT70pGIM5TvDleF6TT+HqcKgxpN OA5Q== 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=qolNeKZxYbSuGw0L4nFMrT6UXk5Hcoeke3BEUa3OocA=; b=WCULasP+YPUPfqFPBn2DJBNL/fKnq1AtdlnKkBvbz9oloZ0e/7QdIctiNySq+rh2Xx Iv5zj7IwWTmyHbRAQaeVS66lzC90s+PSZTbDFn/yeFA6p+O7ibtR7O/IfxfHQ1FBbt4v YM8uHKHeOLT+V1mlSNIMGo/XVLesv/NilnIkvEyw3Nc/uihcG0bCmY804xFHBWgtrzEa J8Gr17Qzu49Sne4d32HenakVLMXpwh7ZgEAWe3fD3F/UnpCvY8fsWcJBE9CyUBfvNdRp UTe84tv6Rzbia66E+2R98dXhEVfNYvj+LgJOsUrXXCS28T3AqpPDU8ursa+wYnsNs0LB AcEg== X-Gm-Message-State: AOAM530O9Sf7neQazMYPsCoAPDWfCJ1Hrc5O7TkC/Bd3/Zjp+snTxTKS zeP1SmmMf5EL49R4rYgivhIDVuaagL9DnQ== X-Google-Smtp-Source: ABdhPJyvzftqbknVl8uB7xeKlLxP3Omjj2O89KAU/JyqgwynNEDklnAUx3uqzwRI4fdjhU4hCiqK/g== X-Received: by 2002:a5d:4568:: with SMTP id a8mr4841998wrc.200.1630598490710; Thu, 02 Sep 2021 09:01:30 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id u26sm2403215wrd.32.2021.09.02.09.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 09:01:30 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Johannes Schindelin , Eric Wong , Prathamesh Chavan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 7/9] git-sh-setup: move peel_committish() function to git-subtree.sh Date: Thu, 2 Sep 2021 18:01:14 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.814.gb82868f05f3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Move the peel_committish() function out of git-sh-setup to its only user, contrib/subtree/git-subtree.sh. Since d03ebd411c6 (rebase: remove the rebase.useBuiltin setting, 2019-03-18) when git-legacy-rebase.sh was removed, it has only been used in git-subtree.sh. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/subtree/git-subtree.sh | 12 ++++++++++++ git-sh-setup.sh | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index 7f767b5c38f..a6deb57bcae 100755 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@ -818,6 +818,18 @@ cmd_add_repository () { cmd_add_commit FETCH_HEAD } +peel_committish () { + case "$1" in + :/*) + peeltmp=$(git rev-parse --verify "$1") && + git rev-parse --verify "${peeltmp}^0" + ;; + *) + git rev-parse --verify "${1}^0" + ;; + esac +} + # Usage: cmd_add_commit REV cmd_add_commit () { # The rev has already been validated by cmd_add(), we just diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 6a21238dc0e..9243353bc21 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -294,15 +294,3 @@ if test -z "$NONGIT_OK" then git_dir_init fi - -peel_committish () { - case "$1" in - :/*) - peeltmp=$(git rev-parse --verify "$1") && - git rev-parse --verify "${peeltmp}^0" - ;; - *) - git rev-parse --verify "${1}^0" - ;; - esac -} From patchwork Thu Sep 2 16:01:15 2021 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: 12471981 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 CBC60C433B4 for ; Thu, 2 Sep 2021 16:01:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFCC160FDA for ; Thu, 2 Sep 2021 16:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346099AbhIBQCj (ORCPT ); Thu, 2 Sep 2021 12:02:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346081AbhIBQCe (ORCPT ); Thu, 2 Sep 2021 12:02:34 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2132CC0612A5 for ; Thu, 2 Sep 2021 09:01:33 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id v10so3756861wrd.4 for ; Thu, 02 Sep 2021 09:01:33 -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=9v7RFIwRe7fpQNRWjZ8Quocz9Rmiz5cTvDNaozRmuRw=; b=Xo91PidMMpGrVVH0w7qymdkeg5pjBEdjnC5kqmKObFL34WTlHkdYdKh8ImlOhPLHM6 8kMnre/hO2QUcD9BwoMXhRYlU7jqF1Za/wK1l35MIm67gChWx8MxnCM26zyV41gTi1OD EXCtiqJ0mpi0PF2r1vkbB/h8PCLZPW8sUIdNezHL6HOGl4ia7KSysweUFPlyQ5XaK30M Tjtg2ngkjRaRs+Xon1jpfD699afkiZl+RZmlHFGPR1RlHePE+ankV+EGVWwwNd7xLIaA O9VHPZweXROXUQ/Hq6uKvlUaEr+7lD3KN40GOxWMt2rJqsRhyNVxUWW6gDXMMLCMkQsc QQ1g== 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=9v7RFIwRe7fpQNRWjZ8Quocz9Rmiz5cTvDNaozRmuRw=; b=YkykEwEVPw1tDiowXjDlMmwNpqwcjRkKG9c3z2Bbw2tF4VHi80rJ7Ida4EZHzpR/p9 yB/xDkUWwOoNbdyhcu1MT7qhXhpdpN3MJe6pH67dvl8ML7V01mv+H0yozZ8y7oH7Z3UL tr2s87CI/bLGXmFY5/pH5UgpkbQgEkCO1tN1MNXwJN/3sI4Fzx8KpJwCWkA3RCTwa6YX dgOI99f6NuyS/d0ziZbukxVewEfWuwz7zh0ESfifh8JRd6U0eGTki4ZYw0MWyX+p+C5i yaKmS28WzjidA/jTgEk5nVxfnkkoJd2j9/JLwKAJ1UJ4gM3Farm1C9e9qMT235eFTpW1 7mhg== X-Gm-Message-State: AOAM532eqYPk7gztHyy+l+Jq05EVyZl5Gsfg4gB6BQxOMfxNtGv4TkuD 7O6HloPwron+8wiHhhiKGYJSLDxJF7a+RA== X-Google-Smtp-Source: ABdhPJwMbJD3UYTv2heThzsWc8qveUKnTHDCueTwuIzLM+y2q+vXbL9uzJ9hdh9PL4kAjvJz8h0Pfw== X-Received: by 2002:adf:fd0a:: with SMTP id e10mr4676715wrr.2.1630598491469; Thu, 02 Sep 2021 09:01:31 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id u26sm2403215wrd.32.2021.09.02.09.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 09:01:30 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Johannes Schindelin , Eric Wong , Prathamesh Chavan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 8/9] git-bisect: remove unused SHA-1 $x40 shell variable Date: Thu, 2 Sep 2021 18:01:15 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.814.gb82868f05f3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This variable was last used in code removed in 06f5608c14 (bisect--helper: `bisect_start` shell function partially in C, 2019-01-02). Signed-off-by: Ævar Arnfjörð Bjarmason --- git-bisect.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/git-bisect.sh b/git-bisect.sh index 6a7afaea8da..b59f3aaad43 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -34,8 +34,6 @@ Please use "git help bisect" to get the full man page.' OPTIONS_SPEC= . git-sh-setup -_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' -_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" TERM_BAD=bad TERM_GOOD=good From patchwork Thu Sep 2 16:01:16 2021 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: 12471983 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 3F8B5C43460 for ; Thu, 2 Sep 2021 16:01:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1902A6101A for ; Thu, 2 Sep 2021 16:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346090AbhIBQCk (ORCPT ); Thu, 2 Sep 2021 12:02:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346086AbhIBQCe (ORCPT ); Thu, 2 Sep 2021 12:02:34 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A7F1C0612A7 for ; Thu, 2 Sep 2021 09:01:34 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id q14so3758307wrp.3 for ; Thu, 02 Sep 2021 09:01:34 -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=tigMh5tp7IkkqTJhDpB0soyTxbfAh5894I8j/tls6CY=; b=O8DCIv0TSsv+czrZ1UnThTy06AiIgGkabMg810akTUktlOQR4msNSGYaQ/AYMxvSQJ WJSqgLy/u5SOiMX4MNHgLOjB8rMN5ifFm/q6vsTycp61bGOvKQZSDdoO0exLTUAwloCC qmkt6Cm5sCGn05zGKY2eENjKMYcjjXkAwLZu0zh3i5N6JkLV60T/THoT+GalZ4KyqUe+ mtd01rGUh1Itzsi/26e7d+sqjFXQv+MaIOo2DiGPLVwCJLejTkTgvHARAMLTMclYZpXM kfCCyrjdsdDRh8VxaFdjb88OadhCpQ/M4CTcLWCEnutpXosrvLP2kRhjs9ygl/XPYbBo 6taA== 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=tigMh5tp7IkkqTJhDpB0soyTxbfAh5894I8j/tls6CY=; b=BiVZb05k93Lm9WdQXyHTPustRk8cf54QeEUsHenGJlpS1/tFjUDo6WZKynhfGcAOFH drRTcgAh6jDaScEEEOWjD24C5Zw7FRr4dmWt7O1tIPN1+rnFeFcaWq9rbAt7WU56wMqu Oh89FUAV7yLH2hbqgZAtAv2J4cwNz6YJeuIlb+NNlQFSWf1fVqkd5/nsH1/yky27qZ0r CwiB+v9HQ3Xc+udmTqrqYWcGaf3CLhR7BdOthq04Cg3sKpJuyYLtczFf6IE/RYyRwyvS HYPXBPTxgUjn0HtH7JXmVT14kUHhPk4RXw7L+0Xd/5dZ87jY4qXZ/ewVrQOp7Fz6JU33 4nXg== X-Gm-Message-State: AOAM530uqEaGf1pa+o6rJ6WFz+MvGzl//34bs272HgwfqiA4gA/BGQ3c IuFhlxDjwPYV4xOfnssqk/CgX74/kw67kw== X-Google-Smtp-Source: ABdhPJxjZvFvr5w+xZP3KpaeKH+T07QHMQTRGKiJOfDG+YfxvNj4SI3o9DNNzD6BCG8++0SWPlhDKw== X-Received: by 2002:adf:d185:: with SMTP id v5mr4534944wrc.378.1630598492621; Thu, 02 Sep 2021 09:01:32 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id u26sm2403215wrd.32.2021.09.02.09.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 09:01:31 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Johannes Schindelin , Eric Wong , Prathamesh Chavan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 9/9] test-lib: remove unused $_x40 and $_z40 variables Date: Thu, 2 Sep 2021 18:01:16 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.814.gb82868f05f3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org These two have fallen out of use with the SHA-256 migration. The last use of $_x40 was removed in fc7e73d7ef (t4013: improve diff-post-processor logic, 2020-08-21) and The last use of $_z40 was removed in 7a868c51c2 (t5562: use $ZERO_OID, 2019-12-21), but it was then needlessly refactored to be hash-agnostic in 192b517589 (t: use hash-specific lookup tables to define test constants, 2020-02-22). We can just remove it. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/test-lib.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index abcfbed6d61..044a9231ae6 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -534,7 +534,7 @@ SQ=\' # when case-folding filenames u200c=$(printf '\342\200\214') -export _x05 _x35 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID OID_REGEX +export _x05 _x35 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID OID_REGEX # Each test should start with something like this, after copyright notices: # @@ -1422,10 +1422,9 @@ then fi # Convenience -# A regexp to match 5, 35 and 40 hexdigits +# A regexp to match 5 and 35 hexdigits _x05='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' _x35="$_x05$_x05$_x05$_x05$_x05$_x05$_x05" -_x40="$_x35$_x05" test_oid_init @@ -1434,7 +1433,6 @@ OID_REGEX=$(echo $ZERO_OID | sed -e 's/0/[0-9a-f]/g') OIDPATH_REGEX=$(test_oid_to_path $ZERO_OID | sed -e 's/0/[0-9a-f]/g') EMPTY_TREE=$(test_oid empty_tree) EMPTY_BLOB=$(test_oid empty_blob) -_z40=$ZERO_OID # Provide an implementation of the 'yes' utility; the upper bound # limit is there to help Windows that cannot stop this loop from