Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _git: Update __git_merge_strategies to work with new git.
- X-seq: zsh-workers 25522
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: _git: Update __git_merge_strategies to work with new git.
- Date: Sun, 24 Aug 2008 21:52:21 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=A3MDnyqc+qN3fDvi/pORg+UbPiA6Ea+MdgnV51YoLJc=; b=Uyb8DsCXQl7P0NptnKJ540Ffng2s1M/lnmms0CvGq+ByhdJr7GCXLpmnObdarZX53u YDwquvlzJ3qNMwWDveHDOrKEYGdWgTNr9Ssse+k/75TiD3YqDSr/R3vahOzVKi6bGLCD z8nK0CPRiTjcvl9VSU6vnpvjy1EYPq7NT9BnE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=YwjTBVFOGdRqa1UXXF5CyiltAQF9kmKZbKeqge5n5W4NId9kMlzBglf5i9VQ6NGwDR mKdvmiSUt6k22P3YOuArMzz+Yc/PnuqryJols3ceNQg5h+6O3FVq1w8vXPgwEBRhBBLY 8nuaORP4r7fRVQwdL18HRqZb++7hBqsLKMSWI=
- In-reply-to: <20080824194226.GA23589@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0808210443y542c4794v50c5ea0eb1a308f@xxxxxxxxxxxxxx> <20080821122947.GA4065@xxxxxxxx> <237967ef0808211319u42388b15w330c324e3f8043e@xxxxxxxxxxxxxx> <20080822103622.GA31581@xxxxxxxx> <237967ef0808220841x635d8180n7c1b46ab682c8869@xxxxxxxxxxxxxx> <20080824163658.GA20363@xxxxxxxx> <237967ef0808241140r20c09376wfcee421ac1db7e6b@xxxxxxxxxxxxxx> <20080824191244.GA23476@xxxxxxxx> <237967ef0808241216t5a8e3b3t17756e52e15e3628@xxxxxxxxxxxxxx> <20080824194226.GA23589@xxxxxxxx>
2008/8/24 Clint Adams <clint@xxxxxxx>:
> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author