zsh-workers
 help / color / mirror / code / Atom feed
From: "Miroslav Koškár" <mk@mkoskar.com>
To: zsh-workers@zsh.org
Cc: d.s@daniel.shahaf.name
Subject: [PATCH 4/4] _git: Don't shadow global aliases
Date: Sat, 27 Jun 2020 08:12:18 +0200	[thread overview]
Message-ID: <010627a701d00eb778b1c8bde314497f28912a74.1593236365.git.mk@mkoskar.com> (raw)
In-Reply-To: <cover.1593236365.git.mk@mkoskar.com>

---
 Completion/Unix/Command/_git | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index e2d3d6e..6f7a462 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -8116,15 +8116,11 @@ _git() {
         _git_commands && ret=0
         ;;
       (option-or-argument)
-        local -a aliases
         local -A git_aliases
-        local a k v
+        local a
         local endopt='!(-)--end-of-options'
-        aliases=(${(0)"$(_call_program aliases git config -z --get-regexp '\^alias\\.')"})
-        for a in ${aliases}; do
-            k="${${a/$'\n'*}/alias.}"
-            v="${a#*$'\n'}"
-            git_aliases[$k]="$v"
+        for a in ${(0)"$(_call_program aliases git config -z --get-regexp '\^alias\\.')"}; do
+          git_aliases[${${a/$'\n'*}/alias.}]=${a#*$'\n'}
         done
         local git_alias=git_aliases[\$words[1]]
         if (( ${(P)+git_alias} && !$+commands[git-$words[1]] && !$+functions[_git-$words[1]] )); then
-- 
2.27.0



  parent reply	other threads:[~2020-06-27  6:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 11:12 [PATCH] _git: Improve handling of aliases Miroslav Koškár
2020-06-24 11:56 ` Daniel Shahaf
2020-06-26 10:17   ` Miroslav Koškár
2020-06-26 17:00     ` Daniel Shahaf
2020-06-27  6:12       ` [PATCH 0/4] " Miroslav Koškár
2020-06-27  6:12         ` [PATCH 1/4] _git: Remove hanging whitespaces Miroslav Koškár
2020-06-27  6:12         ` [PATCH 2/4] _git: Fix insufficiently quoted pattern Miroslav Koškár
2020-06-27  6:12         ` [PATCH 3/4] _git: Fix handling of aliases Miroslav Koškár
2020-06-27  6:12         ` Miroslav Koškár [this message]
2020-06-27  9:04       ` _git: Improve " Miroslav Koškár
2020-06-27 20:39         ` Daniel Shahaf

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=010627a701d00eb778b1c8bde314497f28912a74.1593236365.git.mk@mkoskar.com \
    --to=mk@mkoskar.com \
    --cc=d.s@daniel.shahaf.name \
    --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).