zsh-workers
 help / color / mirror / code / Atom feed
From: Luka Perkov <lists@lukaperkov.net>
To: zsh-workers@zsh.org
Subject: PATCH: _quilt: fix push and pop completion
Date: Wed, 27 Jul 2011 00:57:39 +0200	[thread overview]
Message-ID: <20110726225739.GA6008@w500.lan> (raw)

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


             reply	other threads:[~2011-07-26 22:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 22:57 Luka Perkov [this message]
2011-07-27  7:50 ` Frank Terbeck
2011-07-27 18:21   ` Luka Perkov
2011-07-29 13:10     ` Frank Terbeck
2011-07-29 22:15       ` Luka Perkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110726225739.GA6008@w500.lan \
    --to=lists@lukaperkov.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).