zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: PATCH: _git and wrapper aliases
Date: Sun, 9 Mar 2008 08:12:48 -0400	[thread overview]
Message-ID: <20080309121248.GA18831@scowler.net> (raw)

A user has a wrapper script which he is aliasing as "git". The following
change allows him to
alias git=gitwrapper
compdef _git gitwrapper=git

I just woke up, and I have no idea if I've broken anything.

Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.60
diff -u -r1.60 _git
--- Completion/Unix/Command/_git	28 Feb 2008 17:20:44 -0000	1.60
+++ Completion/Unix/Command/_git	9 Mar 2008 12:10:14 -0000
@@ -4138,7 +4138,7 @@
     unset tmpwords
   fi
 
-  if [[ $words[1] == git ]]; then
+  if [[ $service == git ]]; then
     local state line
     declare -A opt_args
     _arguments -C \
@@ -4155,12 +4155,12 @@
         __git_aliases_and_commands
         ;;
       (options)
-        curcontext="${curcontext%:*:*}:git-$words[1]:"
-        _call_function ret _git-$words[1]
+        curcontext="${curcontext%:*:*}:git-$service:"
+        _call_function ret _git-$service
         ;;
     esac
   else
-    _call_function ret _$words[1]
+    _call_function ret _$service
   fi
 }
 


                 reply	other threads:[~2008-03-09 12:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080309121248.GA18831@scowler.net \
    --to=clint@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /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).