From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11227 invoked by alias); 13 Aug 2015 11:47:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36148 Received: (qmail 28318 invoked from network); 13 Aug 2015 11:47:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1439466044; bh=4aCi55uxaAE8/KNKZEocCA+noRh47rbqZFjWBhqNLng=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=CL+8jdq0ym8kvWxWQZJK/1LBJk8e1SwlkB8gpe0LghQUiyfGvSeaCWWU9WbTYlyB1JxkrBoSlS+4NYWtA0lhX+JIX7YP5sTMuh42Jj+1LH5qdb5bCjQZ7TZqjPqAAMmYx1MmJl/67U4xS5OvHxPqOxH5UX09g6sXSDbocViJAeBSBOwMipI0DUPPOgQd0yyCBl5JkGEfS4eEJEu2oPXGBuOKmvI+WZK54LNj5pGzOaDKFXhZ8Les9nIO85GjeXQyvye/ljwIHChpzyd1ij7Mc38/zBfTNnhLdQ+E1ClazpCfOQaMPBhQtZv2EICfqDRZWKqQGPpWEU9fW/5F0jZwpg== X-Yahoo-Newman-Id: 635779.49561.bm@smtp150.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: UY3EUgsVM1n3kPMvpwUMy9_yNiFYlFbTdY5U2WVQvaKpDT9 JnfFswjhKaTrYGUkp9OKTJtP_j9aTxQ__AcF3fXiKkkG_ph50NYkI2XFwvcz 3oWfdsMvfeQge6.uBWJs6_vNuOaYm0BvYPUqFgmmT_B4gWIFyHOBAUWpIHFm M1jCEPIBkOAMU1VNrz6qoDe8vdTKOEsRimB7LXo1o5Ey_pcxOFzzbh9l3.pd 1JnNGSLQdYtQ2Z_5ziHN34zl8WkUPEIp00B76SBBSsphPMrhn0y1jKkbDt.8 zufjSQ54QRaSjFlEWOLrVA.VH4_0KuzX.J0qRutnLQU8Ap7iD.iDBA.EHwMl qMXM0PVZG5me2yoQj9SeXIyxySzdi9V09ZNqUaQkWbuk5.fbKgFazxxjp0Hj 82EAJokH.5tuilDGNESpYGRSVeo9hPfqYhHPtIuexvH4jbf94oiloL6lsUTT pmSkzvL1RGxUCZ0X8oGd6NidaWz9Lg6tNMljo6YBWOSBminMoqMikwDXGANl sDZEprsU91z_pJnTBfeZYtSlGp1prPQ-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <20150813120745.6ffc97af@pwslap01u.europe.root.pri> From: Oliver Kiddle References: <20150813120745.6ffc97af@pwslap01u.europe.root.pri> To: Zsh Hackers' List Subject: Re: git log -1 --... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12768.1439466043.1@thecus.kiddle.eu> Date: Thu, 13 Aug 2015 13:40:43 +0200 Message-ID: <12769.1439466043@thecus.kiddle.eu> Peter wrote: > I haven't looked, but this could well be because _arguments hasn't been > told - is a valid completion because there's no point actually > completing it, so it assumes it's a regular argument. Same problem for git log HEAD --... so it is not quite that. It's an effect of the *:: form with _arguments. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index a5e4464..fb8ba6a 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1087,33 +1087,31 @@ _git-log () { $revision_options \ '-L+[trace the evolution of a line range or regex within a file]:range' \ '(-)--[start file arguments]' \ - '*:: :->commit-range-or-file' && ret=0 + '1: :->first-commit-ranges-or-files' \ + '*: :->commit-ranges-or-files' && ret=0 case $state in - (commit-range-or-file) - case $CURRENT in - (1) - if [[ -n ${opt_args[(I)--]} ]]; then - __git_cached_files && ret=0 - else - _alternative \ - 'commit-ranges::__git_commit_ranges' \ - 'cached-files::__git_cached_files' && ret=0 - fi - ;; - (*) - # TODO: Write a wrapper function that checks whether we have a - # committish range or comittish and calls __git_tree_files - # appropriately. - if __git_is_committish_range $line[1]; then - __git_tree_files ${PREFIX:-.} $(__git_committish_range_last $line[1]) && ret=0 - elif __git_is_committish $line[1]; then - __git_tree_files ${PREFIX:-.} $line[1] && ret=0 - else - __git_cached_files && ret=0 - fi - ;; - esac + (first-commit-ranges-or-files) + if [[ -n ${opt_args[(I)--]} ]]; then + __git_cached_files && ret=0 + else + _alternative \ + 'commit-ranges::__git_commit_ranges' \ + 'cached-files::__git_cached_files' && ret=0 + fi + ;; + (commit-ranges-or-files) + # TODO: Write a wrapper function that checks whether we have a + # committish range or comittish and calls __git_tree_files + # appropriately. + if __git_is_committish_range $line[1]; then + __git_tree_files ${PREFIX:-.} $(__git_committish_range_last $line[1]) && ret=0 + elif __git_is_committish $line[1]; then + __git_tree_files ${PREFIX:-.} $line[1] && ret=0 + else + __git_cached_files && ret=0 + fi + ;; esac return ret