From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3821 invoked by alias); 26 Jul 2011 22:57:51 -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: 29614 Received: (qmail 27645 invoked from network); 26 Jul 2011 22:57:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at lukaperkov.net does not designate permitted sender hosts) Date: Wed, 27 Jul 2011 00:57:39 +0200 From: Luka Perkov To: zsh-workers@zsh.org Subject: PATCH: _quilt: fix push and pop completion Message-ID: <20110726225739.GA6008@w500.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Patch fixes 'bug' in _quilt completion script when there is not possible to do push or pop. Also tabs are replaced with spaces because they were not consistent. Signed-off-by: Luka Perkov < lists ->-to->- lukaperkov.net > --- diff --git a/Completion/Unix/Command/_quilt b/Completion/Unix/Command/_quilt index a2fd799..d12a672 100644 --- a/Completion/Unix/Command/_quilt +++ b/Completion/Unix/Command/_quilt @@ -14,17 +14,23 @@ case "$state" in case "$words[1]" in (applied|delete|files|graph|header|next|previous|refresh|unapplied) - _wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"} - ;; + _wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"} + ;; (push) - _wanted -V 'unapplied patches' expl 'patch' compadd ${(f)"$(quilt unapplied)"} - ;; + tmp=$(quilt unapplied 2>&1) + if [[ "$tmp[1,40]" != "File series fully applied, ends at patch" ]]; then + _wanted -V 'unapplied patches' expl 'patch' compadd ${(f)"$(quilt unapplied)"} + fi + ;; (pop) - _wanted -V 'applied patches' expl 'patch' compadd ${(f)"$(quilt applied)"} - ;; + tmp=$(quilt applied 2>&1) + if [[ "$tmp" != "No patches applied" ]]; then + _wanted -V 'applied patches' expl 'patch' compadd ${(f)"$(quilt applied)"} + fi + ;; (*) - _files - ;; + _files + ;; esac ;; esac