diff options
author | Clint Adams <clint@users.sourceforge.net> | 2008-08-24 19:48:09 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2008-08-24 19:48:09 +0000 |
commit | 9d7298bac8c9c8930fa69e4bffa75fb6d0beb506 (patch) | |
tree | bd2da92215628f7034c482a11bcd7c76dccbdbec | |
parent | 9fe735e663507164a61341c998247328fa2a738b (diff) | |
download | zsh-9d7298bac8c9c8930fa69e4bffa75fb6d0beb506.tar.gz zsh-9d7298bac8c9c8930fa69e4bffa75fb6d0beb506.tar.xz zsh-9d7298bac8c9c8930fa69e4bffa75fb6d0beb506.zip |
25521: get merge strategies from git merge in case the administrator has added custom strategies.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Unix/Command/_git | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog index 6da23d08e..475539651 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-24 Clint Adams <clint@zsh.org> + + * 25521: Completion/Unix/Command/_git: get merge strategies from + git merge in case the administrator has added custom strategies. + 2008-08-22 Peter Stephenson <pws@csr.com> * 25508: Src/exec.c: set file name if function came from diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index a6e75c64a..25bc968b5 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -4039,12 +4039,14 @@ __git_gpg_secret_keys () { (( $+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. |