* PATCH: _git and revision_arguments
@ 2007-09-30 19:18 Clint Adams
2007-10-01 7:21 ` Nikolai Weibull
0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2007-09-30 19:18 UTC (permalink / raw)
To: zsh-workers
This seems a slightly cleaner.
Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.34
diff -u -r1.34 _git
--- Completion/Unix/Command/_git 30 Sep 2007 18:43:08 -0000 1.34
+++ Completion/Unix/Command/_git 30 Sep 2007 19:17:07 -0000
@@ -15,6 +15,7 @@
local help_arg template_arg shared_arg thin_arg author_conversion_file_arg_spec
local -a diff_args fetch_args merge_args force_ref_arg tags_fetch_arg
local -a upload_pack_arg common_fetch_args common_apply_args
+local -a revision_arguments
nul_arg='-z[use NUL termination on output]'
abbrev_arg='--abbrev=-[set minimum SHA1 display-length]: :_guard "[[\:digit\:]]#" length'
@@ -976,8 +977,6 @@
_arguments \
'*:index file:__git_cached_files' && ret=0
else
- declare -a revision_arguments
-
__git_setup_revision_arguments
_arguments -S \
@@ -1011,8 +1010,6 @@
(( $+functions[_git-show] )) ||
_git-show () {
- declare -a revision_arguments
-
__git_setup_revision_arguments
_arguments -S \
@@ -1153,8 +1150,6 @@
# TODO: -- undocumented.
(( $+functions[_git-reflog] )) ||
_git-reflog () {
- declare -a revision_arguments
-
__git_setup_revision_arguments
if (( CURRENT == 2 )); then
@@ -1707,8 +1702,6 @@
(( $+functions[_git-log] )) ||
_git-log () {
- declare -a revision_arguments
-
__git_setup_revision_arguments
_arguments -S \
@@ -1854,8 +1847,6 @@
# less what git-rev-list takes).
(( $+functions[_git-shortlog] )) ||
_git-shortlog () {
- declare -a revision_arguments
-
__git_setup_revision_arguments
_arguments -S \
@@ -1906,8 +1897,6 @@
# TODO: This should take those arguments that git-diff-tree can take, as well.
(( $+functions[_git-whatchanged] )) ||
_git-whatchanged () {
- declare -a revision_arguments
-
__git_setup_revision_arguments
_arguments -S \
@@ -2442,8 +2431,6 @@
'--minimize[undocumented]')
;;
(log)
- declare -a revision_arguments
-
__git_setup_revision_arguments
arguments+=(
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: _git and revision_arguments
2007-09-30 19:18 PATCH: _git and revision_arguments Clint Adams
@ 2007-10-01 7:21 ` Nikolai Weibull
0 siblings, 0 replies; 2+ messages in thread
From: Nikolai Weibull @ 2007-10-01 7:21 UTC (permalink / raw)
To: zsh-workers
On 9/30/07, Clint Adams <clint@zsh.org> wrote:
> This seems a slightly cleaner.
> +local -a revision_arguments
Ideally __git_setup_revision_arguments would take an argument that
told it what variable to use. Making it harder to instigate such a
change doesn't make the code any cleaner. Also, this change wastes
memory, as revision_arguments will always be in scope, while not
saving any (real) execution time.
nikolai
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-01 7:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-30 19:18 PATCH: _git and revision_arguments Clint Adams
2007-10-01 7:21 ` Nikolai Weibull
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).