From patchwork Fri Apr 12 09:37:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10897715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 271E313B5 for ; Fri, 12 Apr 2019 09:37:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05DBA28D18 for ; Fri, 12 Apr 2019 09:37:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE87128D2E; Fri, 12 Apr 2019 09:37:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2614128D57 for ; Fri, 12 Apr 2019 09:37:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726867AbfDLJhX (ORCPT ); Fri, 12 Apr 2019 05:37:23 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:41285 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfDLJhV (ORCPT ); Fri, 12 Apr 2019 05:37:21 -0400 Received: by mail-ed1-f66.google.com with SMTP id g6so3788688edc.8 for ; Fri, 12 Apr 2019 02:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=fSib6Aueo4f2tH0P/GdTW+1ikI+DVkU702AgxIHCrso=; b=jRpBrpSGyjbtF5qi/W97m8Jr/U1S026Wxvm0pSe6GeHQdLBCQbLCOZaEVb603ZYsKw qAkSB1EzVBPad10LdQeYyZ4hiT9COaGaX13+qgEx7IWs3oG8FwhW2wvdgD5McJEDyl9k TFJs6Q/exPntvqFIdhv4LANJ3yXGpccppFkvpCuOnP4UV4lT2IhBlw4Q6UlScDrebrK5 Q9UkNPRu7O2r5UjK6w02ISRRf9zDWgdfETEqPJ+NDTWbDqVp3Flq30KDJ19NlJ4Z8Ms0 1x15g2Qp2HhLK5Dhryehd+HMwK4n1D0ATy9RR+jJdG8jK6Ox+ZTEiRrEqnH7m9MPpjEi BlqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=fSib6Aueo4f2tH0P/GdTW+1ikI+DVkU702AgxIHCrso=; b=jodfLZ86Q3jlrSl3uUQE51J9VlebAb+mZzT5007wx1a/eBUOCw6uR1ZiSTCq0Qscen qI8kjR9+vN2whCE/bMHCmGOGrQpRmTJUXeAwh+KBQyizlQy4QJwACK2FKoHiupONcBiW UxOyodImw6VV2eVmml27ZogqBzbX7uFKvOYuaF+I/jyx72+rkQ8MSQZ3LsBfkXCSj3v2 5dzzFAy6wvtD2epExuKUHP6JcsnaO+wXFoL3SommhV6QHjSesCxf0/gQZRZnO1oS9ta0 6IZZBad2yZuthNhySi54PcoIbvjeQZ6oqsSesxE+o4hvJJoOr3zslYqpw4Xk6KxwfnWC qoSw== X-Gm-Message-State: APjAAAWq/Btcy4j2RADErzxgwyxl8q2r4j3NZr2YHjeD8GUw48UV0DBs dqbn4+yMNuY/7MfL4Sa3AAgxoc/m X-Google-Smtp-Source: APXvYqyeSWbg5a7JiFuTN/HGkgvLUm4AckY/d0M5OVPiLheZgmz9DNabRvbRmTDG0engN4HjjdtvYw== X-Received: by 2002:a17:906:e241:: with SMTP id gq1mr9338164ejb.5.1555061839766; Fri, 12 Apr 2019 02:37:19 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id p13sm4106099edx.96.2019.04.12.02.37.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 02:37:19 -0700 (PDT) Date: Fri, 12 Apr 2019 02:37:19 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 09:37:10 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 1/8] tests (rebase): spell out the `--keep-empty` option Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Denton Liu , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin This test wants to run `git rebase` with the `--keep-empty` option, but it really only spelled out `--keep` and trusted Git's option parsing to determine that this was a unique abbreviation of the real option. However, Denton Liu contributed a patch series in https://public-inbox.org/git/cover.1553354374.git.liu.denton@gmail.com/ that introduces a new `git rebase` option called `--keep-base`, which makes this previously unique abbreviation non-unique. Whether this patch series is accepted or not, it is actually a bad practice to use abbreviated options in our test suite, because of the issue that those unique option names are not guaranteed to stay unique in the future. So let's just not use abbreviated options in the test suite. Signed-off-by: Johannes Schindelin --- t/t5407-post-rewrite-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh index a4a5903cba..7344253bfb 100755 --- a/t/t5407-post-rewrite-hook.sh +++ b/t/t5407-post-rewrite-hook.sh @@ -131,7 +131,7 @@ test_expect_success 'git rebase -m --skip' ' test_expect_success 'git rebase with implicit use of interactive backend' ' git reset --hard D && clear_hook_input && - test_must_fail git rebase --keep --onto A B && + test_must_fail git rebase --keep-empty --onto A B && echo C > foo && git add foo && git rebase --continue && @@ -146,7 +146,7 @@ test_expect_success 'git rebase with implicit use of interactive backend' ' test_expect_success 'git rebase --skip with implicit use of interactive backend' ' git reset --hard D && clear_hook_input && - test_must_fail git rebase --keep --onto A B && + test_must_fail git rebase --keep-empty --onto A B && test_must_fail git rebase --skip && echo D > foo && git add foo && From patchwork Fri Apr 12 09:37:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10897705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8946913B5 for ; Fri, 12 Apr 2019 09:37:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71F4928D18 for ; Fri, 12 Apr 2019 09:37:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63D2528D57; Fri, 12 Apr 2019 09:37:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DC0B28D18 for ; Fri, 12 Apr 2019 09:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726877AbfDLJhX (ORCPT ); Fri, 12 Apr 2019 05:37:23 -0400 Received: from mail-ed1-f47.google.com ([209.85.208.47]:33534 "EHLO mail-ed1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726735AbfDLJhW (ORCPT ); Fri, 12 Apr 2019 05:37:22 -0400 Received: by mail-ed1-f47.google.com with SMTP id d55so6962003ede.0 for ; Fri, 12 Apr 2019 02:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=fGOHtPvcjQ3mSuxQl3i9SrO/790cDVD9LJUo8dfEDe8=; b=N2T2tqO9pLHukp8hEqYRoUvafrKkKeGPVrrZ77ad1pUaszdWdDhlOc1fPwubwvV1Wl Pf8HBoz+LU0XiymCyBzsa2H4FOMO2UB9MT3O2rUvQOTPZfcY0nlidUym9abYg0MTkoQ2 wsI4vHQzznrK1s2bDd/DVbw0AFn3FG1bZjpJi1JWj6iJfSyxlRU2suAQZKCTzoOPRvDZ HEztZZxjJ5cq5AwEpDIij0vJ1CNwUOlSF3r3f904gE5VmVA5YUJN7jWGmb6qV6Zk46I/ VsWOmkkcM9/EqkA/us/fdNKcDeiF1VFK0D2kIgnO98N4fSatoYKrbYPEeoevNFeOI4mB zgAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=fGOHtPvcjQ3mSuxQl3i9SrO/790cDVD9LJUo8dfEDe8=; b=rJnvxfXCGXjzfBLsXKImSGOyxzTPoOa68zuhDE3VBXjENZa28aOPH6Y/5/XLr7SnWr 4as9nKV5hLzaE9jOPLEWhBwcJ7DVw/04UyTO6cZgWcRMGoOWg6Z2xUNvId3IJBLkFKeR R9MOzwKw077TchTFwun3oHuCOVneVlFpDCAnvbDgeH2CnNHUhUtQ9GVMejswu6xDC4l5 eW5mOLhxzl3F0Go//ybWDgJplKY3v8iVuvRj/NX/axKf2bUuaZ98aNXAf9qRz24P9lKP MvisjkiN76DgnyK34nWE2+l8S3ubRPVApmthMYjVKT+e23Fjpl8S0Ta4Yv2vFyiv6uAp dOyw== X-Gm-Message-State: APjAAAWKB3l8tTcV0iHOPtM70vh6yLqgz8UyuW3utSLjI7XSvHANYmel XqD6TwVRrqCNeXXlZ5foyyiEGgL3 X-Google-Smtp-Source: APXvYqwEY4Z/kg+i48d66iosutfopfOm/oS8zkFL6aMW8b1Rpt8lS5a3mW5R6tvsJN9tTKph7Brn/Q== X-Received: by 2002:a50:b5c3:: with SMTP id a61mr29349119ede.31.1555061840565; Fri, 12 Apr 2019 02:37:20 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id i8sm11861976eda.1.2019.04.12.02.37.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 02:37:20 -0700 (PDT) Date: Fri, 12 Apr 2019 02:37:20 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 09:37:11 GMT Message-Id: <017ec9a0c74c770a42843eef65f49b7cc4397728.1555061837.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 2/8] tests (rebase): spell out the `--force-rebase` option Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Denton Liu , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin In quite a few test cases, we were sloppy and used the abbreviation `--force`, but we really should be precise in what we want to test. Signed-off-by: Johannes Schindelin --- t/t3415-rebase-autosquash.sh | 2 +- t/t3430-rebase-merges.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh index 13f5688135..22d218698e 100755 --- a/t/t3415-rebase-autosquash.sh +++ b/t/t3415-rebase-autosquash.sh @@ -277,7 +277,7 @@ test_expect_success 'autosquash with empty custom instructionFormat' ' ( set_cat_todo_editor && test_must_fail git -c rebase.instructionFormat= \ - rebase --autosquash --force -i HEAD^ >actual && + rebase --autosquash --force-rebase -i HEAD^ >actual && git log -1 --format="pick %h %s" >expect && test_cmp expect actual ) diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh index 4c69255ee6..42ba5b9f09 100755 --- a/t/t3430-rebase-merges.sh +++ b/t/t3430-rebase-merges.sh @@ -271,7 +271,7 @@ test_expect_success 'root commits' ' EOF test_config sequence.editor \""$PWD"/replace-editor.sh\" && test_tick && - git rebase -i --force --root -r && + git rebase -i --force-rebase --root -r && test "Parsnip" = "$(git show -s --format=%an HEAD^)" && test $(git rev-parse second-root^0) != $(git rev-parse HEAD^) && test $(git rev-parse second-root:second-root.t) = \ @@ -364,7 +364,7 @@ test_expect_success 'octopus merges' ' test_cmp_rev HEAD $before && test_tick && - git rebase -i --force -r HEAD^^ && + git rebase -i --force-rebase -r HEAD^^ && test "Hank" = "$(git show -s --format=%an HEAD)" && test "$before" != $(git rev-parse HEAD) && test_cmp_graph HEAD^^.. <<-\EOF From patchwork Fri Apr 12 09:37:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10897713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5C6A13B5 for ; Fri, 12 Apr 2019 09:37:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD47C28D36 for ; Fri, 12 Apr 2019 09:37:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B170028D62; Fri, 12 Apr 2019 09:37:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50BAC28D36 for ; Fri, 12 Apr 2019 09:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726912AbfDLJha (ORCPT ); Fri, 12 Apr 2019 05:37:30 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:44297 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbfDLJhX (ORCPT ); Fri, 12 Apr 2019 05:37:23 -0400 Received: by mail-ed1-f67.google.com with SMTP id d11so7732505edp.11 for ; Fri, 12 Apr 2019 02:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Vwnvz2KiiTfEUjy+0TI9zX00UK2D7BQp/26Y5Y1Hfg8=; b=ONxGCu1QXR0BgwFFPNx+R/4XbYQvx7r+wTQeXsCRhHO0wjIXThk7efDPk/Ec2jVelh 1xP1O9pKnGO2+aX6uASdWJcU2dvuG4y8BBlOHDyNA9RNhOoxuDStBRJL2CBBRhUVC1C8 xlNOMzyv982Tvt/BgyrW9wT+mAtW/cpN3fm9WXtSlEZfU1AYxGURjkqPjRdekTWM9xOw gJKuDQW776B5PMrUHFTtw9ChVBvYGEGB+34u78OSKtjhIeafXMJC158d2yY8ta3ekZRo bXGXNN25qtk99QsKGMQXKBjpYxfEyxHa4+0jNhWgv0cjsXSz29v8c3mVemWQ5E5KNCaT EyvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Vwnvz2KiiTfEUjy+0TI9zX00UK2D7BQp/26Y5Y1Hfg8=; b=Yt2UYOSMpzDxBULYo61I7zxsOxvPIqkhHQ1+LjLiwXBkVORSDmN19vjDo8HCI5yenA ooNGsBH/e42pytJNOJOjmiPOB8/TorHKjMgkf95Gg8Vfsarxzj9fT6yEHcjtxyaM12w2 TJKZH7FNOUxHwuXh6pN66xD+LqBmpnr7Xcz5lhjjMjdZLl52aVJO6rG8hdzNziXykp4G qIElbWY6hJBIFiTEiuxfaRgKaYl1f30nvcf9Bs3wdhXd3PddxZCRKBiZftZTXm/xkzWu ExW71YfSaHF3w7vpnmmkYi2YE1+iQSofsbNqG6rkItdOPw6KhJ8AZfh8+nmqTGL0A9SJ WG4w== X-Gm-Message-State: APjAAAVzeoSD3p4BbTbJUSqcuQEsOngY/ZTwpH7xicdEGxxet873+vXV 5Z7JdyLYX0LWVRGtoy7C1y5++BVv X-Google-Smtp-Source: APXvYqxZsUBawJkOr3Y12ldeuHvYsj7ZAzG/5F+SBuPjQ5TatAiN7KJKCByQySwM3CcmqI9lCfAMkA== X-Received: by 2002:aa7:d39a:: with SMTP id x26mr12727141edq.48.1555061841346; Fri, 12 Apr 2019 02:37:21 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n64sm1024104edc.82.2019.04.12.02.37.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 02:37:20 -0700 (PDT) Date: Fri, 12 Apr 2019 02:37:20 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 09:37:12 GMT Message-Id: <7d8f6a2ee6295b9817566853e1cfeca16b144b30.1555061837.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 3/8] t7810: do not abbreviate `--no-exclude-standard` nor `--invert-match` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Denton Liu , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin This script used abbreviated options, which is unnecessarily fragile. Signed-off-by: Johannes Schindelin --- t/t7810-grep.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index 43aa4161cf..2e1bb61b41 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -119,33 +119,33 @@ do test_cmp expected actual ' - test_expect_success "grep -w $L (with --column, --invert)" ' + test_expect_success "grep -w $L (with --column, --invert-match)" ' { echo ${HC}file:1:foo mmap bar echo ${HC}file:1:foo_mmap bar echo ${HC}file:1:foo_mmap bar mmap echo ${HC}file:1:foo mmap bar_mmap } >expected && - git grep --column --invert -w -e baz $H -- file >actual && + git grep --column --invert-match -w -e baz $H -- file >actual && test_cmp expected actual ' - test_expect_success "grep $L (with --column, --invert, extended OR)" ' + test_expect_success "grep $L (with --column, --invert-match, extended OR)" ' { echo ${HC}hello_world:6:HeLLo_world } >expected && - git grep --column --invert -e ll --or --not -e _ $H -- hello_world \ + git grep --column --invert-match -e ll --or --not -e _ $H -- hello_world \ >actual && test_cmp expected actual ' - test_expect_success "grep $L (with --column, --invert, extended AND)" ' + test_expect_success "grep $L (with --column, --invert-match, extended AND)" ' { echo ${HC}hello_world:3:Hello world echo ${HC}hello_world:3:Hello_world echo ${HC}hello_world:6:HeLLo_world } >expected && - git grep --column --invert --not -e _ --and --not -e ll $H -- hello_world \ + git grep --column --invert-match --not -e _ --and --not -e ll $H -- hello_world \ >actual && test_cmp expected actual ' @@ -1010,7 +1010,7 @@ test_expect_success 'outside of git repository' ' echo ".gitignore:.*o*" && cat ../expect.full } >../expect.with.ignored && - git grep --no-index --no-exclude o >../actual.full && + git grep --no-index --no-exclude-standard o >../actual.full && test_cmp ../expect.with.ignored ../actual.full ) ' @@ -1051,7 +1051,7 @@ test_expect_success 'outside of git repository with fallbackToNoIndex' ' echo ".gitignore:.*o*" && cat ../expect.full } >../expect.with.ignored && - git -c grep.fallbackToNoIndex grep --no-exclude o >../actual.full && + git -c grep.fallbackToNoIndex grep --no-exclude-standard o >../actual.full && test_cmp ../expect.with.ignored ../actual.full ) ' From patchwork Fri Apr 12 09:37:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10897707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E53731800 for ; Fri, 12 Apr 2019 09:37:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDCE728D18 for ; Fri, 12 Apr 2019 09:37:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C21A528D62; Fri, 12 Apr 2019 09:37:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C7EB28D2E for ; Fri, 12 Apr 2019 09:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726886AbfDLJhZ (ORCPT ); Fri, 12 Apr 2019 05:37:25 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:41290 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726872AbfDLJhX (ORCPT ); Fri, 12 Apr 2019 05:37:23 -0400 Received: by mail-ed1-f68.google.com with SMTP id g6so3788775edc.8 for ; Fri, 12 Apr 2019 02:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=cfj03u7cjqe525OLOvGdFTd7m0oyq4qTfT+sl2XCBrk=; b=sSaBbSpxnsz0tS1HBP7kN1OesOpu+WjD3u82wKq+A2l1tJ/TC5uldXoC8gJVCgNUrM WYy2sRes9Hdho0nAZ+nFwdStnZsgf/LBIljFOttoOWvJbt4YxSQOzqGpxP+ufyIvVoGO 0nk5oBaNMi+jIQE+sCkw4P2amg5m9u2rZnkwD6mRD+2xooNVX+RshsNNA1k4typ8ijR8 ErKjVXAhKCIk51Z5FS70I0/1D6ryQ1y02xnUyQgSS5/YaRilErpKO66QOcDmjKECb3fV ftFpb9U4qFVXQEQDe943N5+roJzxyQxyFvcx3eyVVMYIZmONQ05zHHy46Evc+xIzmzqh EIWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=cfj03u7cjqe525OLOvGdFTd7m0oyq4qTfT+sl2XCBrk=; b=KD5P4sucfRjEiADn54R16rorEo2J7lJHlwaaCeJdX5COdMEbl/58ithQGmb4aexq0X pHoiSAVtsXLOwgED4C+TdwAExi/fNOHHw2/pDoRWA5QgnXZniYq+n2apcY8oOW1b1nje Dy7jVhJ7hIdRBnQt31zIWRWdR0xaszQjSv3v19vNheReRBivzr9QXF3X2xYDyjMlCsiZ 48pG16sFWsNxjC/A6lAwW/BJlkOT6EKZmLTXIt1l+8raF3lJxd//GZiNTbF7r0IvMa87 BJKhwEPIlwB65xQfVRa1gshrkBceeL7GC3jq+BzF3rz/dKGSCNBV4kxw6ZLuIuR65uuc zD7g== X-Gm-Message-State: APjAAAVO2K5ygf53sc7kox70y1tVjNOfOpB74dqkHpt7mB9cKvxkJNdV Y/vP/P2zdrNOhMr10zdAK0quptT6 X-Google-Smtp-Source: APXvYqzPRV8sZWxg/RmAR/QWr7bigCk1FfkTx7xY/VALyQuCbcWWOouASJd55js8BBZ3IeZSSELGVw== X-Received: by 2002:a05:6402:150e:: with SMTP id f14mr29342075edw.33.1555061842090; Fri, 12 Apr 2019 02:37:22 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id j10sm7459613eja.58.2019.04.12.02.37.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 02:37:21 -0700 (PDT) Date: Fri, 12 Apr 2019 02:37:21 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 09:37:13 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 4/8] t5531: avoid using an abbreviated option Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Denton Liu , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin It was probably just an oversight: the `--recurse-submodules` option puts the term "submodules" in the plural form, not the singular one. To avoid future problems in case that another option is introduced that starts with the prefix `--recurse-submodule`, let's just fix this. Signed-off-by: Johannes Schindelin --- t/t5531-deep-submodule-push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh index e2c37fd978..4ad059e6be 100755 --- a/t/t5531-deep-submodule-push.sh +++ b/t/t5531-deep-submodule-push.sh @@ -363,7 +363,7 @@ test_expect_success 'push succeeds if submodule has no remote and is on the firs ) && git add b && git commit -m "added submodule" && - git push --recurse-submodule=check origin master + git push --recurse-submodules=check origin master ) ' From patchwork Fri Apr 12 09:37:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10897709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FF8017E1 for ; Fri, 12 Apr 2019 09:37:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45D0328D18 for ; Fri, 12 Apr 2019 09:37:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A35728D2E; Fri, 12 Apr 2019 09:37:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1D6328D57 for ; Fri, 12 Apr 2019 09:37:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726735AbfDLJh0 (ORCPT ); Fri, 12 Apr 2019 05:37:26 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:44300 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726881AbfDLJhY (ORCPT ); Fri, 12 Apr 2019 05:37:24 -0400 Received: by mail-ed1-f68.google.com with SMTP id d11so7732578edp.11 for ; Fri, 12 Apr 2019 02:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=a1s78ePGcYIGjMfbIq9Y0wgOYdjX++nDCmviqjK1Pa8=; b=gU/HsqUPBa2q3qO9XXiXCPFOdNHKXf+cXNeoDBjG67aZgo+80DeiPvxI4yVo7NOj4f cjqvpPH98gxDCfxSbyanFmf+QY9EjSISCF5x7R4RhRZoD43B74U3XyirfITombX9P+RJ w8H7dinaK4/ByTI6EanbiD81NPvxFcofLsQ95dnUhW3UX0AjXveYbd7cJhu32HrgDQTX FTeRVPwpp/KRW3uD5wVTqv7cKdlMslGcXfTE77BlNUZ5Dkea4Dt9XHvQaS/xRauagzYi a2KxPslKcpE5mfv4OnaDBan3O108VQ1eI7/Hvm/n+ALyYlCvuhA4KV/eu12q9dVZQ6vV kHmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=a1s78ePGcYIGjMfbIq9Y0wgOYdjX++nDCmviqjK1Pa8=; b=ckzasEC6vcU4Oe0vQrrncStjrtFv1RS5Ou+C17yp1wofc4agg8YxthUvCJ1yDBfzXh Rq/R9864dIqKeuisG0bpgQu1N7wux21Dn9RLqzF/RAwhVhQaPhDkiRA31P43hVu5CGMN zJCu0SoQhdM3NaNUJEyAFqFLmlaQel1evAliePifGboccnMyHYgVsr7PFCJ/Yu5adlY5 TaS5cgYDCpwqdmfxNzRHiv/qyM523ogYEJFxTWIKBFecN/XVYBp5fuYu/UlNhXLvkKq5 8SRce+6uflDIJu3LR2aZG930neEumHJgQzSIUWmbf6mGQ9NbeUHeNtR1RJzCOXroJbcp B/EQ== X-Gm-Message-State: APjAAAVHB9Z5n13sJ8pX5riFujdfF+wnzxOB/w6V6duJWmDznD03e9RG uDoDQrWyv/DGULWjw7Sxwk4nm9jQ X-Google-Smtp-Source: APXvYqxMdT0lgGzgXaK5uQXdDF4hc/Up3/kvj51c7+JjwCLv36wN++vOmqggjr5B2052vM3EKjtDjQ== X-Received: by 2002:a17:906:a841:: with SMTP id dx1mr28777189ejb.99.1555061842867; Fri, 12 Apr 2019 02:37:22 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id w3sm5072234edq.33.2019.04.12.02.37.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 02:37:22 -0700 (PDT) Date: Fri, 12 Apr 2019 02:37:22 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 09:37:14 GMT Message-Id: <7372059922710f392201cb32c5a7ac9cbdbe0616.1555061837.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 5/8] tests (push): do not abbreviate the `--follow-tags` option Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Denton Liu , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin We really want to spell out the option in the full form, to avoid any ambiguity that might be introduced by future patches. Signed-off-by: Johannes Schindelin --- t/t5516-fetch-push.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 37e8e80893..db0b1db458 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1370,7 +1370,7 @@ test_expect_success 'push does not follow tags by default' ' test_cmp expect actual ' -test_expect_success 'push --follow-tag only pushes relevant tags' ' +test_expect_success 'push --follow-tags only pushes relevant tags' ' mk_test testrepo heads/master && rm -fr src dst && git init src && @@ -1384,7 +1384,7 @@ test_expect_success 'push --follow-tag only pushes relevant tags' ' git tag -m "future" future && git checkout master && git for-each-ref refs/heads/master refs/tags/tag >../expect && - git push --follow-tag ../dst master + git push --follow-tags ../dst master ) && ( cd dst && From patchwork Fri Apr 12 09:37:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10897711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50890186E for ; Fri, 12 Apr 2019 09:37:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 324A128D36 for ; Fri, 12 Apr 2019 09:37:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 265BF28D62; Fri, 12 Apr 2019 09:37:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0F1528D36 for ; Fri, 12 Apr 2019 09:37:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbfDLJh1 (ORCPT ); Fri, 12 Apr 2019 05:37:27 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:34604 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726874AbfDLJhZ (ORCPT ); Fri, 12 Apr 2019 05:37:25 -0400 Received: by mail-ed1-f68.google.com with SMTP id x14so7781445eds.1 for ; Fri, 12 Apr 2019 02:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=iE6cCDC3FJHr9ipm1qLoB/McdwT/thW5o2IT6HMvOlk=; b=LEY3gKjAalkjGoNKptYGAuPp2biF4V0Uv/t6qGUToGhdWxWgFdzwaW43vOvrItxMNk cvYtZosL8+PsET1RRaK2lwqaOGG2XH/jmEafEZ40tpPF4qvhr2mlnMjXNNLB9bqyhQF/ 0WufMx87M2O1A/MtIjPcp3HdgncBgZ+DJFuThfnMin/9tQZSOrK1yOzIS0R9y1uPSfBc uTsSy7v7eYbDClh79UJXzAbaESf61W9JIQ/uq3bRu8maVSjqEVNzINIoaeffzx+yUyut ELEOF0IYb1iFsauvfufMrYRvc5K+viLVUhkD+kC/InR9it1V8y3n/EN3HmRRsSflxLa3 twKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=iE6cCDC3FJHr9ipm1qLoB/McdwT/thW5o2IT6HMvOlk=; b=TEwu4nYLgfTNjVZN69rflth2b06FHxnQW0Ny8PXJdP2wI1DVFRriNyNI28Pg6QSiAg OBNPVMfH3ZbY7YTES67K8lAXW9jeNRHAEjh9KD3f9p5VnBw015ySlvIGzYTJRRw7+ZzQ lx7TNf+SxA78RZC4QD+F6BHv8kY54/w3/mTxaLd7JFHeBWtca889dl5XtY7wkpTzMXoa tdYieKlo1JREKIdx9Otx66KyEuc/hI8Gp2EkqO04NKHGQQvcx7StpX5S1jHEn//CQfkw pCcJq3YmY24UdF2eDEw3ugmF6bQTLyr/dR8QRn15dd0uthIongiWAFZGyPt9u4gzPGeL 8Fuw== X-Gm-Message-State: APjAAAXf9HjJM+fqCclOCHg04ozEb5lz2DWDOu9/AlGAiKUIgXoG2gOC LU9Neq56IU2Gm8gM2yNa6aZczBUM X-Google-Smtp-Source: APXvYqzhgVhdcMpok0FbmcY0mcOOvL8ZcxXipeYnpEpB7NafiY22YVpf+lrPKZLtE4fXHALItLld3g== X-Received: by 2002:a17:906:1ed7:: with SMTP id m23mr30799534ejj.198.1555061843635; Fri, 12 Apr 2019 02:37:23 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o58sm8570660edc.74.2019.04.12.02.37.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 02:37:23 -0700 (PDT) Date: Fri, 12 Apr 2019 02:37:23 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 09:37:15 GMT Message-Id: <531450c00dfe517748d9ad0bc77b9871c45042aa.1555061837.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 6/8] tests (status): spell out the `--find-renames` option in full Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Denton Liu , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin To avoid future ambiguities, we really want to use full option names in the test suite. `t7525-status-rename.sh` used an abbreviated form of the `--find-renames` option, though, so let's change that. Signed-off-by: Johannes Schindelin --- t/t7525-status-rename.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t7525-status-rename.sh b/t/t7525-status-rename.sh index ef8b1b3078..a62736dce0 100755 --- a/t/t7525-status-rename.sh +++ b/t/t7525-status-rename.sh @@ -84,7 +84,7 @@ test_expect_success 'status score=100%' ' test_i18ngrep "deleted:" actual && test_i18ngrep "new file:" actual && - git status --find-rename=100% >actual && + git status --find-renames=100% >actual && test_i18ngrep "deleted:" actual && test_i18ngrep "new file:" actual ' @@ -93,11 +93,11 @@ test_expect_success 'status score=01%' ' git status -M=01% >actual && test_i18ngrep "renamed:" actual && - git status --find-rename=01% >actual && + git status --find-renames=01% >actual && test_i18ngrep "renamed:" actual ' -test_expect_success 'copies not overridden by find-rename' ' +test_expect_success 'copies not overridden by find-renames' ' cp renamed copy && git add copy && @@ -105,7 +105,7 @@ test_expect_success 'copies not overridden by find-rename' ' test_i18ngrep "copied:" actual && test_i18ngrep "renamed:" actual && - git -c status.renames=copies status --find-rename=01% >actual && + git -c status.renames=copies status --find-renames=01% >actual && test_i18ngrep "copied:" actual && test_i18ngrep "renamed:" actual ' From patchwork Fri Apr 12 09:37:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10897719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCDF51800 for ; Fri, 12 Apr 2019 09:37:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B78B928D18 for ; Fri, 12 Apr 2019 09:37:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6B1A28D36; Fri, 12 Apr 2019 09:37:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFA3728D18 for ; Fri, 12 Apr 2019 09:37:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbfDLJhd (ORCPT ); Fri, 12 Apr 2019 05:37:33 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:46717 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726884AbfDLJh0 (ORCPT ); Fri, 12 Apr 2019 05:37:26 -0400 Received: by mail-ed1-f67.google.com with SMTP id d1so7728484edd.13 for ; Fri, 12 Apr 2019 02:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=JyFzcaTYQSB9GuPQKaxTDKm9YHvpcpHbe30toDYdzN8=; b=kg6nXE0Qonw5c6ATX8gIOefD1rYFDdoq8vnaODlmZ/hmIGmtJeo1L5eC6HdP+c4ETL Vq95xOo9qpWaenggaTRoYzCOj+eg0X5L3k3nYHT593jf6PY6v0Rwl9PR+VPOD1YsZMbO fUatExMBPvTQGzS43Zi4Bpn1JIkYUSDIPaMPpCc9IsJNskqGLgnd63U/DZaCY8V2jefE bUHruyxJVmWbG4JKjNNISSBEjE2MoUO/IDFr1tpOMLes21i6ZjoqLqIcqWU2Pz5DXkHf A9Wfxj7kGW7YJdMNP1r2ByyNnTvQYQceRNxlS4uSqfFVavQD2RkJ80WlGl6bsUQKCFcn yvHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=JyFzcaTYQSB9GuPQKaxTDKm9YHvpcpHbe30toDYdzN8=; b=uB9wz+vXEWnDVEoI7yLJ6e0UIgfHj2V3PcZsa2fo3MqBWffbnPE88LGkRnKH8wp7WO o7LcoDMdZumhKcDcaL2ABeHJcJhHeJzeuXh0Ma48S5CJoPxVIwezlD7DlJSwraZxCFAq +lTJxM0/VwaQxeVCqiG4YEB3Xw8wxx5p3UyuQyAGAh81dwD4oJ8YbWKxjEY0v0LeJwDL pKhASLU6PoS4htQJWFx/0vLAONqNnuWowCgr+q/nz6zAtI4jeIlxHkDrnS3X6LI0giKs qe7s4jfHcjrflcAHBw2jRZ2OBL7lRhjIsvnK87jGKAPN7o/b+sBFhQ4CzEvOwxolXz6K kEHw== X-Gm-Message-State: APjAAAVGknAqvK0GqEa2PeGp0UrTJUX6eVUgu1rGdH9QqUgsw/ZPphRP 1mTmM7YS2pWhr9K952FgFSKGQRwi X-Google-Smtp-Source: APXvYqzDBFKDfjNntWyJtFJVUrVWRfjHbt+u5xaSWJlYkFxBalaAKZUbgfP+HFpnqVnMYIM+jCyAOg== X-Received: by 2002:a50:8e95:: with SMTP id w21mr3211207edw.154.1555061844397; Fri, 12 Apr 2019 02:37:24 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r14sm12393727edd.87.2019.04.12.02.37.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 02:37:23 -0700 (PDT) Date: Fri, 12 Apr 2019 02:37:23 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 09:37:16 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 7/8] tests (pack-objects): use the full, unabbreviated `--revs` option Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Denton Liu , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin To use the singular form of a word, when the option wants the plural form (and quietly expands it because it thinks it was abbreviated), is an easy mistake to make, and t5317 contains almost two dozen of them. However, using abbreviated options in tests is a bit fragile, so we will disallow use of abbreviated options in our test suite. In preparation for this change, let's fix `t5317-pack-objects-filter-objects.sh`. Signed-off-by: Johannes Schindelin --- t/t5317-pack-objects-filter-objects.sh | 44 +++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh index 24541ea137..4c0201c34b 100755 --- a/t/t5317-pack-objects-filter-objects.sh +++ b/t/t5317-pack-objects-filter-objects.sh @@ -25,7 +25,7 @@ test_expect_success 'verify blob count in normal packfile' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r1 pack-objects --rev --stdout >all.pack <<-EOF && + git -C r1 pack-objects --revs --stdout >all.pack <<-EOF && HEAD EOF git -C r1 index-pack ../all.pack && @@ -39,7 +39,7 @@ test_expect_success 'verify blob count in normal packfile' ' ' test_expect_success 'verify blob:none packfile has no blobs' ' - git -C r1 pack-objects --rev --stdout --filter=blob:none >filter.pack <<-EOF && + git -C r1 pack-objects --revs --stdout --filter=blob:none >filter.pack <<-EOF && HEAD EOF git -C r1 index-pack ../filter.pack && @@ -74,7 +74,7 @@ test_expect_success 'get an error for missing tree object' ' git -C r5 commit -m "foo" && del=$(git -C r5 rev-parse HEAD^{tree} | sed "s|..|&/|") && rm r5/.git/objects/$del && - test_must_fail git -C r5 pack-objects --rev --stdout 2>bad_tree <<-EOF && + test_must_fail git -C r5 pack-objects --revs --stdout 2>bad_tree <<-EOF && HEAD EOF grep "bad tree object" bad_tree @@ -88,7 +88,7 @@ test_expect_success 'setup for tests of tree:0' ' ' test_expect_success 'verify tree:0 packfile has no blobs or trees' ' - git -C r1 pack-objects --rev --stdout --filter=tree:0 >commitsonly.pack <<-EOF && + git -C r1 pack-objects --revs --stdout --filter=tree:0 >commitsonly.pack <<-EOF && HEAD EOF git -C r1 index-pack ../commitsonly.pack && @@ -98,7 +98,7 @@ test_expect_success 'verify tree:0 packfile has no blobs or trees' ' test_expect_success 'grab tree directly when using tree:0' ' # We should get the tree specified directly but not its blobs or subtrees. - git -C r1 pack-objects --rev --stdout --filter=tree:0 >commitsonly.pack <<-EOF && + git -C r1 pack-objects --revs --stdout --filter=tree:0 >commitsonly.pack <<-EOF && HEAD: EOF git -C r1 index-pack ../commitsonly.pack && @@ -128,7 +128,7 @@ test_expect_success 'verify blob count in normal packfile' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r2 pack-objects --rev --stdout >all.pack <<-EOF && + git -C r2 pack-objects --revs --stdout >all.pack <<-EOF && HEAD EOF git -C r2 index-pack ../all.pack && @@ -142,7 +142,7 @@ test_expect_success 'verify blob count in normal packfile' ' ' test_expect_success 'verify blob:limit=500 omits all blobs' ' - git -C r2 pack-objects --rev --stdout --filter=blob:limit=500 >filter.pack <<-EOF && + git -C r2 pack-objects --revs --stdout --filter=blob:limit=500 >filter.pack <<-EOF && HEAD EOF git -C r2 index-pack ../filter.pack && @@ -157,7 +157,7 @@ test_expect_success 'verify blob:limit=500 omits all blobs' ' ' test_expect_success 'verify blob:limit=1000' ' - git -C r2 pack-objects --rev --stdout --filter=blob:limit=1000 >filter.pack <<-EOF && + git -C r2 pack-objects --revs --stdout --filter=blob:limit=1000 >filter.pack <<-EOF && HEAD EOF git -C r2 index-pack ../filter.pack && @@ -176,7 +176,7 @@ test_expect_success 'verify blob:limit=1001' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF && + git -C r2 pack-objects --revs --stdout --filter=blob:limit=1001 >filter.pack <<-EOF && HEAD EOF git -C r2 index-pack ../filter.pack && @@ -194,7 +194,7 @@ test_expect_success 'verify blob:limit=10001' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF && + git -C r2 pack-objects --revs --stdout --filter=blob:limit=10001 >filter.pack <<-EOF && HEAD EOF git -C r2 index-pack ../filter.pack && @@ -212,7 +212,7 @@ test_expect_success 'verify blob:limit=1k' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF && + git -C r2 pack-objects --revs --stdout --filter=blob:limit=1k >filter.pack <<-EOF && HEAD EOF git -C r2 index-pack ../filter.pack && @@ -230,7 +230,7 @@ test_expect_success 'verify explicitly specifying oversized blob in input' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF && + git -C r2 pack-objects --revs --stdout --filter=blob:limit=1k >filter.pack <<-EOF && HEAD $(git -C r2 rev-parse HEAD:large.10000) EOF @@ -249,7 +249,7 @@ test_expect_success 'verify blob:limit=1m' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF && + git -C r2 pack-objects --revs --stdout --filter=blob:limit=1m >filter.pack <<-EOF && HEAD EOF git -C r2 index-pack ../filter.pack && @@ -302,7 +302,7 @@ test_expect_success 'verify blob count in normal packfile' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r3 pack-objects --rev --stdout >all.pack <<-EOF && + git -C r3 pack-objects --revs --stdout >all.pack <<-EOF && HEAD EOF git -C r3 index-pack ../all.pack && @@ -320,7 +320,7 @@ test_expect_success 'verify sparse:path=pattern1' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF && + git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF && HEAD EOF git -C r3 index-pack ../filter.pack && @@ -352,7 +352,7 @@ test_expect_success 'verify sparse:path=pattern2' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF && + git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF && HEAD EOF git -C r3 index-pack ../filter.pack && @@ -404,7 +404,7 @@ test_expect_success 'verify blob count in normal packfile' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r4 pack-objects --rev --stdout >all.pack <<-EOF && + git -C r4 pack-objects --revs --stdout >all.pack <<-EOF && HEAD EOF git -C r4 index-pack ../all.pack && @@ -423,7 +423,7 @@ test_expect_success 'verify sparse:oid=OID' ' sort >expected && oid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) && - git -C r4 pack-objects --rev --stdout --filter=sparse:oid=$oid >filter.pack <<-EOF && + git -C r4 pack-objects --revs --stdout --filter=sparse:oid=$oid >filter.pack <<-EOF && HEAD EOF git -C r4 index-pack ../filter.pack && @@ -441,7 +441,7 @@ test_expect_success 'verify sparse:oid=oid-ish' ' awk -f print_2.awk ls_files_result | sort >expected && - git -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF && + git -C r4 pack-objects --revs --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF && HEAD EOF git -C r4 index-pack ../filter.pack && @@ -470,19 +470,19 @@ test_expect_success 'setup r1 - delete loose blobs' ' ' test_expect_success 'verify pack-objects fails w/ missing objects' ' - test_must_fail git -C r1 pack-objects --rev --stdout >miss.pack <<-EOF + test_must_fail git -C r1 pack-objects --revs --stdout >miss.pack <<-EOF HEAD EOF ' test_expect_success 'verify pack-objects fails w/ --missing=error' ' - test_must_fail git -C r1 pack-objects --rev --stdout --missing=error >miss.pack <<-EOF + test_must_fail git -C r1 pack-objects --revs --stdout --missing=error >miss.pack <<-EOF HEAD EOF ' test_expect_success 'verify pack-objects w/ --missing=allow-any' ' - git -C r1 pack-objects --rev --stdout --missing=allow-any >miss.pack <<-EOF + git -C r1 pack-objects --revs --stdout --missing=allow-any >miss.pack <<-EOF HEAD EOF ' From patchwork Fri Apr 12 09:37:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood via GitGitGadget X-Patchwork-Id: 10897717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF6E717E1 for ; Fri, 12 Apr 2019 09:37:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC1C428D18 for ; Fri, 12 Apr 2019 09:37:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0AA828D36; Fri, 12 Apr 2019 09:37:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AF3228D18 for ; Fri, 12 Apr 2019 09:37:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726917AbfDLJhd (ORCPT ); Fri, 12 Apr 2019 05:37:33 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37262 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726889AbfDLJh1 (ORCPT ); Fri, 12 Apr 2019 05:37:27 -0400 Received: by mail-ed1-f67.google.com with SMTP id f53so6178884ede.4 for ; Fri, 12 Apr 2019 02:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=sHdx3mOtvpXxs6URTJ/MN7LjCPBzzxYk7MrRoOGx2fI=; b=TeensCcf/TUwjvpzhp0irj8VQrjhRWXsPqiITUdcwL1xQzUutk2tQ2+yeD62KOvmQf B8rLdr8ETtBXT+HWuvFGqeMtxGf2gjosRW13Rd8Q0WvYLRlqruXAn+VUlDcb8VqxZDOs ScUGTYMDv69NyM2vPilNO2JzBZPUvRiTRISqd8OdGgUsJWoP2TxpxMfVtiv7rniZjkeE st5EiH+TeUdG+cqh0MGrbkWN7JoZl27rioCbxYQPFGWzAqS0qXwZcGvySunHOOhURWTh dRIglGhQAdcT4VjvLkkEylK1yh5nT93od5gKSFypC21BWD+DoPn6lED47ESoACtWIh5f G6yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=sHdx3mOtvpXxs6URTJ/MN7LjCPBzzxYk7MrRoOGx2fI=; b=rqr5HHl6zGzGtSUL20ZDr5Q+HEuBPIjnrdRx7d9RjZwz9LIiS6W8Es3scZLPtwkEti t+6isfheXFhZJnog2HIgKJmobaEh2BclAAAFp+ullsnFzTSidjK2PYxvk0daPYOJT3Va 4CfY9xiXdUgqbv6n99QVXsgN0swtX27tiA4Og/Q34NDaWt2AG6LIkYdH8Jb5gN6FJJkl NWee2DwsQl8kVCTP280qXHLnyOoGgdobguWwJXhGMRG7wS2r71RRJI5XZ+4FKkwQhZNB eXv9MvECXkEC5N0s4dmkxsPl03vuYWPh05AZTiIA99ezB8NpUr1YMq0015PFnICOClwc RJfw== X-Gm-Message-State: APjAAAXIknt/FWye2l7pUtGbEs+mhL1IeB5eYvZAsYt1zDi6mxvPWvS1 /VkAzrBeplY0NHsT0VbPTR7IIxyr X-Google-Smtp-Source: APXvYqwnrVY1G9eBnaiyzNcf1MfjBT3+6pC8IqGRb4xEQuokZEyVV0Cumh4OJooZkuCgVxcJJeQwfw== X-Received: by 2002:a17:906:d0c5:: with SMTP id bq5mr31052122ejb.43.1555061845233; Fri, 12 Apr 2019 02:37:25 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id x20sm12023888eda.40.2019.04.12.02.37.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 02:37:24 -0700 (PDT) Date: Fri, 12 Apr 2019 02:37:24 -0700 (PDT) X-Google-Original-Date: Fri, 12 Apr 2019 09:37:17 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 8/8] tests: disallow the use of abbreviated options (by default) Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Denton Liu , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin Git's command-line parsers support uniquely abbreviated options, e.g. `git init --ba` would automatically expand `--ba` to `--bare`. This is a very convenient feature in every day life for Git users, in particular when tab completion is not available. However, it is not a good idea to rely on that in Git's test suite, as something that is a unique abbreviation of a command line option today might no longer be a unique abbreviation tomorrow. For example, if a future contribution added a new mode `git init --babyproofing` and a previously-introduced test case used the fact that `git init --ba` expanded to `git init --bare`, that future contribution would now have to touch seemingly unrelated tests just to keep the test suite from failing. So let's disallow abbreviated options in the test suite by default. Note: for ease of implementation, this patch really only touches the `parse-options` machinery: more and more hand-rolled option parsers are converted to use that internal API, and more and more scripts are converted to built-ins (naturally using the parse-options API, too), so in practice this catches most issues, and is definitely the biggest bang for the buck. Signed-off-by: Johannes Schindelin Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- parse-options.c | 9 +++++++++ t/README | 4 ++++ t/t0040-parse-options.sh | 14 +++++++++++++- t/test-lib.sh | 7 +++++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/parse-options.c b/parse-options.c index cec74522e5..acc3a93660 100644 --- a/parse-options.c +++ b/parse-options.c @@ -6,6 +6,8 @@ #include "color.h" #include "utf8.h" +static int disallow_abbreviated_options; + #define OPT_SHORT 1 #define OPT_UNSET 2 @@ -344,6 +346,10 @@ static enum parse_opt_result parse_long_opt( return get_value(p, options, all_opts, flags ^ opt_flags); } + if (disallow_abbreviated_options && (ambiguous_option || abbrev_option)) + die("disallowed abbreviated or ambiguous option '%.*s'", + (int)(arg_end - arg), arg); + if (ambiguous_option) { error(_("ambiguous option: %s " "(could be --%s%s or --%s%s)"), @@ -708,6 +714,9 @@ int parse_options(int argc, const char **argv, const char *prefix, { struct parse_opt_ctx_t ctx; + disallow_abbreviated_options = + git_env_bool("GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS", 0); + parse_options_start(&ctx, argc, argv, prefix, options, flags); switch (parse_options_step(&ctx, options, usagestr)) { case PARSE_OPT_HELP: diff --git a/t/README b/t/README index 656288edce..9ed3051a1c 100644 --- a/t/README +++ b/t/README @@ -399,6 +399,10 @@ GIT_TEST_SIDEBAND_ALL=, when true, overrides the fetch-pack to not request sideband-all (even if the server advertises sideband-all). +GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=, when true (which is +the default when running tests), errors out when an abbreviated option +is used. + Naming Tests ------------ diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index b8f366c442..6f6f74bfe2 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -203,20 +203,24 @@ file: (not set) EOF test_expect_success 'unambiguously abbreviated option' ' + GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \ test-tool parse-options --int 2 --boolean --no-bo >output 2>output.err && test_must_be_empty output.err && test_cmp expect output ' test_expect_success 'unambiguously abbreviated option with "="' ' + GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \ test-tool parse-options --expect="integer: 2" --int=2 ' test_expect_success 'ambiguously abbreviated option' ' - test_expect_code 129 test-tool parse-options --strin 123 + test_expect_code 129 env GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \ + test-tool parse-options --strin 123 ' test_expect_success 'non ambiguous option (after two options it abbreviates)' ' + GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \ test-tool parse-options --expect="string: 123" --st 123 ' @@ -325,6 +329,7 @@ file: (not set) EOF test_expect_success 'negation of OPT_NONEG flags is not ambiguous' ' + GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \ test-tool parse-options --no-ambig >output 2>output.err && test_must_be_empty output.err && test_cmp expect output @@ -370,4 +375,11 @@ test_expect_success '--no-verbose resets multiple verbose to 0' ' test-tool parse-options --expect="verbose: 0" -v -v -v --no-verbose ' +test_expect_success 'GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS works' ' + env GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \ + test-tool parse-options --ye && + test_must_fail env GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=true \ + test-tool parse-options --ye +' + test_done diff --git a/t/test-lib.sh b/t/test-lib.sh index 562c57e685..f1a0fea4e1 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -57,6 +57,13 @@ fi . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS export PERL_PATH SHELL_PATH +# Disallow the use of abbreviated options in the test suite by default +if test -n "${GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS:+isset}" +then + GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=true + export GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS +fi + ################################################################ # It appears that people try to run tests without building... "${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git$X" >/dev/null