Re: [PATCH] Speed up bash completion loading

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stephen Boyd
Date: Friday, November 13, 2009 - 1:43 pm

Jonathan Nieder wrote:
[...]

I was under the impression that setting variables during completion 
meant they were lost at the end of the completion cycle. So to be safe I 
put a 'sleep 5' in __git_list_porcelain_commands() and it only stalled 
me once :-)

I see a small problem, but it can be fixed in another patch. git merge 
-s <TAB><TAB> the first time when you're not in a git directory will 
make git merge -s <TAB><TAB> after never complete correctly even in a 
git directory. I guess this become more serious if git isn't in your 
path initially and you do git <TAB><TAB> and then git becomes part of 
your path and you try again. Here you lose porcelain completion. This is 
probably never going to happen though, right?

Plus it seems that __git_all_commands is computed twice if I git 
<TAB><TAB> and then git help <TAB><TAB> after. Can that be avoided?

Squashing this on top fixes the two typos you mentioned.

---->8----

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 7088ec7..6817953 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1082,7 +1082,7 @@ _git_help ()
                ;;
        esac
        __git_compute_all_commands
-       __gitcomp "__git_all_commands
+       __gitcomp "$__git_all_commands
                attributes cli core-tutorial cvs-migration
                diffcore gitk glossary hooks ignore modules
                repository-layout tutorial tutorial-2
@@ -1541,7 +1541,7 @@ _git_config ()
                local pfx="${cur%.*}."
                cur="${cur#*.}"
                __git_compute_all_commands
-               __gitcomp "__git_all_commands" "$pfx" "$cur"
+               __gitcomp "$__git_all_commands" "$pfx" "$cur"
                return
                ;;
        remote.*.*)


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
excerpts from tomorrow's &quot;What's cooking&quot; draft, Junio C Hamano, (Wed Nov 11, 2:34 am)
Re: excerpts from tomorrow's &quot;What's cooking&quot; draft, Sverre Rabbelier, (Wed Nov 11, 10:57 am)
Re: excerpts from tomorrow's &quot;What's cooking&quot; draft, Nicolas Sebrecht, (Wed Nov 11, 11:42 am)
Re: excerpts from tomorrow's &quot;What's cooking&quot; draft, Daniel Barkalow, (Wed Nov 11, 11:45 am)
Re: excerpts from tomorrow's &quot;What's cooking&quot; draft, Nicolas Sebrecht, (Wed Nov 11, 2:26 pm)
ks/precompute-completion, Jonathan Nieder, (Wed Nov 11, 3:08 pm)
[PATCH] give priority to progress messages, Nicolas Pitre, (Wed Nov 11, 3:24 pm)
Re: ks/precompute-completion, Stephen Boyd, (Thu Nov 12, 11:40 pm)
Re: ks/precompute-completion, Jonathan Nieder, (Fri Nov 13, 12:06 am)
Re: ks/precompute-completion, Stephen Boyd, (Fri Nov 13, 12:12 am)
[PATCH] Speed up bash completion loading, Jonathan Nieder, (Fri Nov 13, 1:50 am)
Re: [PATCH] Speed up bash completion loading, Jonathan Nieder, (Fri Nov 13, 2:03 am)
Re: [PATCH] Speed up bash completion loading, Jonathan Nieder, (Fri Nov 13, 3:29 am)
Re: [PATCH] Speed up bash completion loading, Stephen Boyd, (Fri Nov 13, 1:43 pm)
Re: [PATCH] Speed up bash completion loading, Jonathan Nieder, (Sat Nov 14, 3:35 am)
Re: [PATCH] Speed up bash completion loading, Jonathan Nieder, (Sat Nov 14, 4:01 am)
Re: [PATCH] Speed up bash completion loading, SZEDER =?iso-8859-1? ..., (Sat Nov 14, 7:43 am)
Re: [PATCH] Speed up bash completion loading, Jonathan Nieder, (Sat Nov 14, 12:33 pm)
Re: [PATCH] Speed up bash completion loading, Stephen Boyd, (Sat Nov 14, 4:46 pm)
Re: excerpts from tomorrow's &quot;What's cooking&quot; draft, Sverre Rabbelier, (Sat Nov 14, 7:07 pm)
Re: [PATCH] Speed up bash completion loading, Jonathan Nieder, (Sat Nov 14, 11:50 pm)
Re: [PATCH] Speed up bash completion loading, Junio C Hamano, (Sun Nov 15, 2:05 am)
[PATCH v2] Speed up bash completion loading, Jonathan Nieder, (Sun Nov 15, 3:29 am)
Re: [PATCH v2] Speed up bash completion loading, Shawn O. Pearce, (Sun Nov 15, 6:55 pm)
Re: [PATCH v2] Speed up bash completion loading, Stephen Boyd, (Mon Nov 16, 1:28 am)
[PATCH v3] Speed up bash completion loading, Jonathan Nieder, (Tue Nov 17, 5:49 pm)
Re: [PATCH v3] Speed up bash completion loading, Shawn O. Pearce, (Tue Nov 17, 5:59 pm)