From patchwork Sat Dec 19 14:06:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11983557 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.8 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 1D3F7C4361B for ; Sat, 19 Dec 2020 14:07:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D870623A23 for ; Sat, 19 Dec 2020 14:07:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbgLSOHG (ORCPT ); Sat, 19 Dec 2020 09:07:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbgLSOHG (ORCPT ); Sat, 19 Dec 2020 09:07:06 -0500 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D6F6C061282 for ; Sat, 19 Dec 2020 06:06:26 -0800 (PST) Received: by mail-oi1-x229.google.com with SMTP id s75so6246509oih.1 for ; Sat, 19 Dec 2020 06:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/605Qy9s5MEJFJHL+uiIa48BAgK80FPJPXrwEo0axfk=; b=twPhQ7fkUjMgSqJ6gVOFRJ8zqGmiH4nTTGrJzjgkKXgwp2epHu3RdJBunonp6rXhzW 6/tJh6QSCiy9gQUyu0p/Bxg1mELt/hHj/zqTWKwpHdLL8vUgwWoqyaWt2Bh7hUaBJpix 1pHyD8s4Dg+m759WWE8Ah7DYi9hNEkgKb/j2O5EBgvKhBiz3iwECP3QF/WsYoj6i2UA1 7lUrBjl3Zl5v1mJiJ8GZdcAsNTyeWJveS1jp/uLs4fJEGiLPeiSSZiXWU+5FKkSLvRwz Z+8+KlO5uarokkOzpfeWCcLvvrId/uXD9riTPKq/LcDkurcZMV+01+bEUnl0P7ijNbzR mfZA== 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=/605Qy9s5MEJFJHL+uiIa48BAgK80FPJPXrwEo0axfk=; b=Epfv3sahj4H1M3YK3a0l7HALmpVFiqVNKjm0NBn06dZHz3Om8lpcHVpDjBvgzhp0La Mdi/OZewMDXW+ldcjSgdXkBbTEn3cebP341mBYPHehSfVwTbGErYPPVVNT1PV3Vx3udP b/dSVbo/dAmeUCwMyAw4aF+qiEO6tj0Tq2XAZPn26UV7Ibs0mz2D8gs/xnNpZe19X6j7 nd3NjH87JWRAB9ZexexZqqTNRhpF7RZoV3b1vaFBpdneovlRWuUdRWHhZ2OP4WH1IizW sPWq9RskAjfPMPdCeuwGrk5MrsOQZfaoV33nsTTd/9K/r9UpRuuAtKeisD1M5oagrlYa 54HA== X-Gm-Message-State: AOAM530r6wGo2I78J0xHKlOIQOYAEZTNHkSZjbUX0YeMMygbKbSfQm3/ rcCjT4S/KNGt/LH68A1mrr0GRKpdexoxVw== X-Google-Smtp-Source: ABdhPJxzfxTEqwyCmHe088lWZ/aXbECmmDqmWB8A281keX992EdyA+YPnDU7LLNYzAwgyJZiOITezw== X-Received: by 2002:aca:a98e:: with SMTP id s136mr5838496oie.116.1608386785467; Sat, 19 Dec 2020 06:06:25 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id s9sm2408895oie.53.2020.12.19.06.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 06:06:24 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , Felipe Contreras Subject: [PATCH try2 1/4] completion: bash: fix prefix detection in branch.* Date: Sat, 19 Dec 2020 08:06:18 -0600 Message-Id: <20201219140621.1961760-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.30.0.rc0 In-Reply-To: <20201219140621.1961760-1-felipe.contreras@gmail.com> References: <20201219140621.1961760-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Otherwise we are completely ignoring the --cur argument. The issue can be tested with: git clone --config=branch. Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 7c81e4ba49..b866b68b3c 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2615,8 +2615,8 @@ __git_complete_config_variable_name () return ;; branch.*) - local pfx="${cur%.*}." - cur_="${cur#*.}" + local pfx="${cur_%.*}." + cur_="${cur_#*.}" __gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")" __gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" "$sfx" return From patchwork Sat Dec 19 14:06:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11983559 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,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 350CEC3526C for ; Sat, 19 Dec 2020 14:07:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F37CC23B27 for ; Sat, 19 Dec 2020 14:07:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726630AbgLSOHI (ORCPT ); Sat, 19 Dec 2020 09:07:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbgLSOHI (ORCPT ); Sat, 19 Dec 2020 09:07:08 -0500 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A016C061285 for ; Sat, 19 Dec 2020 06:06:27 -0800 (PST) Received: by mail-oi1-x231.google.com with SMTP id w124so6224828oia.6 for ; Sat, 19 Dec 2020 06:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sIDgN7oHqGz/AzzIT3+iobobJUXMQWjNumpX/cXRyqs=; b=rs+XMtJh5e9XzTi12AfUkdqHw/vW8I14nMsaW6mJg5Xa7WSEPpl9WBq1eYejFFCfZ6 vrqRv1G0glovDM8bDiAIOv6//R4MVA4Mfl/Tq44F5oOTzkWbTDu3hjlW41nFyFb8O36I BbE1QEPFvC09eKk5e/PPmwoNw1nNltuTNwVzZExCxQIZdajlmWhywv6VEYbtP13B5a5F voim6ihZAejdzvM4jprdQS1y7qfLoo3QctSCx7RkTkPi0NAQTqk9N2n3wyMFwMG3aQfl F8YNICAjAD/okv2eCJ8ItftLmA3/Nlkhz5kRrAqO5ErELE8Poid6WO/NmkEo1fIOOoQy InsA== 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=sIDgN7oHqGz/AzzIT3+iobobJUXMQWjNumpX/cXRyqs=; b=AKcCBBQBcMysnpwCR+kHKMQ2DxQAPugt4QTRN0WODB//JWFGgPHJFo6YOMWxK55z7G iijYJPoNj43JxpGq0d7+Sf6CfYQYeexo/mOLV/8bdlif8EGQSJmq3vOnYkVN9NcwkDTn VhdhJDpayglgoJF0GJvjOVnvSMYh8PI4BqqzWC3dzzaTuGQ+l0fyIDs48VqynXldrEZy E1pw+2QFeVQ85gCR1lSRzMIOD0/JvtYh5lEsER5TExEH9xoSx97o0nwpEa0T4zn7cDhH b96U/huYJ3D5W7rYJ+1HEEY4o7OV1NHVgpm516EDJestwyEX9Hn63bw4t6brm5Z92XGJ V4hg== X-Gm-Message-State: AOAM533xOStUMz6Widl3IxbLv2Z34jRq0kxgjH34ezt37WsXCldCXqWb C66YYBnWa63weCeJ/Hqha7zODYGyYOKNCg== X-Google-Smtp-Source: ABdhPJycR9rwZP7brBpjUrID9srx/yb7I5fuzkVsIZ3IjLoKS3ZyEq2CrWHFmAQtfDW33+BveJTt3w== X-Received: by 2002:aca:b3c3:: with SMTP id c186mr5696644oif.39.1608386787172; Sat, 19 Dec 2020 06:06:27 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id u3sm2572683otk.31.2020.12.19.06.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 06:06:26 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , Felipe Contreras Subject: [PATCH try2 2/4] completion: bash: add correct suffix in variables Date: Sat, 19 Dec 2020 08:06:19 -0600 Message-Id: <20201219140621.1961760-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.30.0.rc0 In-Reply-To: <20201219140621.1961760-1-felipe.contreras@gmail.com> References: <20201219140621.1961760-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org __gitcomp automatically adds a suffix, but __gitcomp_nl and others don't, we need to specify a space by default. Can be tested with: git config branch.autoSetupMe Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 6 +++--- t/t9902-completion.sh | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index b866b68b3c..bbdb46d87e 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2618,7 +2618,7 @@ __git_complete_config_variable_name () local pfx="${cur_%.*}." cur_="${cur_#*.}" __gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")" - __gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" "$sfx" + __gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" "${sfx- }" return ;; guitool.*.*) @@ -2652,7 +2652,7 @@ __git_complete_config_variable_name () local pfx="${cur_%.*}." cur_="${cur_#*.}" __git_compute_all_commands - __gitcomp_nl "$__git_all_commands" "$pfx" "$cur_" "$sfx" + __gitcomp_nl "$__git_all_commands" "$pfx" "$cur_" "${sfx- }" return ;; remote.*.*) @@ -2668,7 +2668,7 @@ __git_complete_config_variable_name () local pfx="${cur_%.*}." cur_="${cur_#*.}" __gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "." - __gitcomp_nl_append "pushDefault" "$pfx" "$cur_" "$sfx" + __gitcomp_nl_append "pushDefault" "$pfx" "$cur_" "${sfx- }" return ;; url.*.*) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 2be9190425..4a3d3d1597 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -2293,6 +2293,13 @@ test_expect_success 'git config - value' ' EOF ' +test_expect_success 'git config - direct completions' ' + test_completion "git config branch.autoSetup" <<-\EOF + branch.autoSetupMerge Z + branch.autoSetupRebase Z + EOF +' + test_expect_success 'git -c - section' ' test_completion "git -c br" <<-\EOF branch.Z From patchwork Sat Dec 19 14:06:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11983563 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,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4963AC3526D for ; Sat, 19 Dec 2020 14:07:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A3BC23B52 for ; Sat, 19 Dec 2020 14:07:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726665AbgLSOHK (ORCPT ); Sat, 19 Dec 2020 09:07:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbgLSOHJ (ORCPT ); Sat, 19 Dec 2020 09:07:09 -0500 Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EE7EC061248 for ; Sat, 19 Dec 2020 06:06:29 -0800 (PST) Received: by mail-oi1-x22f.google.com with SMTP id l200so6187885oig.9 for ; Sat, 19 Dec 2020 06:06:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gj2etuvarE1/ePEBdF/7YM3vl9CtQrgSFNEjoBu0lDE=; b=I1gaon2AxkSLR2IjaFZkAVST9U4TzGgF49pzoDH0dgLp9N0aD98KbASDd3LT1tNVMx s93K3XrDR/v6ces/L19ivkJcaXrL7ibcJiegGZI/M90nyUrHFzVPFg7JEeA+mkiqjdb0 sKOA1hhyoanJdptggjAZbTb6TgNmwEK23gxwofrgPqypejSb0NIklbkZMv2mvUm8PI2h 6lUkdABs3VL2C8Sb94pr5Aem35yEw43aHE+AN25wnyrk//cujmjQV3HZJQYr97/myilI 2LmX/S+1kvWxK+lEU5IcZM/PZcPf4f+uZ4N5PPbfE1P6BThFRIy1Nj/NX5qLQ0kXJJif K8gA== 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=gj2etuvarE1/ePEBdF/7YM3vl9CtQrgSFNEjoBu0lDE=; b=AcMDvpiCGKQGYG7PXCe/ktfKdQ31BnH3yNYGws7lNlMnAau8ni21O/XyUbod6EoONG Odzfs96iPtCevMaQcJO+Q8s+Mko9DmQSO9Zw8f+MsdmdBHqlfHP3X0RadyVMo/oKM1Ec 2ndSzOnD03euE8Ou+R4kuU+hP1EiP6LSM5fVpFnnIfEnIqiyCsl8FGPHvt0nxXTiN9+P O9xDtsF85K426nysSRPmf13RYbLHu3nJDZw9sK5HcgarfXpaLGO6SDsLZz2sNN45ZTMO KwUXkzgbYBSMZZKpCQ8ee8nVkLb+N108meaiM14TfJ3ZI5iDmoIwy0BErx7OdK0P+Lvp MBvg== X-Gm-Message-State: AOAM533lWqjPrQMm4b6yHrorwB7J2ImAPTRJuAxnzA8XC714HnflZb1+ pQ9a22kSZorlOM8IrF+epnpXOZnk/QMorA== X-Google-Smtp-Source: ABdhPJwYeHpPT30Pms7iv2u8SwZ3D30IGBRqPJwWkiUVvsHgqB/NRQ4xHJAQAMki7E5pkp9psA7RHg== X-Received: by 2002:a05:6808:6c2:: with SMTP id m2mr5783767oih.123.1608386788809; Sat, 19 Dec 2020 06:06:28 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id a195sm1614989oib.52.2020.12.19.06.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 06:06:28 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , Felipe Contreras Subject: [PATCH try2 3/4] completion: bash: fix for suboptions with value Date: Sat, 19 Dec 2020 08:06:20 -0600 Message-Id: <20201219140621.1961760-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.30.0.rc0 In-Reply-To: <20201219140621.1961760-1-felipe.contreras@gmail.com> References: <20201219140621.1961760-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We need to ignore options that don't start with -- as well. Depending on the value of COMP_WORDBREAKS the last word could be duplicated otherwise. Can be tested with: git merge -X diff-algorithm= Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 2 +- t/t9902-completion.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index bbdb46d87e..5b2dff150d 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -347,7 +347,7 @@ __gitcomp () local cur_="${3-$cur}" case "$cur_" in - --*=) + *=) ;; --no-*) local c i=0 IFS=$' \t\n' diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 4a3d3d1597..4deda01153 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -537,6 +537,15 @@ test_expect_success '__gitcomp - expand/narrow all negative options' ' EOF ' +test_expect_success '__gitcomp - equal skip' ' + test_gitcomp "--option=" "--option=" <<-\EOF && + + EOF + test_gitcomp "option=" "option=" <<-\EOF + + EOF +' + test_expect_success '__gitcomp - doesnt fail because of invalid variable name' ' __gitcomp "$invalid_variable_name" ' @@ -2342,6 +2351,12 @@ test_expect_success 'git clone --config= - value' ' EOF ' +test_expect_success 'options with value' ' + test_completion "git merge -X diff-algorithm=" <<-\EOF + + EOF +' + test_expect_success 'sourcing the completion script clears cached commands' ' __git_compute_all_commands && verbose test -n "$__git_all_commands" && From patchwork Sat Dec 19 14:06:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11983561 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.8 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 5CFC9C0018C for ; Sat, 19 Dec 2020 14:07:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3358123A23 for ; Sat, 19 Dec 2020 14:07:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbgLSOHM (ORCPT ); Sat, 19 Dec 2020 09:07:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbgLSOHL (ORCPT ); Sat, 19 Dec 2020 09:07:11 -0500 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5264CC061257 for ; Sat, 19 Dec 2020 06:06:31 -0800 (PST) Received: by mail-oi1-x22c.google.com with SMTP id s2so6249614oij.2 for ; Sat, 19 Dec 2020 06:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wHCeU0sLDu3EzAmS761szeotYetdErsVQCIBuHJfbpk=; b=huP4ZqOVUSFbmuhMOW50cFN3XPzhu9rBVlhTM9a/kNiC4zdQyatPuoGDSJG9LWSu66 2ZFfQHEfXNTaZTs5SIQ1fFoGG+wmUTXTVQmVvpUn+GS2JVURMoFV+4iNajNGoY9QT03n PlSUjKSrW4u6TKihN6Nl+/2rBdAJ78z9hjFY8knvlHVVHmS4tOwCgaFo3Ioh4aZDOHN4 Adlz1QTFZgK6hexionwkuMhF+HV13GHpWVHujrhtzZM+c4NBglZUNf/35TBJmd+j2/K6 QlPEHOE8g8wDL47QIT2Lb4+/y1lsTMSMpHu5lFdd+UfkEojnNp7y2Q57I3RDV3noV62l fG7w== 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=wHCeU0sLDu3EzAmS761szeotYetdErsVQCIBuHJfbpk=; b=EVj0ge951bM1OdgFBd7WKDoVFafpUTxqwgGjgPlh5CeJ3xfkYsyDOTkYsVXA0EhgHG urby/0J9sXkA7+noP+8E2QcNo+OOPacq6VzaJUEpG3vCXg1yvzGxz0p6335Nme5wyjeS 8c4pYRW5+wfddmXO8BKVqs/7lDhFqV+bqT0QFgVnJdsDlpVQQIVcIOf8M/x9AnkZcPKx X9Q13l/4oyk8wCXgMxNxH/z/8a3ZTnQruWd/2dLG1XUmmBOyBpCfyFUNlARV9IJRjlgU XijDE4WKICd8INT8AYyjzkiIQ7tlOph3dbOxtwC0tCtpm25/hRCAdn/ceYQx+1SCLFxc Dtiw== X-Gm-Message-State: AOAM530drcoA/1q8KpO42veFqvh4DOMFjIg6BASfNb5e7AF9fZ+viqmB jXD10oma/bM2a68RqaSDcsuOjCEbD2jQbA== X-Google-Smtp-Source: ABdhPJzCqv7BYcdlGRA/jQhCCKgUthF0Cz2lyociZOfoNG7gAUU6okMCAU+LuTvHMrp/lHbxssmLQg== X-Received: by 2002:aca:5d09:: with SMTP id r9mr5838517oib.25.1608386790403; Sat, 19 Dec 2020 06:06:30 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id s204sm1545791oib.42.2020.12.19.06.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 06:06:29 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , Felipe Contreras Subject: [PATCH try2 4/4] completion: bash: fix for multiple dash commands Date: Sat, 19 Dec 2020 08:06:21 -0600 Message-Id: <20201219140621.1961760-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.30.0.rc0 In-Reply-To: <20201219140621.1961760-1-felipe.contreras@gmail.com> References: <20201219140621.1961760-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Otherwise commands like 'for-each-ref' are not completed. Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 5b2dff150d..7e893abf43 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -412,7 +412,7 @@ __gitcomp_builtin () local incl="${2-}" local excl="${3-}" - local var=__gitcomp_builtin_"${cmd/-/_}" + local var=__gitcomp_builtin_"${cmd//-/_}" local options eval "options=\${$var-}"