zsh-workers
 help / color / mirror / code / Atom feed
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: Fri, 22 Aug 2008 17:41:39 +0200	[thread overview]
Message-ID: <237967ef0808220841x635d8180n7c1b46ab682c8869@mail.gmail.com> (raw)
In-Reply-To: <20080822103622.GA31581@scru.org>

2008/8/22 Clint Adams <clint@zsh.org>:
> On Thu, Aug 21, 2008 at 10:19:18PM +0200, Mikael Magnusson wrote:
>> Yes, touch /usr/local/bin/git-merge-clint and +x it:
>> % git merge -s ''
>> Could not find merge strategy ''.
>> Available strategies are: file octopus ours recursive resolve subtree.
>> Available custom strategies are: mikachu.
>
> Doesn't do anything with my version.
>
>> So it should be
>> merge_strategies_cache=(${(s: :)${${${${(f)"$(git merge -s ''
>> 2>&1)"}[(r)[Aa]vailable strategies are: *,(r)]}%%.}##*: }})
>
> Gives me a blank array.
>
> Maybe this:
>
> ${(s: :)${${(M)${(f)"$(git merge -s '' 2>&1)"}:#[Aa]vailable strategies are: *}#[Aa]vailable strategies are: }%.}

That doesn't grab the custom strategies line... How about this? Sort
of a hack though... :)

${(s: :)${${${${(f)"$(echo; git merge -s '' 2>&1)"}[(r)[Aa]vailable
strategies are: *,(r)]}%%.}##*: }}

::Some minutes later::
Aha, my first version didn't work for you because it's only one line, so the
(f) doesn't give you an array:
% echo ${${(f)"$(echo available strategies are: recur recursive
octopus resolve stupid ours subtree)"}[(r)[Aa]vailable strategies are:
*]}
a

I've no idea if you can force an array in a better way than with the echo
though.

-- 
Mikael Magnusson


  reply	other threads:[~2008-08-22 15:41 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 [this message]
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

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=237967ef0808220841x635d8180n7c1b46ab682c8869@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).