From patchwork Thu Nov 19 01:52:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11916365 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 E6C33C64E7C for ; Thu, 19 Nov 2020 01:52:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4065246B0 for ; Thu, 19 Nov 2020 01:52:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ltzKFwQZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727667AbgKSBwS (ORCPT ); Wed, 18 Nov 2020 20:52:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727647AbgKSBwO (ORCPT ); Wed, 18 Nov 2020 20:52:14 -0500 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A01AC0617A7 for ; Wed, 18 Nov 2020 17:52:14 -0800 (PST) Received: by mail-oi1-x243.google.com with SMTP id o25so4603887oie.5 for ; Wed, 18 Nov 2020 17:52:14 -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=xDjeYERVmZBgLAnqXkqNSn+x8uE0/N1xNl0tBZNq1xk=; b=ltzKFwQZsmZ9dgHVD5aVJ/y9PsvHNxtTEA1bP827gE6iPpmh31jhTeyhnhbhyyWWyD /hXqFuNsyRqvg4HYWeQSzo6XK/jU9DY5K1vOu583kseY5P1zj1AuOT+TR12xW9L3ivSh wf0aUAp/x3teI2vhheP0oUAo9wT9mqvGBG6Pzchs3Npb7pijE0vgtZ8MS6t1NAUjLxRR 5O/8rKHQwWeA6xHHE7Nj5WywJcMy1eaSgRMRey3M6C6BJ+bhMVK4PS1jrs9ckZy71AoB FKujG50cS07KDsmsCyvU8ro1Q68H7RXtggRwUU8bYa2scRIZbnb65bY+o0wyCtvSjQ0F nUog== 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=xDjeYERVmZBgLAnqXkqNSn+x8uE0/N1xNl0tBZNq1xk=; b=nMo/eUc2IDGyIBA9CvDdZNOZ/ZEuMFl4oROrXtLmfjNAuKbIJcFLQDiN0gozYK35ht 5Hy7J4vwIuTvGMR6FBL6O0UA0IAEuuz9+c9RjWciusSKS54JD6VEkH3I30tfUQbmKuPC h1HchZhXYjmCyl0S7Wc8tX+GScUUX1fs1T1txP7FubR8gdRQiCnZrmPbtSJ86pmvxuGx ldlBZ4rdx+P0vff0lRzcwyx6lENIR8C60sv2zD/Y+w2Bn55KRWUlGQVaQU9LGsy8NUpG 5Aj/E61o5byingoeFWgXquUfNPfPFBQ5fJVHUQbihiuyEvgjA+2k8FJppMONtmwejqhS 9o9w== X-Gm-Message-State: AOAM532XU4h7NIWhPh/XURFgliPEHYI6SO4CqsNFWdLZ1LiyWvBhGBEJ 48cLaTm6voWfSI0ZD4WsjanI9UZdrJQ+NA== X-Google-Smtp-Source: ABdhPJzkjKq38xl3qpNox49LUStzDWFxzeB0yA40MKMyExCkA8PB605BbZO5180pIyzI3ZeU24efCQ== X-Received: by 2002:aca:fc16:: with SMTP id a22mr1392425oii.133.1605750733727; Wed, 18 Nov 2020 17:52:13 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id p13sm4047338oip.0.2020.11.18.17.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 17:52:13 -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 1/4] completion: bash: fix prefix detection in branch.* Date: Wed, 18 Nov 2020 19:52:06 -0600 Message-Id: <20201119015209.1155170-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201119015209.1155170-1-felipe.contreras@gmail.com> References: <20201119015209.1155170-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 Thu Nov 19 01:52:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11916367 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 C538EC63697 for ; Thu, 19 Nov 2020 01:52:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61DA5246CA for ; Thu, 19 Nov 2020 01:52:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G5GmMFnf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727664AbgKSBwR (ORCPT ); Wed, 18 Nov 2020 20:52:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726413AbgKSBwQ (ORCPT ); Wed, 18 Nov 2020 20:52:16 -0500 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60C05C0613D4 for ; Wed, 18 Nov 2020 17:52:16 -0800 (PST) Received: by mail-ot1-x331.google.com with SMTP id 79so3827347otc.7 for ; Wed, 18 Nov 2020 17:52:16 -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=udwQE863MDU6iSYqiBMkmiS+h620h7PqpG/YqrVBlnM=; b=G5GmMFnfo3ckjKjuE1JvytRWr3pPSMYLSi7AxyPcqtb0X1Lrn9m1fq+/HWw4KT9NxN oQCYCV1274E7kiJFFCO9Jgikz+u1V1xEu/tD/qIHsXzF0FSFOGph58iM/KQlvNaTySGb yH6zbwi/0+ZMoypFF+oDtFFi+8qtFpGce/ixacLjIK3Nu7P39u2gpnaDd2EaF+VE0a8F fgO9VQ1LyyuvPL1pzu0y61zOXMMSjiLO70DvlYsSNEVgwWjCWh2//QL2LdE4GCIirj1M ovMERjq11ByG0NOXbvM+9RUA3nfGru2jp9KS+WcHBabAofxgjKvYb3vjYy9EVdCE+T4Q jzaQ== 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=udwQE863MDU6iSYqiBMkmiS+h620h7PqpG/YqrVBlnM=; b=q/dw6wWSrcznL4vWNoHCbE54EIaFz5Z7DwbzbBc1fMoV0FFU4QW2dSzBFzPXFP5xc7 0OjOj+PS/wkXWPWGpD6paKNZw2GgLm5ZFWwNDBU/bdDE0Hqw26eUfXrOfgo4Q3upGzol 4065yLqWPvCsfck5kxacz62Nef99rEj0vkeM45X75zBsEXrlbBa2vg0Dhe5ftCMsH/lH /MSYw7tV9PGW6AmBiFwSy1fjf+LJj52ZREqthGW+Fyh/tWnY9t/V7vuRQ5eHiEy27TdI LKf3SpEZHzsJbZ6eD9rWG5lOlzEpUBg7aAj/AF4SFST/kFYsKOf1X00zH1FpZdE1dAYO 4p2A== X-Gm-Message-State: AOAM531FIPdo8H+WHMPYJqIPwygZHWwfvvP0mqv7QrPLH4ZWL/9VyOJ5 FIhYrT9MkpPv7dt8CjCeVCa9OfCOehepAw== X-Google-Smtp-Source: ABdhPJyh6d71S/xkRmGWPKH/SH4oeixkU9oaySoGhiHTC+gX+MQ2JEtwYrD4WkeSRF6aK+7hSl6pbw== X-Received: by 2002:a9d:5549:: with SMTP id h9mr8846475oti.230.1605750735387; Wed, 18 Nov 2020 17:52:15 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id t199sm8634706oif.25.2020.11.18.17.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 17:52:14 -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 2/4] completion: bash: add correct suffix in variables Date: Wed, 18 Nov 2020 19:52:07 -0600 Message-Id: <20201119015209.1155170-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201119015209.1155170-1-felipe.contreras@gmail.com> References: <20201119015209.1155170-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 Thu Nov 19 01:52:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11916369 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 4B43CC64E75 for ; Thu, 19 Nov 2020 01:52:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3E79246CA for ; Thu, 19 Nov 2020 01:52:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JQLagNGa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727676AbgKSBwT (ORCPT ); Wed, 18 Nov 2020 20:52:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727647AbgKSBwS (ORCPT ); Wed, 18 Nov 2020 20:52:18 -0500 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F45FC0613D4 for ; Wed, 18 Nov 2020 17:52:18 -0800 (PST) Received: by mail-oi1-x22a.google.com with SMTP id k26so4619861oiw.0 for ; Wed, 18 Nov 2020 17:52:18 -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=iUt7GQutxz3mgHglSFcvh2I2ipKDO2u3MjWJhgdu43M=; b=JQLagNGak8GZnwo0YuJN8W/4dMU6DmOAvHvBjtVR4xD8fhXQyHAB+uS6m10pLShFS7 P3Jb90WVaROXf8PPk/J5+5TJlwYueMSKchzXaNQvac9TOBIrita2Aei1tzVFW6mPiwLy 7lQDqgAGJJSkOjzYicZoFuhcUEh6zKZKKY2bZEQJVz0WxlF3uDcxQRF/Q8oa5JeK0QGY MavtGxTPbfbw7pNUqYP7+KGBOEYGCaKzb/bBc/564MkH5xD43TAvUE4+xJdYgoRewUXP Ef/iejPXGJsBnhpPxtzDC+rR0/7r8k8c8ZOHK+8Miff1hgbUe39W2UNTl+CeAjc83BHx nlYw== 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=iUt7GQutxz3mgHglSFcvh2I2ipKDO2u3MjWJhgdu43M=; b=kJ1wqmbDgObUXnyugFvTgVp6CQXt9k612i2Iqn7Owx15E0quijzKgWMcYQ+cLAk/aM tH7HMUAPUCsP0qqus0K65mn6Z6ANaMuRA3w/x4Jm2ru0mN/12/Yn4umfLW4O+H6AjA4L Oj3+6C+5wvci/17lkDJOEuq42wjrVTm9DiTk+yyypc82kEYmbYlLdhdvJu9ZZMPXGKC1 YLHec9pcuettF90soR+JxW+g2/HXTZHe08ipxSLaabGwGBO1iN1ZYrFl5j5/qcIuai7X HbZdL1OTWX6qfLiwvvF93s1cbK5oxrUiXV1zIj8tOXNKLzg0/twhOT1Q+8HIl4wdOQ88 hdRQ== X-Gm-Message-State: AOAM532xG8nM6BkluwxkibGI/X6LfZCZtlLoBfK3ymeyzstcfmPYBVlk xv8VIthiOehJZLeO3DuhACqd57QHBtFdYw== X-Google-Smtp-Source: ABdhPJx6qkJOA88PWWzrvQ90H6+Fl7SZudt0g3KTIhxqwqhqIWxXypa5JNeSIebMvyujm7OAjpbrwQ== X-Received: by 2002:aca:c188:: with SMTP id r130mr1451829oif.99.1605750737414; Wed, 18 Nov 2020 17:52:17 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id p128sm8869200ooa.14.2020.11.18.17.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 17:52:16 -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 3/4] completion: bash: fix for suboptions with value Date: Wed, 18 Nov 2020 19:52:08 -0600 Message-Id: <20201119015209.1155170-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201119015209.1155170-1-felipe.contreras@gmail.com> References: <20201119015209.1155170-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 Thu Nov 19 01:52:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11916371 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 8A5DFC5519F for ; Thu, 19 Nov 2020 01:52:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F37B246B0 for ; Thu, 19 Nov 2020 01:52:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="unpgyZZd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727680AbgKSBwU (ORCPT ); Wed, 18 Nov 2020 20:52:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727647AbgKSBwU (ORCPT ); Wed, 18 Nov 2020 20:52:20 -0500 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB10FC0613D4 for ; Wed, 18 Nov 2020 17:52:19 -0800 (PST) Received: by mail-ot1-x32c.google.com with SMTP id g19so3803467otp.13 for ; Wed, 18 Nov 2020 17:52:19 -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=IWoZtF1VZH47/ZAyIkPbPGCGbViAu090DExcf75tZRg=; b=unpgyZZdHn5L6URJm0dqNpGiM2Wa/8aCWs/kGYwOazMhaZxeHlg3GGvEXkI1Eq/BwC LW7ZEkG0i3VUltsCnwiT/39aPcsvw7cvpYmemFQaFvOT/6m6fYGKSXRy9XXz7ly7pThW kPnmhDjX+3Q2EvbYSTeZ/zCiTUbWz8zz4pe5rBjO4Fq1MvqDmETmH+uXO4hqKrz/K3O6 ky/d6CR3ehfUCc+6otmdZhpQDlwgAfLNChQhsESyR/v58X0G+uv2Dw+EYJQzTS6f4AIJ 4mxuBwc3P5X9bwfQUM+p2HbNjrWfAywmbZUP9lnx3nxxDXQIGDXtx1wWw4f37dMUcFai H3RA== 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=IWoZtF1VZH47/ZAyIkPbPGCGbViAu090DExcf75tZRg=; b=DZX1Ch/seks7jASWiVAf2LVFMQshKdnUir1K2l8PfiI37PaUyp+3HtqJSIkiZ45hY1 GQy/5Y5Ovn54U78oGb9i7GLmDLs362dB1a4JHvQGPit8ypKF8lUui2f8QupxpdKWjXBY uCnzFRfOLHrYGQsqOImHis6spxyWAIeg7zIK6fd4UBaBl+hUOaOnm5qwnMHd+xK6L1wY ch8zJQNSGty2RtWgDlM9ltF+jcUqvqhz38Dmq7MiQJsemTYOE3It0xFb6GisEe1/TmO+ 1OtO5Yu0pq9/7PqATDhDoBdSQOG5pp+RtwptxJNO7/0PwPA7xr0XgIurqbg9cZUfVGHm VjCg== X-Gm-Message-State: AOAM532/Gj428AckszY1uGZz7rdZ7paJoNGFBMpAAhpJhS43OBTPtYOe 1rAZcPkXx9NVcGFsRXwF2L425xJ52Ca5vA== X-Google-Smtp-Source: ABdhPJxwSyt8cT9684BAouMA9l/iLqKaN7WuR5ura5D4kKV76gU8r+NLEHLbTb1hOlyOFCe0t7Zy/Q== X-Received: by 2002:a9d:67d8:: with SMTP id c24mr8678418otn.356.1605750739130; Wed, 18 Nov 2020 17:52:19 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id x69sm6805363oix.1.2020.11.18.17.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 17:52:18 -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 4/4] completion: bash: fix for multiple dash commands Date: Wed, 18 Nov 2020 19:52:09 -0600 Message-Id: <20201119015209.1155170-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201119015209.1155170-1-felipe.contreras@gmail.com> References: <20201119015209.1155170-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-}"