zsh-workers
 help / color / mirror / code / Atom feed
* _git: Update __git_merge_strategies to work with new git.
@ 2008-08-21 11:43 Mikael Magnusson
  2008-08-21 12:29 ` Clint Adams
  0 siblings, 1 reply; 12+ messages in thread
From: Mikael Magnusson @ 2008-08-21 11:43 UTC (permalink / raw)
  To: zsh-workers

This is the corresponding code from the bundled bash-completion:
    git merge -s help 2>&1 |
    sed -n -e '/[Aa]vailable strategies are: /,/^$/{
            s/\.$//
            s/.*://
            s/^[    ]*//
            s/[     ]*$//
            p
    }'

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 7e48c19..c799a40 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -4046,7 +4046,7 @@ __git_gpg_secret_keys () {
 __git_merge_strategies () {
   declare -a merge_strategies_cache

-  merge_strategies_cache=(${${=${${(M)${(f)"$(<$(git
--exec-path)/git-merge)"}:#all_strategies*}##all_strategies=\'}%%\'}:#recur})
+  merge_strategies_cache=(${(s: :)${${${${(ps:\n:)"$(git merge -s ''
2>&1)"}[(r)Available strategies are: *,(r)]}%%.}##*: }})

   local expl
   _wanted merge-strategies expl 'merge strategy' compadd -
$merge_strategies_cache


-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-08-24 23:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-21 11:43 _git: Update __git_merge_strategies to work with new git Mikael Magnusson
2008-08-21 12:29 ` Clint Adams
2008-08-21 20:19   ` Mikael Magnusson
2008-08-22 10:36     ` Clint Adams
2008-08-22 15:41       ` Mikael Magnusson
2008-08-24 16:36         ` Clint Adams
2008-08-24 18:40           ` Mikael Magnusson
2008-08-24 19:12             ` Clint Adams
2008-08-24 19:16               ` Mikael Magnusson
2008-08-24 19:42                 ` Clint Adams
2008-08-24 19:52                   ` Mikael Magnusson
2008-08-24 23:37               ` Nikolai Weibull

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).