From: "Mikael Magnusson" <mikachu@gmail.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: _git: Update __git_merge_strategies to work with new git.
Date: Sun, 24 Aug 2008 21:52:21 +0200 [thread overview]
Message-ID: <237967ef0808241252m3421cfa3p3863ea38a7112c57@mail.gmail.com> (raw)
In-Reply-To: <20080824194226.GA23589@scru.org>
2008/8/24 Clint Adams <clint@zsh.org>:
> On Sun, Aug 24, 2008 at 09:16:13PM +0200, Mikael Magnusson wrote:
>> The git-bundled bash completion doesn't exclude it at any rate.
>
> The other issue is that the git merge -s '' trick doesn't work outside
> of git directories.
>
> So maybe this is the way to go.
>
> Index: Completion/Unix/Command/_git
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
> retrieving revision 1.88
> diff -u -r1.88 _git
> --- Completion/Unix/Command/_git 21 Aug 2008 12:25:26 -0000 1.88
> +++ Completion/Unix/Command/_git 24 Aug 2008 19:40:39 -0000
> @@ -4039,12 +4039,14 @@
>
> (( $+functions[__git_merge_strategies] )) ||
> __git_merge_strategies () {
> - declare -a merge_strategies_cache
> + local expl
> + local -a merge_strategies
>
> - merge_strategies_cache=(${${=${${(M)${(f)"$(<$(git --exec-path)/git-merge)"}:#all_strategies*}##all_strategies=\'}%%\'}:#recur})
> + if ! merge_strategies=(${=${${(M)${(f)"$(_call_program strategies git merge -s '' 2>&1)"}:#[Aa]vailable (custom )#strategies are: *}#[Aa]vailable (custom )#strategies are: }%.}); then
> + merge_strategies=(${=${${(M)${(f)"$(<$(git --exec-path)/git-merge)"}:#all_strategies*}##all_strategies=\'}%%\'})
> + fi
>
> - local expl
> - _wanted merge-strategies expl 'merge strategy' compadd - $merge_strategies_cache
> + _wanted merge-strategies expl 'merge strategy' compadd -a merge_strategies "$@"
> }
>
> # TODO: Use this in more places.
git-merge is a binary in newer versions of git.
--
Mikael Magnusson
next prev parent reply other threads:[~2008-08-24 19:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-21 11:43 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 [this message]
2008-08-24 23:37 ` Nikolai Weibull
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=237967ef0808241252m3421cfa3p3863ea38a7112c57@mail.gmail.com \
--to=mikachu@gmail.com \
--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).