From patchwork Fri Jun 21 22:30:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010767 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 265AC14BB for ; Fri, 21 Jun 2019 22:31:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1778C28B68 for ; Fri, 21 Jun 2019 22:31:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B90228BAA; Fri, 21 Jun 2019 22:31:14 +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 B21A628B68 for ; Fri, 21 Jun 2019 22:31:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726106AbfFUWbM (ORCPT ); Fri, 21 Jun 2019 18:31:12 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:35900 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbfFUWbM (ORCPT ); Fri, 21 Jun 2019 18:31:12 -0400 Received: by mail-oi1-f194.google.com with SMTP id w7so5766852oic.3 for ; Fri, 21 Jun 2019 15:31:11 -0700 (PDT) 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=VtHV5zTS3soqq+ZGlAysNvSswCep2UXClY2cSqCUe90=; b=myjjPgkjSlHVS8sMf9RVIbYmUXI0z7asVQgOdOTX1xbOWPpTknWJhL920v40RAG5tR xMJU/DN3L3Km7/yxjgchuJ1IXHTv5jmM87CAX1qJeVC3g/cPZ7eoWJ0uJJgJc/mOp0kf rNk9Ia1I2JoZl84W2jonoFqfxXNI+LWX80ddhUn6Rg4OJZZwzAYHXvarRPWRkB1N0Tob M3hrCcQkVujvrDkdARp/N7cVZhcEKKQEcUapfFOG8SfkLrJ5HbpiRFsIFON4D2OK4vBk T7IktqbU4ThIa0t4IDZt2wWrUbYyLH4KqKok1Kz3D0JeQP257rfA72tLkIDRe1r1hIyu n08Q== 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=VtHV5zTS3soqq+ZGlAysNvSswCep2UXClY2cSqCUe90=; b=Q1CZg0TamK7ALH7YAOa2PADutrbvJaWlg+d5HjukYn+WRM+GnjqXNSWh6iTZO4DEMY tkdKRvLKQxYlC+ro6Q+vVXyYiG0OashjwViNSlCwh3pJhLrNNzH27xWWAIdZ6P1kNkWn 7dsNUy75kEVvy+ck+RR6rBi5MdV3OS/kwLuiZqnIi4rxpZzDx4xx1haDnoWy6lN1QZnd nBp1x/JirAgH1iIK3YzLwDdD7Z8ZCxhEbBdgoKwYA4HRDidMdNrTZLq6v5jvw7lEsaqN sd9APGP0z5FPbITw4lpe4YnOh41iI7AarHvBQbF24vkPTF9nzEHgMCI4Rf6Mu0XuoWqN gNGA== X-Gm-Message-State: APjAAAWB4PXlwmYI4qGnWhm4sW2QrDK37rJoM2P15t55gMHauLiWh6q2 BAhuKOJ0RXDnx2d0cbbPdTzAXKZl+g4= X-Google-Smtp-Source: APXvYqy2EP2bMnz6N/ZFXJHyUDn64UYA8T+fWzW4Ti3U9bw28dVFGZTf12tw/zjn7JJ4vp1+35Tv4Q== X-Received: by 2002:aca:b808:: with SMTP id i8mr4162180oif.160.1561156270996; Fri, 21 Jun 2019 15:31:10 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id a125sm2124153oib.11.2019.06.21.15.31.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:10 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 01/14] completion: zsh: fix __gitcomp_direct() Date: Fri, 21 Jun 2019 17:30:54 -0500 Message-Id: <20190621223107.8022-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Many callers append a space suffix, but zsh automatically appends a space, making the completion add two spaces, for example: git log ma Will complete 'master '. Let's remove that extra space. Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 2 +- contrib/completion/git-completion.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 9f71bcde96..a65d5956c1 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -3009,7 +3009,7 @@ if [[ -n ${ZSH_VERSION-} ]] && local IFS=$'\n' compset -P '*[=:]' - compadd -Q -- ${=1} && _ret=0 + compadd -Q -- ${${=1}% } && _ret=0 } __gitcomp_nl () diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index 886bf95d1f..0d66c27366 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -73,7 +73,7 @@ __gitcomp_direct () local IFS=$'\n' compset -P '*[=:]' - compadd -Q -- ${=1} && _ret=0 + compadd -Q -- ${${=1}% } && _ret=0 } __gitcomp_nl () From patchwork Fri Jun 21 22:30:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010769 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 67ECF14B6 for ; Fri, 21 Jun 2019 22:31:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 599CE28B68 for ; Fri, 21 Jun 2019 22:31:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DD4428BAA; Fri, 21 Jun 2019 22:31:15 +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 0895D28B68 for ; Fri, 21 Jun 2019 22:31:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbfFUWbO (ORCPT ); Fri, 21 Jun 2019 18:31:14 -0400 Received: from mail-ot1-f51.google.com ([209.85.210.51]:47078 "EHLO mail-ot1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbfFUWbN (ORCPT ); Fri, 21 Jun 2019 18:31:13 -0400 Received: by mail-ot1-f51.google.com with SMTP id z23so7754577ote.13 for ; Fri, 21 Jun 2019 15:31:13 -0700 (PDT) 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=fJdJ+cVBt2NPC+R8OslmiCr4boUthgsYe1wDirGtLvc=; b=H6ol2eCSjqxwcCYZK4Bcdx62GQtMq0/Ujt0pEXQmhbszY1RsLWAgAIJMOQO1RWeqAu Y2hyeeZSF6Fi7Dpbg8UYkeqwTcvAkzdFKawKsGs3ZhOXe1I2ncTE4fWBkvpa80RJ2Yu5 eNuEWF8MqD1SRu1qEHZDwqxAOtfXoVmJNbKKrdh0Gc4C+QHAYRvz79W8xK/7NR3GLxQY RaAEWa+JIJ015PkkMY97SpfteuSHLi/RJa7/cgOkEiwlZZoGyJOXntm7ooWpSRjc66f5 39ESXR7BK5fHYNJDLNFzKOk2yZ9tCxnxMoXT17cGcIFck/BAGzeC7hluPpqJcbwFvvLr Mr+A== 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=fJdJ+cVBt2NPC+R8OslmiCr4boUthgsYe1wDirGtLvc=; b=HSPcSlwOZO7GAB1ftC1Rk1Hm5NbbR2/hGmA0IVMezl89tmXBCH91aLRnPzY4BWNWFm tktFK2c9sNZpmkWzxZMuN9HGTyp+VKHct1U++Y/+4aje4lIXfMACBguH6GIZYhH1zeHi gFU1S8k0e8VP/56cccpctr5ko4zFzKwLNsX0xHVCjiwmQZorloAOaQ/Ghe5Z9PdW4I3y 4jbyvHWQcgxEVt7EkbIEy8yQeLSqxK9H95IKPj2QMjUUkDxuDdNHMvgC8vHGVxFQ1DUB UGRnEI5W4VO8d11eC7wocDBgvsSYcilQ+YsQv53eb9H26BD3v9UNKFxOgQkGA9DPRXVG eIIQ== X-Gm-Message-State: APjAAAXvheUTcFDb7lMqo7aRMubLNUrfFjO7efYI2fBvt6TJL9v41cBv OnfA6VLNAbY0k4+u66PQy1QHWk7hag4= X-Google-Smtp-Source: APXvYqyQqVPfov8ozYFGXs9StW2bse1OJWwisIF+UsTdz6LtrsAss3I4NmPrLwvXc7QkbAateprfQA== X-Received: by 2002:a9d:7d92:: with SMTP id j18mr58867107otn.339.1561156272261; Fri, 21 Jun 2019 15:31:12 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id y7sm1488273oix.47.2019.06.21.15.31.11 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:11 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 02/14] completion: zsh: fix for directories with spaces Date: Fri, 21 Jun 2019 17:30:55 -0500 Message-Id: <20190621223107.8022-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index 0d66c27366..034cfa9e8f 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -30,7 +30,7 @@ if [ -z "$script" ]; then local -a locations local e locations=( - $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash + "$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash '/etc/bash_completion.d/git' # fedora, old debian '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian '/usr/share/bash-completion/git' # gentoo From patchwork Fri Jun 21 22:30:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010771 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 6369714B6 for ; Fri, 21 Jun 2019 22:31:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54F4028B68 for ; Fri, 21 Jun 2019 22:31:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4948528BAA; Fri, 21 Jun 2019 22:31:17 +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 E84B028B68 for ; Fri, 21 Jun 2019 22:31:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726135AbfFUWbP (ORCPT ); Fri, 21 Jun 2019 18:31:15 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:37549 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbfFUWbO (ORCPT ); Fri, 21 Jun 2019 18:31:14 -0400 Received: by mail-ot1-f66.google.com with SMTP id s20so7815899otp.4 for ; Fri, 21 Jun 2019 15:31:14 -0700 (PDT) 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=d6glZen2FHhNpBd7NuG5ucGaYIH6Wvhl9FFVY2AGf4o=; b=Ebm+TcTLtYv0T7kjTJzkfahf2Pt6BzJ6wlMZp7rG8L6XzwkHw0tY1m+OL1uyD4Eivb zv4F8ZGUShCNwSzXLYPwBitFA8YdWSVhG7UM1f73oS8xMe6tHhtu7HvymN1RcxE/nzvB V1YZsv8sXkXzQzO8LREx1fstMynZ/0h2CTSO8Okxy0KD8iHnCSQ0xOMorLhx0s2GVodt k0TfTeVrw6xEYCkG6zLaDFT/Aj0BHoplw8VOPXEsob02CUMDi7LhYEDyk62uWDdRMAd7 YdIQOwtGuzi7QsG7MCZNsU69rdY/WZO+lfteDlVrYQMsmw+UTpcAeP3mKKWNjWbkFcqR SRhw== 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=d6glZen2FHhNpBd7NuG5ucGaYIH6Wvhl9FFVY2AGf4o=; b=NvlIFNmL6g7Yo+jZND7b2gTXi2KvWKhkdV/kyWZIL7tvoQ854jpNhlrvhZLMzE0D5v 2pmkIW0rnvoN6LKOQwb0eNG5Fd+Y15AaQot8lRAl6lklz15Ntoz981mWKteLu3P/j6um cEsZU3wlSwfstDEUQjbPIoJqr310xSxEOb03Px7b2RLc7tEAJ4UyeakIBfAa5vEEOX9a cSEE4ERzyfPDBiAu+5jSw8fjYeuWhcpYGwDnI97Hy6cNEhgkYB4m4FirBMcOjphHhFi6 XlOSSzEXSnqVVX6tR90cFLxNSGg55ji/FwUW31eKE2sT9LtO3ct1PYoZ6PzNDlwXWRwX JimA== X-Gm-Message-State: APjAAAV42+TUl9lJaB7wyIz7gJWvCbEfIMPAXADQBWqHl1ZkNmhu2HEW vMhbQuUe5v42nrVPyHbbqv2lu9vjSXs= X-Google-Smtp-Source: APXvYqx4eZH2KwoEc3Vv/GhUZf7h7+iKLDk72bBBT/4jVIuAz5hhPkRF7jJ/huSYuHPPB1bkYGLPog== X-Received: by 2002:a9d:2969:: with SMTP id d96mr4549712otb.85.1561156273421; Fri, 21 Jun 2019 15:31:13 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id a4sm1466196otp.72.2019.06.21.15.31.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:12 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras , Mark Lodato Subject: [PATCH 03/14] completion: remove zsh hack Date: Fri, 21 Jun 2019 17:30:56 -0500 Message-Id: <20190621223107.8022-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't want to override the 'complete()' function in zsh, which can be used by bashcomp. Reported-by: Mark Lodato Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 1 + contrib/completion/git-completion.zsh | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index a65d5956c1..676b19a983 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -3066,6 +3066,7 @@ __git_func_wrap () # This is NOT a public function; use at your own risk. __git_complete () { + test -n "$ZSH_VERSION" && return local wrapper="__git_wrap${2}" eval "$wrapper () { __git_func_wrap $2 ; }" complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \ diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index 034cfa9e8f..aade33ec9f 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -16,12 +16,6 @@ # # fpath=(~/.zsh $fpath) -complete () -{ - # do nothing - return 0 -} - zstyle -T ':completion:*:*:git:*' tag-order && \ zstyle ':completion:*:*:git:*' tag-order 'common-commands' From patchwork Fri Jun 21 22:30:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010773 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 C6FA014BB for ; Fri, 21 Jun 2019 22:31:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8D4428B68 for ; Fri, 21 Jun 2019 22:31:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD1F328BAA; Fri, 21 Jun 2019 22:31:18 +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 654C228B68 for ; Fri, 21 Jun 2019 22:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726145AbfFUWbR (ORCPT ); Fri, 21 Jun 2019 18:31:17 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:39762 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726132AbfFUWbP (ORCPT ); Fri, 21 Jun 2019 18:31:15 -0400 Received: by mail-oi1-f194.google.com with SMTP id m202so5757600oig.6 for ; Fri, 21 Jun 2019 15:31:15 -0700 (PDT) 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=gLuzT2L8a7/hrrShWA9VlzKiDNx5TG+AFuchFC22wKE=; b=C5tsw2LgwibLcU5GBRbIsRH3z39WmDrOoQRETBOwk/VOY1JdINHm8uu2RLd/CBurQL QyrUoWYKkd0RTTiTrEmtPLYAplNxOvjoYBui9WQdtzG3jGA91dN6blb35O/mlvHehch5 cfqtAEtFf7K0fhUWNd0CQXgjUv+7Ci6Wq+3Eij+3alC2/bx8AfYB8Rzwr43qj4G8V4S1 F15iwFU2ywtK5sAXLMAR2agOKIh+MFmPdrVd43jDUjoZV1XDLdg+I3iETDCDBjAejzqP HtsdNAE3utRo3isqOuk2q2EWm4EMCh3jYxR+OsCrWg7m/jGX6+zjk9bbaskg2IWYQP05 v00Q== 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=gLuzT2L8a7/hrrShWA9VlzKiDNx5TG+AFuchFC22wKE=; b=auP8NFYwMo8QtAw0RrNTRI5SDDaWyH7SwYaY7iqRCwQDAzpPU9OSdroozvLvCZdvM7 fPdXjrGNdf368q6SnmLn1gT6xLu+WH62XxA4QWX7WrcttsLY6sBkUae0PsbxZ9bAzeTk XFZGAFA2e/ABFvknvvV26OduGnWG2mq7Rv+o0BNp5Db8IBG8JsTuJ4G4U5rF6YTVXrt5 aHy0BtuiysS7YWtb/zqPvTyTeTdSYvas3YgZZhIwkGp8zRMT6sTG5lS8Ctlx3lEVs8q2 +8tB64mp1ie/9CpUBJlLhL8h/Sm1yNkiBqkF6i09e/fwYbv97PC6eminbTNU49ayZHak 5P5Q== X-Gm-Message-State: APjAAAUACzgy8AFavfvAzRFggsJNMd02U/jWQbq+6TVti1sdTpBo0/l9 0rYqMcN25vWqLhJTJ4d0/3mGZdNIA2g= X-Google-Smtp-Source: APXvYqwaQe+LJyxBCrUqsXD6k8Ykq0mca44U4CWOKijg4kerNIdkDMRPrOIvp4+zhA4rIXkwQ/xj0A== X-Received: by 2002:a05:6808:904:: with SMTP id w4mr4294657oih.9.1561156275001; Fri, 21 Jun 2019 15:31:15 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id o32sm1630453ota.37.2019.06.21.15.31.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:14 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 04/14] completion: zsh: improve main function selection Date: Fri, 21 Jun 2019 17:30:57 -0500 Message-Id: <20190621223107.8022-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sometimes we want to use the function directly (e.g. _git_checkout), for example when zsh has the option 'complete_aliases', this way, we can do something like: compdef _git gco=git_checkout Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index aade33ec9f..2801f2f7c8 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -226,8 +226,10 @@ _git () if (( $+functions[__${service}_zsh_main] )); then __${service}_zsh_main - else + elif (( $+functions[__${service}_main] )); then emulate ksh -c __${service}_main + elif (( $+functions[_${service}] )); then + emulate ksh -c _${service} fi let _ret && _default && _ret=0 From patchwork Fri Jun 21 22:30:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010775 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 6118014BB for ; Fri, 21 Jun 2019 22:31:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 537F628B68 for ; Fri, 21 Jun 2019 22:31:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4807128BAA; Fri, 21 Jun 2019 22:31:20 +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 DAFDA28B68 for ; Fri, 21 Jun 2019 22:31:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726017AbfFUWbS (ORCPT ); Fri, 21 Jun 2019 18:31:18 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:38135 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbfFUWbR (ORCPT ); Fri, 21 Jun 2019 18:31:17 -0400 Received: by mail-ot1-f65.google.com with SMTP id d17so7812977oth.5 for ; Fri, 21 Jun 2019 15:31:16 -0700 (PDT) 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=3wNVDSlcvLahwcBHvW1EWHcHUefUg887W6V18J+PVN8=; b=vgjqIPxzOxxuI4tWd9rQhEkyduFW+QfwXJoSQO6fMEyXEt2a21j0FjO/oLU8W478qy zc/r6emm8CYxo97kXueZOZw96fxYCn8k1viWLbhCfbEh4/6IoH+znRy6J/PrIcsvTZrF 4VIEWzrt4EZRWQY52rxGRzv36cZ9HTu+RKGn66FUOqvnr8K3tzuoIDMsmgG18n4Ow/As Q+zNwUGB4GtZQd7xyko05S+KKB0wIMg0GaZ3gGBPkm3UL6xoIQRvRlbPf5pR0JcCkGhY KKqfxAt/6LN6N57WWfjBqwCO9Blxl/vJy+LxuugSJVYEO+nyFyin+S9UWOhY/rT+tfrb c6sw== 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=3wNVDSlcvLahwcBHvW1EWHcHUefUg887W6V18J+PVN8=; b=S4c1Qispw8/aaQgzKhWsr85d0nHaDlYEvsEZ5D8MDWyV6YIbhGqR/ZcsX31oOA+qmC gzLoRSn+gV3j9/ypaJXWMSq+NSAZSK9CG9xjrQ9TQUml+MqKvxvtlo87NtXLqAbWnYsI xdA+SAgKlZyGS2+GDbUINDYZRLomiOVWH7GNYkNE90UxjqLvKCIe9skmCE2H/tkp6DP6 E99ZNEWXP+yJ7HkCJaze211vdC9xALglhJpNZMrZNadBWyEbGXFtAeqlP0etm2HiUNn6 cdWb3O3ynl1/RKNUJa9eHY/mya4xLzMXVzLXrxLC3pk9cGSuHY7qpjsHL52yBtL5WfrL 5HzA== X-Gm-Message-State: APjAAAXDOWpqHCPBg5H9MWJD95CrSmWo3MN7LjF348TmBjQaEQigEA4R qVBJmJ6ZCNPphHrUjGGZg70BSUfdzsI= X-Google-Smtp-Source: APXvYqxnma1qry164iKAiEpydNFjx2gQtJrO77y7Wij0GcbQjOzkL+cKLMn1kiWLb7oZwNYbFaLmpA== X-Received: by 2002:a9d:76d2:: with SMTP id p18mr7947674otl.309.1561156276218; Fri, 21 Jun 2019 15:31:16 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id 98sm1447325otd.5.2019.06.21.15.31.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:15 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 05/14] completion: prompt: fix color for Zsh Date: Fri, 21 Jun 2019 17:30:58 -0500 Message-Id: <20190621223107.8022-6-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need PROMPT_COMMAND in Zsh; we are already using %F{color} %f, which in turn use %{ and %}, which are the equivalent of Bash's \[ and \]. We can use as many colors as we want and output directly into PS1 (or RPS1) without the risk of buffer wrapping issues. Signed-off-by: Felipe Contreras --- contrib/completion/git-prompt.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh index 983e419d2b..b57a9c96cb 100644 --- a/contrib/completion/git-prompt.sh +++ b/contrib/completion/git-prompt.sh @@ -88,7 +88,7 @@ # If you would like a colored hint about the current dirty state, set # GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on # the colored output of "git status -sb" and are available only when -# using __git_ps1 for PROMPT_COMMAND or precmd. +# using __git_ps1 for PROMPT_COMMAND in Bash, but always available in Zsh. # # If you would like __git_ps1 to do nothing in the case when the current # directory is set up to be ignored by git, then set @@ -506,9 +506,11 @@ __git_ps1 () local z="${GIT_PS1_STATESEPARATOR-" "}" - # NO color option unless in PROMPT_COMMAND mode - if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then - __git_ps1_colorize_gitstring + # NO color option unless in PROMPT_COMMAND mode or it's Zsh + if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then + if [ $pcmode = yes ] || [ -n "${ZSH_VERSION-}" ]; then + __git_ps1_colorize_gitstring + fi fi b=${b##refs/heads/} From patchwork Fri Jun 21 22:30:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010781 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 012B717D2 for ; Fri, 21 Jun 2019 22:31:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6FD928B68 for ; Fri, 21 Jun 2019 22:31:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB8D728BAA; Fri, 21 Jun 2019 22:31:23 +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 872CA28B68 for ; Fri, 21 Jun 2019 22:31:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726159AbfFUWbU (ORCPT ); Fri, 21 Jun 2019 18:31:20 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:38138 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726132AbfFUWbS (ORCPT ); Fri, 21 Jun 2019 18:31:18 -0400 Received: by mail-ot1-f67.google.com with SMTP id d17so7813004oth.5 for ; Fri, 21 Jun 2019 15:31:17 -0700 (PDT) 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=V7B5wUIOydFQBWwS7yWUcuF1hXZLRQjmoz4+Qv/xbdE=; b=u5/2zv6+0BhHBcfd3DyG2ODZrOz3zq564v+sn3Y7AIVVNJXS34pnHbc06hYpeKLBPV ETfTiUoB19YEO69C5psUVL6+LFgGW6Fks9LOfsBrbmvAcDIUXn98wzWR6/j4IzhR3Tp7 kZ+TAEdrcw9q8KamGHt8Ut2JYniLWo0QF8l0mbOGS2Z/JyJQRCoZzMD8/27ntzqR6AFG fZdrPuW4WtGPRrmBKHFsg9OEY0dsLESaAHlA3e1EnRnqJegZR5e+/A+NMWBuc24N4CKz K1NqdjOU9aL/zHPlIohJqhIocYyofeins31ork106+ew45jGfO/5ZOG6r5JO0ikthmLk 7Wxw== 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=V7B5wUIOydFQBWwS7yWUcuF1hXZLRQjmoz4+Qv/xbdE=; b=pqhp2XFkficyKvNGGEWD0xhBY3JlD0BbrPHYSq74IsHtTwE65OcpxfFvtG0k+Xtqrt p8RobvicmJCGj5Ow+8x3BUVrHTF5Z5UWN2M7XYdxDmwfCqUCMlILZe7PLkLjiVgKPGYA foOdwUtQL9jVV78qnnyN7V8o+HjBKwGaNt3gnxuF1dbW3X1fDBixnKqcK1RqRBKrJk1X 3LLrmr1DcHv9CeU1K7PYdrb+PRyvsd0Z1EwwzGzTe5WJM9noIhy1vPSMYHkEJhcXjPiH Tkn8K30GiAkQmEfkIQp3Sh6fjUKPHE2uMz7jg8Qfd6Ht3XpOfY0HsseUuneLn7Hv8EFb 3KoQ== X-Gm-Message-State: APjAAAWWEvlxvuzHIyWCatJxL13S8KNGux39D5a/7sy9mVcnWljWW8F1 uDPag3oTFHcrP6/rTX22GX+lUicfzU8= X-Google-Smtp-Source: APXvYqzSxTZ3xaU6n2ZMUUlaxUgnu2LcJEqogqr8sm3lo5yRrDUa3RdDGt82dj99Gvs8TSAxZvW4Ig== X-Received: by 2002:a9d:7b48:: with SMTP id f8mr19709611oto.207.1561156277448; Fri, 21 Jun 2019 15:31:17 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id s2sm1619590oif.46.2019.06.21.15.31.16 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:17 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 06/14] completion: bash: cleanup cygwin check Date: Fri, 21 Jun 2019 17:30:59 -0500 Message-Id: <20190621223107.8022-7-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid Yoda conditions, and use $OSTYPE. 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 676b19a983..dba822d0e7 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -3092,6 +3092,6 @@ __git_complete gitk __gitk_main # when the user has tab-completed the executable name and consequently # included the '.exe' suffix. # -if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then -__git_complete git.exe __git_main +if [ "$OSTYPE" = "Cygwin" ]; then + __git_complete git.exe __git_main fi From patchwork Fri Jun 21 22:31:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010779 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 A2BFB14BB for ; Fri, 21 Jun 2019 22:31:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9422228B7B for ; Fri, 21 Jun 2019 22:31:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83B3328BAA; Fri, 21 Jun 2019 22:31:23 +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 26E8C28B68 for ; Fri, 21 Jun 2019 22:31:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726166AbfFUWbV (ORCPT ); Fri, 21 Jun 2019 18:31:21 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:41596 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbfFUWbT (ORCPT ); Fri, 21 Jun 2019 18:31:19 -0400 Received: by mail-oi1-f194.google.com with SMTP id g7so5759133oia.8 for ; Fri, 21 Jun 2019 15:31:19 -0700 (PDT) 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=SmY+RZVTbVliZl9osV3W5bONsETFN3QAnBi1k8sTKJY=; b=jYHaPxPVE7n3mGsnLPm2L0uD23E40+FizHgnAN3ixNkyjSenx1cdjjcGzyaNJ1oP0T gNW1U3J3ZZBP/g69wlGLkmJYjQ15CTuwu44AOwAWzTst7zbkKhCwTDKcr9qAgxqXWccZ zQ5QpsAJLSknF2e+ZYHPOcW3h94I0FDwH96aHfoWTPWZykul7/UdkMlWVJXd03NFgVVg h4EWCKp2sMgLWaMJrN7JCQONsrt900XGpaowpgtyax1GLQ5qEor8Nn3Qgy/X1JQ1Z2Uc PS0flTXAuS9JD+CL+R9s+2x04gOdlTTg0tNgaivIAKPANhhigblHQ+G3yW0QFQ0T/QDq 9H6Q== 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=SmY+RZVTbVliZl9osV3W5bONsETFN3QAnBi1k8sTKJY=; b=A4mbRA1ItcuNgpCn5NYU4pmxntL1mvft+r0luRcvNNzsAxjC9ZUXLtUbqxSLh8kVXA 4n35Sdc9lPqHmxixSB7j3znXN0VAaVjsF8ZbGZ52bYfcZbLh0006ejiyL9psAuvxiSkX v37EVTRIUWKWIS/Nt0Pj/ZjrLoB596giRY2vmqcowhFLwk+HqR5uXXTTPiHZVAU8NZU1 aT2wbIBnfC06r1dCTzWqlozGLf9lekJVcP1zdt75DM4q1835+GSti0e4vfktfTSQi2DU ddx/tnmuGr4AhsHP7f38guF+rj5P175+e9VE8c9+rBdwqeAep/FXCtwVFfxgZ4x5SRP7 +Dfg== X-Gm-Message-State: APjAAAUXnjQuE+/EQ9nyPu08SqhsplU+K4KHXFxRF0NWZwIe6YD40pZE 5fpb3vBGv03JBarymUpjKvP1c46lzSA= X-Google-Smtp-Source: APXvYqwBIOr1FranjQU/0I4ZDNa13n//2f0OwTo/0eCZZer07tw03kJfTHHIwvW1kEzXeCQjiUdXuA== X-Received: by 2002:aca:318c:: with SMTP id x134mr4082032oix.125.1561156278745; Fri, 21 Jun 2019 15:31:18 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id f5sm1432583otl.51.2019.06.21.15.31.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:18 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 07/14] completion: zsh: update installation instructions Date: Fri, 21 Jun 2019 17:31:00 -0500 Message-Id: <20190621223107.8022-8-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 0e5ed7cca3 wrongly changed the extension of the bash script to .zsh. The extension doesn't really matter, but it confuses people. I've changed the text to make it clear that your zsh script goes to ~/.zsh/_git, and the bash script to ~/.contrib/completion/git-completion.bash (or wherever you want). Also, update the default locations of the system bash-completion, including the default bash-completion location for user scripts, and the recommended way to find the system location (with pkg-config) Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.zsh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index 2801f2f7c8..7f614d5854 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -4,17 +4,19 @@ # # Copyright (c) 2012-2013 Felipe Contreras # -# You need git's bash completion script installed somewhere, by default it -# would be the location bash-completion uses. -# -# If your script is somewhere else, you can configure it on your ~/.zshrc: -# -# zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh -# # The recommended way to install this script is to copy to '~/.zsh/_git', and # then add the following to your ~/.zshrc file: # # fpath=(~/.zsh $fpath) +# +# You need git's bash completion script installed. By default it will use +# bash-completion's script. +# +# If your bash completion script is somewhere else, you can configure it on +# your ~/.zshrc: +# +# zstyle ':completion:*:*:git:*' script ~/.git-completion.bash +# zstyle -T ':completion:*:*:git:*' tag-order && \ zstyle ':completion:*:*:git:*' tag-order 'common-commands' @@ -25,9 +27,10 @@ if [ -z "$script" ]; then local e locations=( "$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash - '/etc/bash_completion.d/git' # fedora, old debian - '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian - '/usr/share/bash-completion/git' # gentoo + "$HOME/.local/share/bash-completion/completions/git" + "$(pkg-config --variable=completionsdir bash-completion)"/git + '/usr/share/bash-completion/completions/git' + '/etc/bash_completion.d/git' # old debian ) for e in $locations; do test -f $e && script="$e" && break From patchwork Fri Jun 21 22:31:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010777 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 A864E14B6 for ; Fri, 21 Jun 2019 22:31:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A0E628B68 for ; Fri, 21 Jun 2019 22:31:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D9C428BAA; Fri, 21 Jun 2019 22:31:22 +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 4452D28B68 for ; Fri, 21 Jun 2019 22:31:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726169AbfFUWbV (ORCPT ); Fri, 21 Jun 2019 18:31:21 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:38142 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbfFUWbU (ORCPT ); Fri, 21 Jun 2019 18:31:20 -0400 Received: by mail-ot1-f66.google.com with SMTP id d17so7813090oth.5 for ; Fri, 21 Jun 2019 15:31:20 -0700 (PDT) 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=BfRxdb8eKY8MDPI9i3gxFPCVkG++59Jqk+mj8yGT3oo=; b=Bv2A6uwasXwGppe2tpnLmtuG80MxAmso2MZKJhA8MWnn2jFUbvE4VOKIWHz2Dzd4Ec KwwPwDUiBhX1HMMGhTfn80Ty92+1YVSzOdeIXraUGGn3t7tJsr7R8+vMVcW64VOI+ALW hE8W39pfDmo/OWbWSN6dw4tY13X7VIkEaRPScUFoVlNk5Ps+9dfahmh393kwpYMhiyrf 9Tu0Mc7Q42WjgWDrLVti7b0Zrt2MZNcD0v9Ym35hKJ3gm4hxYYaSC5YM4A3xg07FN0Bz DZ2b1Hnwri1OrkC2Yy4wIh7hWizVHK/rVv7p0MsmhT+UdYdlU8Z7ANM/1eoQO59F5BY1 lBEQ== 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=BfRxdb8eKY8MDPI9i3gxFPCVkG++59Jqk+mj8yGT3oo=; b=WVlU1Yno8asU62NIaVJ+k2U//OeO3V7ULBu2xkarFZi0kqWbHiVak/5YGD/4Q/l2uo 6KIzbLF0gJuL+MD7yAu3govtTmITLp+5WisVhpz2kMHUOywXKH0/fl12L7hxc1VTNKNj K9HFkvpPQRTpceG0faoDzVxOHnuDM0ZpezlpyoEW38WfyIDvRYX2ha5JcOdYdvZkP9cU FSh1Fpo9l+f4WFVmxkCE9m789la74ffBH0h0LXRhEbVJhBMp5hd7cmphabvFMat5OL3A km9AaoBD/1hfdMlxQBvNEmO1qVTWYQryVIlD7o2yf6hdDWQftlB+8bVAoklTjhuK7dFZ QX2g== X-Gm-Message-State: APjAAAWx1dZdo2zY25ahIyGQEBAqnxan2BuVQVJCnrruLNVYUucP8+FX VX7Juzk4jnCaQcA/A/pgWE+6yvT0654= X-Google-Smtp-Source: APXvYqxbWlCi1nQte7n2lgl+lEV+cViLmbkJWDAFH1TAB2Sx4dKZhSFdws2vYc15GRFqFEnRKU2+pQ== X-Received: by 2002:a05:6830:12d6:: with SMTP id a22mr14149030otq.236.1561156279952; Fri, 21 Jun 2019 15:31:19 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id h23sm1491394otr.61.2019.06.21.15.31.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:19 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 08/14] completion: bash: remove old compat wrappers Date: Fri, 21 Jun 2019 17:31:01 -0500 Message-Id: <20190621223107.8022-9-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's been seven years, probably more than enough time to move on. Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index dba822d0e7..1f9b833913 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -3073,18 +3073,6 @@ __git_complete () || complete -o default -o nospace -F $wrapper $1 } -# wrapper for backwards compatibility -_git () -{ - __git_wrap__git_main -} - -# wrapper for backwards compatibility -_gitk () -{ - __git_wrap__gitk_main -} - __git_complete git __git_main __git_complete gitk __gitk_main From patchwork Fri Jun 21 22:31:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010783 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 57C4D14B6 for ; Fri, 21 Jun 2019 22:31:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A40328B68 for ; Fri, 21 Jun 2019 22:31:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EB6C28BAA; Fri, 21 Jun 2019 22:31:26 +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 DBC7728B68 for ; Fri, 21 Jun 2019 22:31:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726188AbfFUWbZ (ORCPT ); Fri, 21 Jun 2019 18:31:25 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:39772 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbfFUWbW (ORCPT ); Fri, 21 Jun 2019 18:31:22 -0400 Received: by mail-oi1-f194.google.com with SMTP id m202so5757735oig.6 for ; Fri, 21 Jun 2019 15:31:22 -0700 (PDT) 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=RLbNim9Vif88HyHoqQEa9iwKKR6YgexW+MYrsUumBiA=; b=YTwisq0iPsbm48Me07mAwVgXtBCCA81i3uGDSxvYEpY5pkbwHGwAhMf+jf+PpVqBZj 2AQY4uDpxAlmWPHc9Aqqh1SK77OyaVZp15v0ZoPGc5m+ant6CyEWL82rFiS0VA0pI2kA vKS/6Nnv+XHnAYPserJJkaIxxe75jLvSx0KpNtFAN17QOpzHUpxh2hiLC3mDWlODg2Fg 59MB/T0xO4NnLpq9gO8rA0PB7JLNUIRHxkgJjqXJV21qvXF9HnAA5sEa1RQqLcugaSUd jFXkAD/bnA34qlUMrZzXX9qMOIN2hNW+9yoWWvecwsOCyEXn874Cl36v3uDdxFleI2cx iGDA== 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=RLbNim9Vif88HyHoqQEa9iwKKR6YgexW+MYrsUumBiA=; b=oiUGlW+KzI9SuIjBCAVCF24nr+DLq7mcDz/zqRvr5P4eFn75XVjrihuDFeCdOePil7 GcHhccjYS7dSZon7r08ukVicqau756QX8tQW/z1L4ndPiWkJXUNJsFfJjngzUFoRmoxM v9UU6+UN3mqy7zBmvJiAYJQ1FpsEpbL66pjAaXtOLWsxb5IE3zrVsD+fa4beafL8picp 5ls6AxOOVuvOLwDN0FvjaSt5vHa+gnSPzmD7p2sIS0ylNAUbtjwyCxKQuh2hLpfHdQOt OLf3gtpJ+//JhaSNlR4E48WrTa4X5lPrdKQURVcczj4RqmM4krEl7phTFzklJl9PBZCG Mt+Q== X-Gm-Message-State: APjAAAXR9zIc0HbqkwoRIjRMmGKVwBoLZ+gGiKNxgI23wGyzsCuT38Cg KnRCWI8w8ln3R4pkJi4NtQ/nE3hkYYg= X-Google-Smtp-Source: APXvYqyoLG8Xt4Qky064L1Rz12qi9CgsxAVpkuT1ZnwmrCLRtZBiRtNLe35zqyaLdHc2pQk4E754Zg== X-Received: by 2002:aca:40d5:: with SMTP id n204mr4018269oia.94.1561156281393; Fri, 21 Jun 2019 15:31:21 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id 103sm1381947otu.33.2019.06.21.15.31.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:20 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 09/14] completion: bash: remove zsh wrapper Date: Fri, 21 Jun 2019 17:31:02 -0500 Message-Id: <20190621223107.8022-10-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It has been deprecated for more than seven years. It's time to move on. Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 84 +------------------------- 1 file changed, 2 insertions(+), 82 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 1f9b833913..d3ee6c7dc2 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2969,88 +2969,8 @@ __gitk_main () __git_complete_revlist } -if [[ -n ${ZSH_VERSION-} ]] && - # Don't define these functions when sourced from 'git-completion.zsh', - # it has its own implementations. - [[ -z ${GIT_SOURCING_ZSH_COMPLETION-} ]]; then - echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2 - - autoload -U +X compinit && compinit - - __gitcomp () - { - emulate -L zsh - - local cur_="${3-$cur}" - - case "$cur_" in - --*=) - ;; - *) - local c IFS=$' \t\n' - local -a array - for c in ${=1}; do - c="$c${4-}" - case $c in - --*=*|*.) ;; - *) c="$c " ;; - esac - array[${#array[@]}+1]="$c" - done - compset -P '*[=:]' - compadd -Q -S '' -p "${2-}" -a -- array && _ret=0 - ;; - esac - } - - __gitcomp_direct () - { - emulate -L zsh - - local IFS=$'\n' - compset -P '*[=:]' - compadd -Q -- ${${=1}% } && _ret=0 - } - - __gitcomp_nl () - { - emulate -L zsh - - local IFS=$'\n' - compset -P '*[=:]' - compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 - } - - __gitcomp_file_direct () - { - emulate -L zsh - - local IFS=$'\n' - compset -P '*[=:]' - compadd -f -- ${=1} && _ret=0 - } - - __gitcomp_file () - { - emulate -L zsh - - local IFS=$'\n' - compset -P '*[=:]' - compadd -p "${2-}" -f -- ${=1} && _ret=0 - } - - _git () - { - local _ret=1 cur cword prev - cur=${words[CURRENT]} - prev=${words[CURRENT-1]} - let cword=CURRENT-1 - emulate ksh -c __${service}_main - let _ret && _default && _ret=0 - return _ret - } - - compdef _git git gitk +if [[ -n ${ZSH_VERSION-} && -z ${GIT_SOURCING_ZSH_COMPLETION-} ]]; then + echo "ERROR: this script is obsolete, please see git-completion.zsh" 1>&2 return fi From patchwork Fri Jun 21 22:31:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010787 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 0068717D2 for ; Fri, 21 Jun 2019 22:31:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E584928B68 for ; Fri, 21 Jun 2019 22:31:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D986028B7B; Fri, 21 Jun 2019 22:31:27 +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 8E55B28BAB for ; Fri, 21 Jun 2019 22:31:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726186AbfFUWbY (ORCPT ); Fri, 21 Jun 2019 18:31:24 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:40424 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbfFUWbX (ORCPT ); Fri, 21 Jun 2019 18:31:23 -0400 Received: by mail-oi1-f193.google.com with SMTP id w196so5745793oie.7 for ; Fri, 21 Jun 2019 15:31:23 -0700 (PDT) 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=c4/tnaqoDtrhT+IOwNd2ugdEAgGC3Jd7BSLiABXR2Jo=; b=F0n7WVXE+Lj9+NGYEHXDwEhzieiuygLHObBqmmH9nHj+xG1ZzWt1nv9K283A5SVVPH AFMoeewzBhuB7haXvbn07qOABLWz3o3EAEW1obffjaFNRCrdPB6Yhs0jgO/lQ17qo2em 6XbJDiJzX9qo7wcNtBLxCcsksAwBgaNz1HIpGcYMV08JMR/Gm9h1esdXdIToCOgQC0id bDDjmjf0qjdMHWxdU0b7vUSeZZ6aUATOH2XlhlHhCv5hINQPkSn0vNg4jKjUBTvn+cm4 egTmYlD3oumFbYkmrPDfjVv/7mCXAOWH0XKTijqbwn7pMBlArCAVOw5tv07JOhh5nVSX RAHA== 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=c4/tnaqoDtrhT+IOwNd2ugdEAgGC3Jd7BSLiABXR2Jo=; b=eTrSzu3WnQLF9KZFdE4gW36Fqwxd+F/p9FsJ7p2FhJqC2PM+RVUKQvB03Fjr2ZR7Em 83fl15VSb1gp3PKlk4s51k0nq6YNkXkkz+6iOzq8dGNUKxP4M1dFLWMKitiwVi/JI018 gCiBs/k5CLgidLtWo3KAvzLDgbuaHRzJZWFTa4R0uRWSJCNb8f+/cQiKK9F/yD2zezh2 ZfB58q7LgdMakFv+bHnkO58XPfKIf0FFF2OYSQfq22lTxOb+ta2LxNO8pOF0JYeAU7hk xx5Qh3jJdTiELm8RYEe4NctluscOnSC2iTmwWjO2s4e909X9r/p61BD1xPwd93fZ0gle FUMQ== X-Gm-Message-State: APjAAAVnVvGCjog108/JLevLhaId9UAbS/Lz4bB6KnUm84eNYcU1hW2P fKyqn9uEK0/s/ZyYkesm5Q4EloRcM94= X-Google-Smtp-Source: APXvYqxxaNxWLauX0wtTx37ZEa3yFqZJo6fLvqRX8t3kwVyS7xTvxLy7zTHX+649AynSzwHNR7e+aA== X-Received: by 2002:aca:ad54:: with SMTP id w81mr4520045oie.86.1561156282594; Fri, 21 Jun 2019 15:31:22 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id 40sm321453oty.81.2019.06.21.15.31.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:22 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 10/14] completion: zsh: trivial cleanups Date: Fri, 21 Jun 2019 17:31:03 -0500 Message-Id: <20190621223107.8022-11-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need to override IFS, zsh has a native way of splitting by new lines: the expansion flag (f). Also, we don't need to split files by ':' or '='; that's only for words. Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.zsh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index 7f614d5854..317f5bd80a 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -68,44 +68,38 @@ __gitcomp_direct () { emulate -L zsh - local IFS=$'\n' compset -P '*[=:]' - compadd -Q -- ${${=1}% } && _ret=0 + compadd -Q -- ${${(f)1}% } && _ret=0 } __gitcomp_nl () { emulate -L zsh - local IFS=$'\n' compset -P '*[=:]' - compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 + compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0 } __gitcomp_nl_append () { emulate -L zsh - local IFS=$'\n' - compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 + compset -P '*[=:]' + compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0 } __gitcomp_file_direct () { emulate -L zsh - local IFS=$'\n' - compset -P '*[=:]' - compadd -f -- ${=1} && _ret=0 + compadd -f -- ${(f)1} && _ret=0 } __gitcomp_file () { emulate -L zsh - local IFS=$'\n' - compset -P '*[=:]' - compadd -p "${2-}" -f -- ${=1} && _ret=0 + compadd -f -p "${2-}" -- ${(f)1} && _ret=0 } __git_zsh_bash_func () From patchwork Fri Jun 21 22:31:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010785 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 8E13A14BB for ; Fri, 21 Jun 2019 22:31:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 807B928B68 for ; Fri, 21 Jun 2019 22:31:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7206028BAA; Fri, 21 Jun 2019 22:31:27 +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 E863728B68 for ; Fri, 21 Jun 2019 22:31:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726184AbfFUWb0 (ORCPT ); Fri, 21 Jun 2019 18:31:26 -0400 Received: from mail-ot1-f54.google.com ([209.85.210.54]:40497 "EHLO mail-ot1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbfFUWbZ (ORCPT ); Fri, 21 Jun 2019 18:31:25 -0400 Received: by mail-ot1-f54.google.com with SMTP id e8so7785314otl.7 for ; Fri, 21 Jun 2019 15:31:24 -0700 (PDT) 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=aKalh0R30bhY5rv8TQWRYTrESz8oPgX0L/SF7NjDi18=; b=ZSalskKZBT5RKfFFnAXBGo0BsyKvkI/m11aXbweR5NIz6LHMcia4qKMikF03Joyi53 NCxwPG93D6Rf/5zmQXpU4mS0WzpX5DlDwgf7OLTg8yW6Nziq6edZI0hbnVFapLfsFoEZ IGcTcyTkHvXCxPBbQhW6ug13AexqwsPmIClHlvhTy6c8gbUawCYVGUwJX2LLrRlWrlSv a9e2aQbGNnrwCzQPfh7FGhU+j2a+yBu37wdTP13q4sjetvsRw+CtbW+87HTS+99meyJx rXVBjXzRNpIhd4xmC4DZKuuhnvr5oMXqNnfjZk10gI6ZyOA8tbCm29YDso9Ht0hysArU 3ulA== 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=aKalh0R30bhY5rv8TQWRYTrESz8oPgX0L/SF7NjDi18=; b=OanjYypsQZ4j5aRQreKD4h+ZzEoHqe3sKKprAizVZpFWqYLTNDV7Eh7MGMC9MlbGU0 aAFoqH4ECLFfQYXVcIhNBNj5iC6Pf7uCc8I9qyGEjPtFDwT6DA1gsYgZt8q2lgxV0tGK AP9KgFRDu16e5ZWY7s0GAKS8n7F0i+K8vJtgkRt0ixi5d7chhsgvwMQa5wAr8HOuJ6y1 l+Bv2DRjmifyHWYnhG3REzdWCyTBF8pDLPbgR/cF2qKwdzN6tDgoF1nwEzvSpWnnvvsi lQ4JQfjrgkDBCFgR81ac5yQRq5eO31FDgMSma45rsgZSVQymobJvwHwYcPiAxQ4S/x7H TqMA== X-Gm-Message-State: APjAAAVvwE331xuOQE1OABpUv3LPXva/pZrOcgIMmmF3QJesy592lGTD iOpppdgBKVgB2oPaYcA9X/KK4qsuujE= X-Google-Smtp-Source: APXvYqyqFX2kfcYDq2RuKdEj/SQgg/qrCXSF/UleJy695PvFPL+zBhxBEaDvRb/yLgy0dayGX08D9A== X-Received: by 2002:a9d:4599:: with SMTP id x25mr38219553ote.219.1561156283774; Fri, 21 Jun 2019 15:31:23 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id n32sm1443248ota.7.2019.06.21.15.31.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:23 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 11/14] test: completion: tests for __gitcomp regression Date: Fri, 21 Jun 2019 17:31:04 -0500 Message-Id: <20190621223107.8022-12-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There's a regression in the completion since the introduction of __gitcomp. Go to any directory that doesn't contain a git repository, like /tmp. Then type the following: git checkout -- You will see nothing. That's because `git checkout --git-completion-helper` fails when you run it outside a git repository. You might change to a directory that has a git repository, but it's too late, because the empty options have been cached. It's unclear how many commands are affected, but this patch attempts to at least detect some already in the testing framework. Signed-off-by: Felipe Contreras --- t/t9902-completion.sh | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 43cf313a1c..7bef41eaf5 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -122,6 +122,15 @@ test_gitcomp_nl () test_cmp expected out } +offgit () +{ + GIT_CEILING_DIRECTORIES="$ROOT" && + export GIT_CEILING_DIRECTORIES && + test_when_finished "ROOT='$ROOT'; cd '$TRASH_DIRECTORY'; unset GIT_CEILING_DIRECTORIES" && + ROOT="$ROOT"/non-repo && + cd "$ROOT" +} + invalid_variable_name='${foo.bar}' actual="$TRASH_DIRECTORY/actual" @@ -358,10 +367,8 @@ test_expect_success SYMLINKS '__git_find_repo_path - resulting path avoids symli ' test_expect_success '__git_find_repo_path - not a git repository' ' + offgit && ( - cd non-repo && - GIT_CEILING_DIRECTORIES="$ROOT" && - export GIT_CEILING_DIRECTORIES && test_must_fail __git_find_repo_path && printf "$__git_repo_path" >"$actual" ) && @@ -1388,6 +1395,7 @@ test_expect_success '__git_pretty_aliases' ' ' test_expect_success 'basic' ' + offgit && run_completion "git " && # built-in grep -q "^add \$" out && @@ -1401,6 +1409,7 @@ test_expect_success 'basic' ' ' test_expect_success 'double dash "git" itself' ' + offgit && test_completion "git --" <<-\EOF --paginate Z --no-pager Z @@ -1419,7 +1428,8 @@ test_expect_success 'double dash "git" itself' ' EOF ' -test_expect_success 'double dash "git checkout"' ' +test_expect_failure 'double dash "git checkout"' ' + offgit && test_completion "git checkout --" <<-\EOF --quiet Z --detach Z @@ -1442,6 +1452,7 @@ test_expect_success 'double dash "git checkout"' ' ' test_expect_success 'general options' ' + offgit && test_completion "git --ver" "--version " && test_completion "git --hel" "--help " && test_completion "git --exe" <<-\EOF && @@ -1460,6 +1471,7 @@ test_expect_success 'general options' ' ' test_expect_success 'general options plus command' ' + offgit && test_completion "git --version check" "checkout " && test_completion "git --paginate check" "checkout " && test_completion "git --git-dir=foo check" "checkout " && @@ -1480,11 +1492,13 @@ test_expect_success 'general options plus command' ' ' test_expect_success 'git --help completion' ' + offgit && test_completion "git --help ad" "add " && test_completion "git --help core" "core-tutorial " ' -test_expect_success 'completion.commands removes multiple commands' ' +test_expect_failure 'completion.commands removes multiple commands' ' + offgit && test_config completion.commands "-cherry -mergetool" && git --list-cmds=list-mainporcelain,list-complete,config >out && ! grep -E "^(cherry|mergetool)$" out @@ -1547,9 +1561,10 @@ test_expect_success 'complete tree filename with metacharacters' ' EOF ' -test_expect_success PERL 'send-email' ' - test_completion "git send-email --cov" "--cover-letter " && - test_completion "git send-email ma" "master " +test_expect_failure PERL 'send-email' ' + test_completion "git send-email ma" "master " && + offgit && + test_completion "git send-email --cov" "--cover-letter " ' test_expect_success 'complete files' ' @@ -1649,6 +1664,7 @@ test_expect_success 'completion used completion for alias: !f() { : git X-Patchwork-Id: 11010789 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 0E57614B6 for ; Fri, 21 Jun 2019 22:31:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00C0D28B68 for ; Fri, 21 Jun 2019 22:31:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E968C28BAA; Fri, 21 Jun 2019 22:31: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 E7DDA28B68 for ; Fri, 21 Jun 2019 22:31:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726196AbfFUWb1 (ORCPT ); Fri, 21 Jun 2019 18:31:27 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:42985 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbfFUWb0 (ORCPT ); Fri, 21 Jun 2019 18:31:26 -0400 Received: by mail-ot1-f65.google.com with SMTP id l15so7779542otn.9 for ; Fri, 21 Jun 2019 15:31:25 -0700 (PDT) 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=l6RBg0DD4sqgVlOHsY9wfoAFRK6crKRic2ax0/1zoGA=; b=r143sdHE/eB3Ra6jIubxWSTsk6xtZbwEK1RmLa2x46jri337lfRmtDbJ4nRrWK+LUB yJv0V3Vgw/MobSjuv69imcqqwO6H0FrBPtiVzT6I86/ZPg40ZiCza5QQNJfYziQbmB2U g81t0i+WYFuWqhORxrOp6fl2DT284bXAiA20bYtIn8IOYtlkOscQICO/DYR9t1MaL0S4 33Z5fHV8xQdE1VFu73nNAOBC6lhunBI8PmmjLrubm/HKSce3LVoFU/KbM+akXpV2ThV9 Lov6Ox6/N4YkkgUm2IuJk2xQOL63854H4U54i5DCZMufFiU6LbZFR3MVEjae2IX3umcI NJIg== 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=l6RBg0DD4sqgVlOHsY9wfoAFRK6crKRic2ax0/1zoGA=; b=Mu4yMwCnlIL0uQPquRdBexKlOkf8Dden7LywRlgQfE6SNPkjHFIwhTNOhrs6EZnAMC Z47pmBF5fTPpCRoXPaop50FL+AJq6MtFblyWaZ3vUfov1zuqNQKnejw96oVtSpDo0j6J N8FI7vW3tXufYpE5VGhLa8zfFy+CG40NXUDlneZYrcVRZ/VKD3Nsd1duUwYerOaPxvtk rtJTgwCwyYkjQUP4Z2tZrD/8UmmQAGNm0+ETuUDArHXjdzyVRuITB47q1tsNop576tbc pRiFjUxaSuBvGU1uRBNCbjmRghUTglh2korf45lAsHNF9WQVfJH4/KgqSsXIZH4EysvJ s5sQ== X-Gm-Message-State: APjAAAUnEsaAsbhaqcIz419c5XIWv51BUWuWRLZFRLxhntxfwZlplyS9 p3AKgMPF2R6F2fDP6ldPP+MWcx3e2os= X-Google-Smtp-Source: APXvYqwf3WEU+YOvE4VidmXgruVVnLneCrrYY85iFg7ZhgJ+CtOwzxlFb4FtZ82qRmem6NAgjcLsGQ== X-Received: by 2002:a9d:620e:: with SMTP id g14mr13834777otj.317.1561156285043; Fri, 21 Jun 2019 15:31:25 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id w123sm1644318oiw.38.2019.06.21.15.31.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:24 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 12/14] test: completion: use global config Date: Fri, 21 Jun 2019 17:31:05 -0500 Message-Id: <20190621223107.8022-13-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When appropriate. Signed-off-by: Felipe Contreras --- t/t9902-completion.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 7bef41eaf5..3dbfef6960 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -1497,9 +1497,9 @@ test_expect_success 'git --help completion' ' test_completion "git --help core" "core-tutorial " ' -test_expect_failure 'completion.commands removes multiple commands' ' +test_expect_success 'completion.commands removes multiple commands' ' offgit && - test_config completion.commands "-cherry -mergetool" && + test_config_global completion.commands "-cherry -mergetool" && git --list-cmds=list-mainporcelain,list-complete,config >out && ! grep -E "^(cherry|mergetool)$" out ' @@ -1637,7 +1637,7 @@ test_expect_success 'complete files' ' ' test_expect_success "completion uses completion for alias: !sh -c 'git ...'" ' - test_config alias.co "!sh -c '"'"'git checkout ...'"'"'" && + test_config_global alias.co "!sh -c '"'"'git checkout ...'"'"'" && test_completion "git co m" <<-\EOF master Z mybranch Z @@ -1646,7 +1646,7 @@ test_expect_success "completion uses completion for alias: !sh -c 'git completion for alias: !f () { VAR=val git ... }' ' - test_config alias.co "!f () { VAR=val git checkout ... ; } f" && + test_config_global alias.co "!f () { VAR=val git checkout ... ; } f" && test_completion "git co m" <<-\EOF master Z mybranch Z @@ -1655,7 +1655,7 @@ test_expect_success 'completion uses completion for alias: !f () { VAR=val ' test_expect_success 'completion used completion for alias: !f() { : git ; ... }' ' - test_config alias.co "!f() { : git checkout ; if ... } f" && + test_config_global alias.co "!f() { : git checkout ; if ... } f" && test_completion "git co m" <<-\EOF master Z mybranch Z From patchwork Fri Jun 21 22:31:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010793 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 3FE9317D2 for ; Fri, 21 Jun 2019 22:31:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FDA428B68 for ; Fri, 21 Jun 2019 22:31:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 243A028BAA; Fri, 21 Jun 2019 22:31:32 +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 14AD428B68 for ; Fri, 21 Jun 2019 22:31:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726031AbfFUWb3 (ORCPT ); Fri, 21 Jun 2019 18:31:29 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:33422 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbfFUWb1 (ORCPT ); Fri, 21 Jun 2019 18:31:27 -0400 Received: by mail-ot1-f66.google.com with SMTP id i4so7920210otk.0 for ; Fri, 21 Jun 2019 15:31:27 -0700 (PDT) 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=QL0lveZTYgI6Ayo+iu4zJofXLHoHNFlFiRiHoJy0bL0=; b=M85AAz14miQFnT7ILTPx93FQGMTxlqu0tKBhd1w0K+zzHvTobtWj6lX5dGxJGcHMSX TfAI9fNKDzJwwVIGuyuOM27BAnS6ecgOIO6v90V1Uf2bETXE2r9OS7nkH3SXdC4vJoRt CN4087mbRGjAskHz5qFYurrYVdwAHKJ4Nj4YhEluLwfXd9DTr/g1GqJqYSQU121hVHiJ ECnkuC2j+ssktFpoXG7lYdImRo8L0VaNTZcfveSrAgLgitnBR36JLm3zRQnj7ZhJWN33 CpNqzTU+CW3TdeE+MpsJgIMiohyTpaB70WsSLMInup8LQYQCwVJJ8WFAhoRBPfma/d9h 9rLg== 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=QL0lveZTYgI6Ayo+iu4zJofXLHoHNFlFiRiHoJy0bL0=; b=RPML1kj5HeDp6qMxFqqQO7y9qQKgwap6HmcfuMsro7ZmkRSEbgOcbIeJBkv9Kh3UID /LugnuxVkFy30npu3QMkdvRk/QcYWz4kFFBU1qQ7npeX/l86gEzeuAKAe9MANI7OcaXc hikgNISyQhr/6zYKwviyE4i6zDv88IPr/flEWTF2VXJpa95hJ/RPPGJz7FOGgCtJYa4t 0+toajgZt8IZrqlZvmg7abupjwX1VhYtU4pnuUY99hklapFrcQoio9l57MaCxtqgQw7s bRoPdS9alKS58uBeDvEoiT4wqdCDCRuvmn5V22JUeGVp9u1GJPtnv9flOxXv5fI9KzTI D/lw== X-Gm-Message-State: APjAAAX6oaxpfPBA9HpoKo1VC4BHdE9zkUUhBVTF/1wZ3z254l12uXUI a8AsP78zdu8kRcKv01+9BypTBahB7oY= X-Google-Smtp-Source: APXvYqyxAE36dl46P1wEp5em5v1J7gSGLlzG6Yvl7HTnfV2sA00lw4pXDZYoX4Gg5EjFGFV6qGspHA== X-Received: by 2002:a9d:3b84:: with SMTP id k4mr70693663otc.27.1561156286298; Fri, 21 Jun 2019 15:31:26 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id t11sm1440454otq.13.2019.06.21.15.31.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:25 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 13/14] completion: add default options Date: Fri, 21 Jun 2019 17:31:06 -0500 Message-Id: <20190621223107.8022-14-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Versions of Git older than v2.17 don't know about --git-completion-helper, so provide some defaults for them. Also, some commands fail if there's no Git repository available. Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 97 +++++++++++++++++++++++++- t/t9902-completion.sh | 4 +- 2 files changed, 98 insertions(+), 3 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index d3ee6c7dc2..922ba5f925 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -377,6 +377,100 @@ else unset $(compgen -v __gitcomp_builtin_) fi +__gitcomp_builtin_add_default=" --dry-run --verbose --interactive --patch --edit --force --update --renormalize --intent-to-add --all --ignore-removal --refresh --ignore-errors --ignore-missing --chmod= --no-dry-run -- --no-verbose --no-interactive --no-patch --no-edit --no-force --no-update --no-renormalize --no-intent-to-add --no-all --no-ignore-removal --no-refresh --no-ignore-errors --no-ignore-missing --no-chmod" +__gitcomp_builtin_am_default=" --interactive --3way --quiet --signoff --utf8 --keep --keep-non-patch --message-id --keep-cr --no-keep-cr --scissors --whitespace= --ignore-space-change --ignore-whitespace --directory= --exclude= --include= --patch-format= --reject --resolvemsg= --continue --resolved --skip --abort --quit --show-current-patch --committer-date-is-author-date --ignore-date --rerere-autoupdate --gpg-sign -- --no-interactive --no-3way --no-quiet --no-signoff --no-utf8 --no-keep --no-keep-non-patch --no-message-id --no-scissors --no-whitespace --no-ignore-space-change --no-ignore-whitespace --no-directory --no-exclude --no-include --no-patch-format --no-reject --no-resolvemsg --no-committer-date-is-author-date --no-ignore-date --no-rerere-autoupdate --no-gpg-sign" +__gitcomp_builtin_apply_default=" --exclude= --include= --no-add --stat --numstat --summary --check --index --intent-to-add --cached --apply --3way --build-fake-ancestor= --whitespace= --ignore-space-change --ignore-whitespace --reverse --unidiff-zero --reject --allow-overlap --verbose --inaccurate-eof --recount --directory= --add -- --no-stat --no-numstat --no-summary --no-check --no-index --no-intent-to-add --no-cached --no-apply --no-3way --no-build-fake-ancestor --no-whitespace --no-ignore-space-change --no-ignore-whitespace --no-reverse --no-unidiff-zero --no-reject --no-allow-overlap --no-verbose --no-inaccurate-eof --no-recount --no-directory" +__gitcomp_builtin_archive_default=" --output= --remote= --exec= --no-output -- --no-remote --no-exec" +__gitcomp_builtin_bisect__helper_default=" --next-all --write-terms --bisect-clean-state --check-expected-revs --bisect-reset --bisect-write --check-and-set-terms --bisect-next-check --bisect-terms --bisect-start --no-checkout --no-log --checkout --log" +__gitcomp_builtin_blame_default=" --incremental --root --show-stats --progress --score-debug --show-name --show-number --porcelain --line-porcelain --show-email --color-lines --color-by-age --indent-heuristic --minimal --contents= --abbrev --no-incremental -- --no-root --no-show-stats --no-progress --no-score-debug --no-show-name --no-show-number --no-porcelain --no-line-porcelain --no-show-email --no-color-lines --no-color-by-age --no-minimal --no-contents --no-abbrev" +__gitcomp_builtin_branch_default=" --verbose --quiet --track --set-upstream-to= --unset-upstream --color --remotes --contains --no-contains --abbrev --all --delete --move --copy --list --show-current --create-reflog --edit-description --merged --no-merged --column --sort= --points-at= --ignore-case --format= -- --no-verbose --no-quiet --no-track --no-set-upstream-to --no-unset-upstream --no-color --no-remotes --no-abbrev --no-all --no-delete --no-move --no-copy --no-list --no-show-current --no-create-reflog --no-edit-description --no-column --no-points-at --no-ignore-case --no-format" +__gitcomp_builtin_cat_file_default=" --textconv --filters --path= --allow-unknown-type --buffer --batch --batch-check --follow-symlinks --batch-all-objects --unordered --no-path -- --no-allow-unknown-type --no-buffer --no-follow-symlinks --no-batch-all-objects --no-unordered" +__gitcomp_builtin_check_attr_default=" --all --cached --stdin --no-all -- --no-cached --no-stdin" +__gitcomp_builtin_check_ignore_default=" --quiet --verbose --stdin --non-matching --no-index --index -- --no-quiet --no-verbose --no-stdin --no-non-matching" +__gitcomp_builtin_check_mailmap_default=" --stdin --no-stdin" +__gitcomp_builtin_checkout_default=" --quiet --detach --track --orphan= --ours --theirs --merge --conflict= --patch --ignore-skip-worktree-bits --no-guess --ignore-other-worktrees --recurse-submodules --progress --overlay --guess -- --no-quiet --no-detach --no-track --no-orphan --no-merge --no-conflict --no-patch --no-ignore-skip-worktree-bits --no-ignore-other-worktrees --no-recurse-submodules --no-progress --no-overlay" +__gitcomp_builtin_checkout_index_default=" --all --force --quiet --no-create --index --stdin --temp --prefix= --stage= --create -- --no-all --no-force --no-quiet --no-index --no-stdin --no-temp --no-prefix" +__gitcomp_builtin_cherry_default=" --abbrev --verbose --no-abbrev -- --no-verbose" +__gitcomp_builtin_cherry_pick_default=" --quit --continue --abort --cleanup= --no-commit --edit --signoff --mainline= --rerere-autoupdate --strategy= --strategy-option= --gpg-sign --ff --allow-empty --allow-empty-message --keep-redundant-commits --commit -- --no-cleanup --no-edit --no-signoff --no-mainline --no-rerere-autoupdate --no-strategy --no-strategy-option --no-gpg-sign --no-ff --no-allow-empty --no-allow-empty-message --no-keep-redundant-commits" +__gitcomp_builtin_clean_default=" --quiet --dry-run --interactive --exclude= --no-quiet -- --no-dry-run --no-interactive" +__gitcomp_builtin_clone_default=" --verbose --quiet --progress --no-checkout --bare --mirror --local --no-hardlinks --shared --recursive --recurse-submodules --jobs= --template= --reference= --reference-if-able= --dissociate --origin= --branch= --upload-pack= --depth= --shallow-since= --shallow-exclude= --single-branch --no-tags --shallow-submodules --separate-git-dir= --config= --server-option= --ipv4 --ipv6 --filter= --checkout --hardlinks --tags -- --no-verbose --no-quiet --no-progress --no-bare --no-mirror --no-local --no-shared --no-recursive --no-recurse-submodules --no-jobs --no-template --no-reference --no-reference-if-able --no-dissociate --no-origin --no-branch --no-upload-pack --no-depth --no-shallow-since --no-shallow-exclude --no-single-branch --no-shallow-submodules --no-separate-git-dir --no-config --no-server-option --no-ipv4 --no-ipv6 --no-filter" +__gitcomp_builtin_column_default=" --command= --mode --raw-mode= --width= --indent= --nl= --padding= --no-command -- --no-mode --no-raw-mode --no-width --no-indent --no-nl --no-padding" +__gitcomp_builtin_commit_default=" --quiet --verbose --file= --author= --date= --message= --reedit-message= --reuse-message= --fixup= --squash= --reset-author --signoff --template= --edit --cleanup= --status --gpg-sign --all --include --interactive --patch --only --no-verify --dry-run --short --branch --ahead-behind --porcelain --long --null --amend --no-post-rewrite --untracked-files --verify --post-rewrite -- --no-quiet --no-verbose --no-file --no-author --no-date --no-message --no-reedit-message --no-reuse-message --no-fixup --no-squash --no-reset-author --no-signoff --no-template --no-edit --no-cleanup --no-status --no-gpg-sign --no-all --no-include --no-interactive --no-patch --no-only --no-dry-run --no-short --no-branch --no-ahead-behind --no-porcelain --no-long --no-null --no-amend --no-untracked-files" +__gitcomp_builtin_commit_graph_default=" --object-dir= --no-object-dir" +__gitcomp_builtin_config_default=" --global --system --local --worktree --file= --blob= --get --get-all --get-regexp --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section --list --edit --get-color --get-colorbool --type= --bool --int --bool-or-int --path --expiry-date --null --name-only --includes --show-origin --default= --no-global -- --no-system --no-local --no-worktree --no-file --no-blob --no-get --no-get-all --no-get-regexp --no-get-urlmatch --no-replace-all --no-add --no-unset --no-unset-all --no-rename-section --no-remove-section --no-list --no-edit --no-get-color --no-get-colorbool --no-type --no-null --no-name-only --no-includes --no-show-origin --no-default" +__gitcomp_builtin_count_objects_default=" --verbose --human-readable --no-verbose -- --no-human-readable" +__gitcomp_builtin_describe_default=" --contains --debug --all --tags --long --first-parent --abbrev --exact-match --candidates= --match= --exclude= --always --dirty --broken --no-contains -- --no-debug --no-all --no-tags --no-long --no-first-parent --no-abbrev --no-exact-match --no-candidates --no-match --no-exclude --no-always --no-dirty --no-broken" +__gitcomp_builtin_difftool_default=" --gui --dir-diff --no-prompt --symlinks --tool= --tool-help --trust-exit-code --extcmd= --no-index -- --no-gui --no-dir-diff --no-symlinks --no-tool --no-tool-help --no-trust-exit-code --no-extcmd" +__gitcomp_builtin_fast_export_default=" --progress= --signed-tags= --tag-of-filtered-object= --export-marks= --import-marks= --fake-missing-tagger --full-tree --use-done-feature --no-data --refspec= --anonymize --reference-excluded-parents --show-original-ids --data -- --no-progress --no-signed-tags --no-tag-of-filtered-object --no-export-marks --no-import-marks --no-fake-missing-tagger --no-full-tree --no-use-done-feature --no-refspec --no-anonymize --no-reference-excluded-parents --no-show-original-ids" +__gitcomp_builtin_fetch_default=" --verbose --quiet --all --append --upload-pack= --force --multiple --tags --jobs= --prune --prune-tags --recurse-submodules --dry-run --keep --update-head-ok --progress --depth= --shallow-since= --shallow-exclude= --deepen= --unshallow --update-shallow --refmap= --server-option= --ipv4 --ipv6 --negotiation-tip= --filter= --no-verbose -- --no-quiet --no-all --no-append --no-upload-pack --no-force --no-multiple --no-tags --no-jobs --no-prune --no-prune-tags --no-recurse-submodules --no-dry-run --no-keep --no-update-head-ok --no-progress --no-depth --no-shallow-since --no-shallow-exclude --no-deepen --no-update-shallow --no-server-option --no-ipv4 --no-ipv6 --no-negotiation-tip --no-filter" +__gitcomp_builtin_fmt_merge_msg_default=" --log --message= --file= --no-log -- --no-message --no-file" +__gitcomp_builtin_for_each_ref_default=" --shell --perl --python --tcl --count= --format= --color --sort= --points-at= --merged --no-merged --contains --no-contains --ignore-case -- --no-shell --no-perl --no-python --no-tcl --no-count --no-format --no-color --no-points-at --no-ignore-case" +__gitcomp_builtin_format_patch_default=" --numbered --no-numbered --signoff --stdout --cover-letter --numbered-files --suffix= --start-number= --reroll-count= --rfc --subject-prefix= --output-directory= --keep-subject --no-binary --zero-commit --ignore-if-in-upstream --no-stat --add-header= --to= --cc= --from --in-reply-to= --attach --inline --thread --signature= --base= --signature-file= --quiet --progress --interdiff= --range-diff= --creation-factor= --binary -- --no-numbered --no-signoff --no-stdout --no-cover-letter --no-numbered-files --no-suffix --no-start-number --no-reroll-count --no-zero-commit --no-ignore-if-in-upstream --no-add-header --no-to --no-cc --no-from --no-in-reply-to --no-attach --no-thread --no-signature --no-base --no-signature-file --no-quiet --no-progress --no-interdiff --no-range-diff --no-creation-factor" +__gitcomp_builtin_fsck_default=" --verbose --unreachable --dangling --tags --root --cache --reflogs --full --connectivity-only --strict --lost-found --progress --name-objects --no-verbose -- --no-unreachable --no-dangling --no-tags --no-root --no-cache --no-reflogs --no-full --no-connectivity-only --no-strict --no-lost-found --no-progress --no-name-objects" +__gitcomp_builtin_fsck_objects_default=" --verbose --unreachable --dangling --tags --root --cache --reflogs --full --connectivity-only --strict --lost-found --progress --name-objects --no-verbose -- --no-unreachable --no-dangling --no-tags --no-root --no-cache --no-reflogs --no-full --no-connectivity-only --no-strict --no-lost-found --no-progress --no-name-objects" +__gitcomp_builtin_gc_default=" --quiet --prune --aggressive --keep-largest-pack --no-quiet -- --no-prune --no-aggressive --no-keep-largest-pack" +__gitcomp_builtin_grep_default=" --cached --no-index --untracked --exclude-standard --recurse-submodules --invert-match --ignore-case --word-regexp --text --textconv --recursive --max-depth= --extended-regexp --basic-regexp --fixed-strings --perl-regexp --line-number --column --full-name --files-with-matches --name-only --files-without-match --only-matching --count --color --break --heading --context= --before-context= --after-context= --threads= --show-function --function-context --and --or --not --quiet --all-match --index -- --no-cached --no-untracked --no-exclude-standard --no-recurse-submodules --no-invert-match --no-ignore-case --no-word-regexp --no-text --no-textconv --no-recursive --no-extended-regexp --no-basic-regexp --no-fixed-strings --no-perl-regexp --no-line-number --no-column --no-full-name --no-files-with-matches --no-name-only --no-files-without-match --no-only-matching --no-count --no-color --no-break --no-heading --no-context --no-before-context --no-after-context --no-threads --no-show-function --no-function-context --no-or --no-quiet --no-all-match" +__gitcomp_builtin_hash_object_default=" --stdin --stdin-paths --no-filters --literally --path= --filters -- --no-stdin --no-stdin-paths --no-literally --no-path" +__gitcomp_builtin_help_default=" --all --guides --config --man --web --info --verbose --no-all -- --no-guides --no-config --no-man --no-web --no-info --no-verbose" +__gitcomp_builtin_init_default=" --template= --bare --shared --quiet --separate-git-dir= --no-template -- --no-bare --no-quiet --no-separate-git-dir" +__gitcomp_builtin_init_db_default=" --template= --bare --shared --quiet --separate-git-dir= --no-template -- --no-bare --no-quiet --no-separate-git-dir" +__gitcomp_builtin_interpret_trailers_default=" --in-place --trim-empty --where= --if-exists= --if-missing= --only-trailers --only-input --unfold --parse --no-divider --trailer= --divider -- --no-in-place --no-trim-empty --no-where --no-if-exists --no-if-missing --no-only-trailers --no-only-input --no-unfold --no-trailer" +__gitcomp_builtin_log_default=" --quiet --source --use-mailmap --decorate-refs= --decorate-refs-exclude= --decorate --no-quiet -- --no-source --no-use-mailmap --no-decorate-refs --no-decorate-refs-exclude --no-decorate" +__gitcomp_builtin_ls_files_default=" --cached --deleted --modified --others --ignored --stage --killed --directory --eol --empty-directory --unmerged --resolve-undo --exclude= --exclude-from= --exclude-per-directory= --exclude-standard --full-name --recurse-submodules --error-unmatch --with-tree= --abbrev --debug --no-cached -- --no-deleted --no-modified --no-others --no-ignored --no-stage --no-killed --no-directory --no-eol --no-empty-directory --no-unmerged --no-resolve-undo --no-exclude-per-directory --no-recurse-submodules --no-error-unmatch --no-with-tree --no-abbrev --no-debug" +__gitcomp_builtin_ls_remote_default=" --quiet --upload-pack= --tags --heads --refs --get-url --sort= --symref --server-option= --no-quiet -- --no-upload-pack --no-tags --no-heads --no-refs --no-get-url --no-symref --no-server-option" +__gitcomp_builtin_ls_tree_default=" --long --name-only --name-status --full-name --full-tree --abbrev --no-long -- --no-name-only --no-name-status --no-full-name --no-full-tree --no-abbrev" +__gitcomp_builtin_merge_default=" --stat --summary --log --squash --commit --edit --cleanup= --ff --ff-only --rerere-autoupdate --verify-signatures --strategy= --strategy-option= --message= --file --verbose --quiet --abort --continue --allow-unrelated-histories --progress --gpg-sign --overwrite-ignore --signoff --verify --no-stat -- --no-summary --no-log --no-squash --no-commit --no-edit --no-cleanup --no-ff --no-rerere-autoupdate --no-verify-signatures --no-strategy --no-strategy-option --no-message --no-verbose --no-quiet --no-abort --no-continue --no-allow-unrelated-histories --no-progress --no-gpg-sign --no-overwrite-ignore --no-signoff --no-verify" +__gitcomp_builtin_merge_base_default=" --all --octopus --independent --is-ancestor --fork-point --no-all" +__gitcomp_builtin_merge_file_default=" --stdout --diff3 --ours --theirs --union --marker-size= --quiet --no-stdout -- --no-diff3 --no-ours --no-theirs --no-union --no-marker-size --no-quiet" +__gitcomp_builtin_mktree_default=" --missing --batch --no-missing -- --no-batch" +__gitcomp_builtin_multi_pack_index_default=" --object-dir= --no-object-dir" +__gitcomp_builtin_mv_default=" --verbose --dry-run --no-verbose -- --no-dry-run" +__gitcomp_builtin_name_rev_default=" --name-only --tags --refs= --exclude= --all --stdin --undefined --always --no-name-only -- --no-tags --no-refs --no-exclude --no-all --no-stdin --no-undefined --no-always" +__gitcomp_builtin_notes_default=" --ref= --no-ref" +__gitcomp_builtin_pack_objects_default=" --quiet --progress --all-progress --all-progress-implied --index-version= --max-pack-size= --local --incremental --window= --window-memory= --depth= --reuse-delta --reuse-object --delta-base-offset --threads= --non-empty --revs --unpacked --all --reflog --indexed-objects --stdout --include-tag --keep-unreachable --pack-loose-unreachable --unpack-unreachable --sparse --thin --shallow --honor-pack-keep --keep-pack= --compression= --keep-true-parents --use-bitmap-index --write-bitmap-index --filter= --missing= --exclude-promisor-objects --delta-islands --no-quiet -- --no-progress --no-all-progress --no-all-progress-implied --no-local --no-incremental --no-window --no-depth --no-reuse-delta --no-reuse-object --no-delta-base-offset --no-threads --no-non-empty --no-revs --no-stdout --no-include-tag --no-keep-unreachable --no-pack-loose-unreachable --no-unpack-unreachable --no-sparse --no-thin --no-shallow --no-honor-pack-keep --no-keep-pack --no-compression --no-keep-true-parents --no-use-bitmap-index --no-write-bitmap-index --no-filter --no-exclude-promisor-objects --no-delta-islands" +__gitcomp_builtin_pack_refs_default=" --all --prune --no-all -- --no-prune" +__gitcomp_builtin_pickaxe_default=" --incremental --root --show-stats --progress --score-debug --show-name --show-number --porcelain --line-porcelain --show-email --color-lines --color-by-age --indent-heuristic --minimal --contents= --abbrev --no-incremental -- --no-root --no-show-stats --no-progress --no-score-debug --no-show-name --no-show-number --no-porcelain --no-line-porcelain --no-show-email --no-color-lines --no-color-by-age --no-minimal --no-contents --no-abbrev" +__gitcomp_builtin_prune_default=" --dry-run --verbose --progress --expire= --exclude-promisor-objects --no-dry-run -- --no-verbose --no-progress --no-expire --no-exclude-promisor-objects" +__gitcomp_builtin_prune_packed_default=" --dry-run --quiet --no-dry-run -- --no-quiet" +__gitcomp_builtin_pull_default=" --verbose --quiet --progress --recurse-submodules --rebase --stat --log --signoff --squash --commit --edit --cleanup= --ff --ff-only --verify-signatures --autostash --strategy= --strategy-option= --gpg-sign --allow-unrelated-histories --all --append --upload-pack= --force --tags --prune --jobs --dry-run --keep --depth= --unshallow --update-shallow --refmap= --ipv4 --ipv6 --no-verbose -- --no-quiet --no-progress --no-recurse-submodules --no-rebase --no-stat --no-log --no-signoff --no-squash --no-commit --no-edit --no-cleanup --no-ff --no-verify-signatures --no-autostash --no-strategy --no-strategy-option --no-gpg-sign --no-allow-unrelated-histories --no-all --no-append --no-upload-pack --no-force --no-tags --no-prune --no-jobs --no-dry-run --no-keep --no-depth --no-update-shallow --no-ipv4 --no-ipv6" +__gitcomp_builtin_push_default=" --verbose --quiet --repo= --all --mirror --delete --tags --dry-run --porcelain --force --force-with-lease --recurse-submodules --receive-pack= --exec= --set-upstream --progress --prune --no-verify --follow-tags --signed --atomic --push-option= --ipv4 --ipv6 --verify -- --no-verbose --no-quiet --no-repo --no-all --no-mirror --no-delete --no-tags --no-dry-run --no-porcelain --no-force --no-force-with-lease --no-recurse-submodules --no-receive-pack --no-exec --no-set-upstream --no-progress --no-prune --no-follow-tags --no-signed --no-atomic --no-push-option --no-ipv4 --no-ipv6" +__gitcomp_builtin_range_diff_default=" --creation-factor= --no-dual-color --patch --no-patch --unified --function-context --raw --patch-with-raw --patch-with-stat --numstat --shortstat --dirstat --cumulative --dirstat-by-file --check --summary --name-only --name-status --stat --stat-width= --stat-name-width= --stat-graph-width= --stat-count= --compact-summary --binary --full-index --color --ws-error-highlight= --abbrev --src-prefix= --dst-prefix= --line-prefix= --no-prefix --inter-hunk-context= --output-indicator-new= --output-indicator-old= --output-indicator-context= --break-rewrites --find-renames --irreversible-delete --find-copies --find-copies-harder --no-renames --rename-empty --follow --minimal --ignore-all-space --ignore-space-change --ignore-space-at-eol --ignore-cr-at-eol --ignore-blank-lines --indent-heuristic --patience --histogram --diff-algorithm= --anchored= --word-diff --word-diff-regex= --color-words --color-moved --color-moved-ws= --relative --text --exit-code --quiet --ext-diff --textconv --ignore-submodules --submodule --ita-invisible-in-index --ita-visible-in-index --pickaxe-all --pickaxe-regex --find-object= --diff-filter= --output= --dual-color -- --no-creation-factor --no-function-context --no-compact-summary --no-full-index --no-color --no-abbrev --no-find-copies-harder --no-rename-empty --no-follow --no-minimal --no-indent-heuristic --no-color-moved --no-color-moved-ws --no-text --no-exit-code --no-quiet --no-ext-diff --no-textconv" +__gitcomp_builtin_read_tree_default=" --index-output= --empty --verbose --trivial --aggressive --reset --prefix= --exclude-per-directory= --dry-run --no-sparse-checkout --debug-unpack --recurse-submodules --quiet --sparse-checkout -- --no-empty --no-verbose --no-trivial --no-aggressive --no-reset --no-dry-run --no-debug-unpack --no-recurse-submodules --no-quiet" +__gitcomp_builtin_rebase_default=" --onto= --no-verify --quiet --verbose --no-stat --signoff --ignore-whitespace --committer-date-is-author-date --ignore-date --whitespace= --force-rebase --no-ff --continue --skip --abort --quit --edit-todo --show-current-patch --merge --interactive --preserve-merges --rerere-autoupdate --keep-empty --autosquash --gpg-sign --autostash --exec= --allow-empty-message --rebase-merges --fork-point --strategy= --strategy-option= --root --reschedule-failed-exec --verify --stat --ff -- --no-onto --no-quiet --no-verbose --no-signoff --no-ignore-whitespace --no-committer-date-is-author-date --no-ignore-date --no-whitespace --no-force-rebase --no-preserve-merges --no-rerere-autoupdate --no-keep-empty --no-autosquash --no-gpg-sign --no-autostash --no-exec --no-allow-empty-message --no-rebase-merges --no-fork-point --no-strategy --no-strategy-option --no-root --no-reschedule-failed-exec" +__gitcomp_builtin_rebase__interactive_default=" --ff --keep-empty --allow-empty-message --rebase-merges --rebase-cousins --autosquash --signoff --verbose --continue --skip --edit-todo --show-current-patch --shorten-ids --expand-ids --check-todo-list --rearrange-squash --add-exec-commands --onto= --restrict-revision= --squash-onto= --upstream= --head-name= --gpg-sign --strategy= --strategy-opts= --switch-to= --onto-name= --cmd= --rerere-autoupdate --reschedule-failed-exec --no-ff -- --no-keep-empty --no-allow-empty-message --no-rebase-merges --no-rebase-cousins --no-autosquash --no-signoff --no-verbose --no-head-name --no-gpg-sign --no-strategy --no-strategy-opts --no-switch-to --no-onto-name --no-cmd --no-rerere-autoupdate --no-reschedule-failed-exec" +__gitcomp_builtin_receive_pack_default=" --quiet --no-quiet" +__gitcomp_builtin_reflog_default=" --quiet --source --use-mailmap --decorate-refs= --decorate-refs-exclude= --decorate --no-quiet -- --no-source --no-use-mailmap --no-decorate-refs --no-decorate-refs-exclude --no-decorate" +__gitcomp_builtin_remote_default=" --verbose --no-verbose" +__gitcomp_builtin_repack_default=" --quiet --local --write-bitmap-index --delta-islands --unpack-unreachable= --keep-unreachable --window= --window-memory= --depth= --threads= --max-pack-size= --pack-kept-objects --keep-pack= --no-quiet -- --no-local --no-write-bitmap-index --no-delta-islands --no-unpack-unreachable --no-keep-unreachable --no-window --no-window-memory --no-depth --no-threads --no-max-pack-size --no-pack-kept-objects --no-keep-pack" +__gitcomp_builtin_replace_default=" --list --delete --edit --graft --convert-graft-file --raw --format= --no-raw -- --no-format" +__gitcomp_builtin_rerere_default=" --rerere-autoupdate --no-rerere-autoupdate" +__gitcomp_builtin_reset_default=" --quiet --mixed --soft --hard --merge --keep --recurse-submodules --patch --intent-to-add --no-quiet -- --no-mixed --no-soft --no-hard --no-merge --no-keep --no-recurse-submodules --no-patch --no-intent-to-add" +__gitcomp_builtin_revert_default=" --quit --continue --abort --cleanup= --no-commit --edit --signoff --mainline= --rerere-autoupdate --strategy= --strategy-option= --gpg-sign --commit -- --no-cleanup --no-edit --no-signoff --no-mainline --no-rerere-autoupdate --no-strategy --no-strategy-option --no-gpg-sign" +__gitcomp_builtin_rm_default=" --dry-run --quiet --cached --ignore-unmatch --no-dry-run -- --no-quiet --no-cached --no-ignore-unmatch" +__gitcomp_builtin_send_pack_default=" --verbose --quiet --receive-pack= --exec= --remote= --all --dry-run --mirror --force --signed --push-option= --progress --thin --atomic --stateless-rpc --stdin --helper-status --force-with-lease --no-verbose -- --no-quiet --no-receive-pack --no-exec --no-remote --no-all --no-dry-run --no-mirror --no-force --no-signed --no-push-option --no-progress --no-thin --no-atomic --no-stateless-rpc --no-stdin --no-helper-status --no-force-with-lease" +__gitcomp_builtin_shortlog_default=" --committer --numbered --summary --email --no-committer -- --no-numbered --no-summary --no-email" +__gitcomp_builtin_show_default=" --quiet --source --use-mailmap --decorate-refs= --decorate-refs-exclude= --decorate --no-quiet -- --no-source --no-use-mailmap --no-decorate-refs --no-decorate-refs-exclude --no-decorate" +__gitcomp_builtin_show_branch_default=" --all --remotes --color --more --list --no-name --current --sha1-name --merge-base --independent --topo-order --topics --sparse --date-order --reflog --name -- --no-all --no-remotes --no-color --no-more --no-list --no-current --no-sha1-name --no-merge-base --no-independent --no-topo-order --no-topics --no-sparse --no-date-order" +__gitcomp_builtin_show_index_default="" +__gitcomp_builtin_show_ref_default=" --tags --heads --verify --head --dereference --hash --abbrev --quiet --exclude-existing --no-tags -- --no-heads --no-verify --no-head --no-dereference --no-hash --no-abbrev --no-quiet" +__gitcomp_builtin_stage_default=" --dry-run --verbose --interactive --patch --edit --force --update --renormalize --intent-to-add --all --ignore-removal --refresh --ignore-errors --ignore-missing --chmod= --no-dry-run -- --no-verbose --no-interactive --no-patch --no-edit --no-force --no-update --no-renormalize --no-intent-to-add --no-all --no-ignore-removal --no-refresh --no-ignore-errors --no-ignore-missing --no-chmod" +__gitcomp_builtin_stash_default="" +__gitcomp_builtin_status_default=" --verbose --short --branch --show-stash --ahead-behind --porcelain --long --null --untracked-files --ignored --ignore-submodules --column --no-renames --find-renames --renames -- --no-verbose --no-short --no-branch --no-show-stash --no-ahead-behind --no-porcelain --no-long --no-null --no-untracked-files --no-ignored --no-ignore-submodules --no-column" +__gitcomp_builtin_stripspace_default=" --strip-comments --comment-lines" +__gitcomp_builtin_symbolic_ref_default=" --quiet --delete --short --no-quiet -- --no-delete --no-short" +__gitcomp_builtin_tag_default=" --list --delete --verify --annotate --message= --file= --edit --sign --cleanup= --local-user= --force --create-reflog --column --contains --no-contains --merged --no-merged --sort= --points-at --format= --color --ignore-case -- --no-annotate --no-file --no-edit --no-sign --no-cleanup --no-local-user --no-force --no-create-reflog --no-column --no-points-at --no-format --no-color --no-ignore-case" +__gitcomp_builtin_update_index_default=" --ignore-submodules --add --replace --remove --unmerged --refresh --really-refresh --cacheinfo --chmod= --assume-unchanged --no-assume-unchanged --skip-worktree --no-skip-worktree --info-only --force-remove --stdin --index-info --unresolve --again --ignore-missing --verbose --clear-resolve-undo --index-version= --split-index --untracked-cache --test-untracked-cache --force-untracked-cache --force-write-index --fsmonitor --fsmonitor-valid --no-fsmonitor-valid -- --no-ignore-submodules --no-add --no-replace --no-remove --no-unmerged --no-info-only --no-force-remove --no-ignore-missing --no-verbose --no-index-version --no-split-index --no-untracked-cache --no-test-untracked-cache --no-force-untracked-cache --no-force-write-index --no-fsmonitor" +__gitcomp_builtin_update_ref_default=" --no-deref --stdin --create-reflog --deref -- --no-stdin --no-create-reflog" +__gitcomp_builtin_update_server_info_default=" --force --no-force" +__gitcomp_builtin_upload_pack_default=" --stateless-rpc --advertise-refs --strict --timeout= --no-stateless-rpc -- --no-advertise-refs --no-strict --no-timeout" +__gitcomp_builtin_verify_commit_default=" --verbose --raw --no-verbose -- --no-raw" +__gitcomp_builtin_verify_pack_default=" --verbose --stat-only --no-verbose -- --no-stat-only" +__gitcomp_builtin_verify_tag_default=" --verbose --raw --format= --no-verbose -- --no-raw --no-format" +__gitcomp_builtin_version_default=" --build-options --no-build-options" +__gitcomp_builtin_whatchanged_default=" --quiet --source --use-mailmap --decorate-refs= --decorate-refs-exclude= --decorate --no-quiet -- --no-source --no-use-mailmap --no-decorate-refs --no-decorate-refs-exclude --no-decorate" +__gitcomp_builtin_write_tree_default=" --missing-ok --prefix= --no-missing-ok -- --no-prefix" +__gitcomp_builtin_send_email_default=" --numbered --no-numbered --signoff --stdout --cover-letter --numbered-files --suffix= --start-number= --reroll-count= --rfc --subject-prefix= --output-directory= --keep-subject --no-binary --zero-commit --ignore-if-in-upstream --no-stat --add-header= --to= --cc= --from --in-reply-to= --attach --inline --thread --signature= --base= --signature-file= --quiet --progress --interdiff= --range-diff= --creation-factor= --binary -- --no-numbered --no-signoff --no-stdout --no-cover-letter --no-numbered-files --no-suffix --no-start-number --no-reroll-count --no-zero-commit --no-ignore-if-in-upstream --no-add-header --no-to --no-cc --no-from --no-in-reply-to --no-attach --no-thread --no-signature --no-base --no-signature-file --no-quiet --no-progress --no-interdiff --no-range-diff --no-creation-factor" + # This function is equivalent to # # __gitcomp "$(git xxx --git-completion-helper) ..." @@ -400,7 +494,8 @@ __gitcomp_builtin () if [ -z "$options" ]; then # leading and trailing spaces are significant to make # option removal work correctly. - options=" $incl $(__git ${cmd/_/ } --git-completion-helper) " + options=" $incl $(__git ${cmd/_/ } --git-completion-helper) " || + eval "options=\" $incl \$${var}_default \"" for i in $excl; do options="${options/ $i / }" done diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 3dbfef6960..14598bfbec 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -1428,7 +1428,7 @@ test_expect_success 'double dash "git" itself' ' EOF ' -test_expect_failure 'double dash "git checkout"' ' +test_expect_success 'double dash "git checkout"' ' offgit && test_completion "git checkout --" <<-\EOF --quiet Z @@ -1561,7 +1561,7 @@ test_expect_success 'complete tree filename with metacharacters' ' EOF ' -test_expect_failure PERL 'send-email' ' +test_expect_success PERL 'send-email' ' test_completion "git send-email ma" "master " && offgit && test_completion "git send-email --cov" "--cover-letter " From patchwork Fri Jun 21 22:31:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11010791 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 AD5DC14B6 for ; Fri, 21 Jun 2019 22:31:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E58928B7B for ; Fri, 21 Jun 2019 22:31:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 918AF28BAB; Fri, 21 Jun 2019 22:31: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 3D0BA28B7B for ; Fri, 21 Jun 2019 22:31:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726206AbfFUWba (ORCPT ); Fri, 21 Jun 2019 18:31:30 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:43869 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbfFUWb2 (ORCPT ); Fri, 21 Jun 2019 18:31:28 -0400 Received: by mail-ot1-f65.google.com with SMTP id i8so662320oth.10 for ; Fri, 21 Jun 2019 15:31:28 -0700 (PDT) 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=ZO7yby0/XVxCyPkgiYHbmca//TbCCBrhLrSjteLUtqM=; b=YIu/ngVFqFm4o696Ie6uwL4/LhXIRumaQ+nrKj4m3tVw/SDfbgUJTjXKTc9MP2T5G+ Cm0isRbARI+kODIUaBGw5/yaMZqE7v/CzWMyDdz+jhXESCwJtC0Cd2IsP8V4x27MdByi Wta/acB54tqvIVyUS1lGrEnjFO0zw6gLAGuVCFuBB3t4bgoqreNF/egHccg/PYwBg0YL Hptc1TqzLfAzdpF9lt9Bskn6wWXbi8BDlgj6tw2xDAoqCKowRt/au0k4hpvKCron/zIn bict3F5b83xGSFPW9fx71C3G8Mtwm+XQpI36R/pV+XRF5lkyG2Fpq6YeDk2Jr91EFzbJ U/oQ== 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=ZO7yby0/XVxCyPkgiYHbmca//TbCCBrhLrSjteLUtqM=; b=Lvd3kv7w6UcE1zifnvydDNFsgHvboK8ZzPpSVtZM1W3i68BXgjFezp1I3BS/okkhfg 36qC8wrfXiLZ4X8nvY/2augZ2hxeodSx9k/OklGQNaRVtOYZsRT1eYz5UB1ULVobNGkr Ids2JcUcFw0IikSWaJqi42xcReCFyUdnhTT41vRINcD3clkIwmAkyJlxy6vU8H0olt6/ 7eC6kxx5B0ZextfpdajYAMEjpURJyPhK2EEyEUoKaksR0+ZVhE7qWZ4BpwG7Nip1nDiL ylggdaqsP5DkD888CrcCIqw6rXNSY89R+CFVMC/uBFyUeLjAfp3XTg2+EBTR0cn8s443 sxSA== X-Gm-Message-State: APjAAAULHGrqWEZjwGZ8dryWzRRGim9OPfsufb78H09MAD1BZHjOvOEc kRTnAYq1sH8fComHzHao6+eoxvv5hRo= X-Google-Smtp-Source: APXvYqyo0caBgmdNoqYAIsJzUwKbiu8/D5od+8QBlPQIryGh6rqjp7hnQ4IlkXk7PENEQxDJ/k4oEw== X-Received: by 2002:a9d:7ccb:: with SMTP id r11mr40005877otn.80.1561156287558; Fri, 21 Jun 2019 15:31:27 -0700 (PDT) Received: from localhost (200-52-42-156.reservada.static.axtel.net. [200.52.42.156]) by smtp.gmail.com with ESMTPSA id a4sm1466470otp.72.2019.06.21.15.31.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 15:31:27 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?Tmd1eQ==?= =?utf-8?b?4buFbiBUaMOhaSBOZ+G7jWMgRHV5?= , Felipe Contreras Subject: [PATCH 14/14] completion: add default merge strategies Date: Fri, 21 Jun 2019 17:31:07 -0500 Message-Id: <20190621223107.8022-15-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190621223107.8022-1-felipe.contreras@gmail.com> References: <20190621223107.8022-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case the command fails. Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 4 +++- t/t9902-completion.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 922ba5f925..91b87eb558 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -936,6 +936,7 @@ __git_list_merge_strategies () }' } +__git_merge_strategies_default='octopus ours recursive resolve subtree' __git_merge_strategies= # 'git merge -s help' (and thus detection of the merge strategy # list) fails, unfortunately, if run outside of any git working @@ -945,7 +946,8 @@ __git_merge_strategies= __git_compute_merge_strategies () { test -n "$__git_merge_strategies" || - __git_merge_strategies=$(__git_list_merge_strategies) + { __git_merge_strategies=$(__git_list_merge_strategies); + __git_merge_strategies="${__git_merge_strategies:-__git_merge_strategies_default}"; } } __git_merge_strategy_options="ours theirs subtree subtree= patience diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 14598bfbec..f4453ce70d 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -1722,7 +1722,7 @@ test_expect_success 'sourcing the completion script clears cached commands' ' verbose test -z "$__git_all_commands" ' -test_expect_failure 'sourcing the completion script clears cached merge strategies' ' +test_expect_success 'sourcing the completion script clears cached merge strategies' ' offgit && GIT_TEST_GETTEXT_POISON= && __git_compute_merge_strategies &&