File tree Expand file tree Collapse file tree 1 file changed +8
-28
lines changed
Expand file tree Collapse file tree 1 file changed +8
-28
lines changed Original file line number Diff line number Diff line change @@ -101,31 +101,12 @@ __gitex_author_names() {
101101 _wanted author-names expl author-name compadd $* - $author_names
102102}
103103
104- __gitex_author_emails2 () {
105- echo " $g s"
106- # read -Ac words
107- # read -cn cword
108-
109- local expl
110- declare -a author_names=($state )
111-
112- local name=" ${words[2]} " # name of the author supplied on the command line
113- local -a authors=(" ${(f)$(git authors --list)} " )
114- for line in " ${authors[@]} " ; do
115- if [ " ${line% * } " = " $name " ]; then
116- local email=${line#* <}
117- email=${email% >* }
118-
119- author_names+=(" ${email#* } " )
120- fi
121- done
122-
123- # _wanted author-names expl author-name compadd $* - $author_names
124- reply=(a b c)
125- }
126-
127104__gitex_author_emails () {
128- compctl -K __gitex_author_emails2
105+ local expl
106+ declare -a author_names
107+ author_names=(${(f)" $( _call_program branchrefs git log --format=' %aE' | sort -u) " } )
108+ __gitex_command_successful || return
109+ _wanted author-names expl author-name compadd $* - $author_names
129110}
130111
131112# subcommands
@@ -148,10 +129,9 @@ _git-clear() {
148129}
149130
150131_git-coauthor () {
151- compctl -K __gitex_author_emails2 a
152- # _arguments \
153- # ':co-author[co-author to add]:__gitex_author_names' \
154- # ':co-author-email[email address of co-author to add]:__gitex_author_emails'
132+ _arguments \
133+ ' :co-author[co-author to add]:__gitex_author_names' \
134+ ' :co-author-email[email address of co-author to add]:__gitex_author_emails'
155135}
156136
157137_git-contrib () {
You can’t perform that action at this time.
0 commit comments