@matheusbsbs / matheus-bagliano / commits / f2bb9f8880
Fork 0

Hide plumbing/transport commands from bash completion.

Users generally are not going to need to invoke plumbing-level commands from within one line shell commands. If they are invoking these commands then it is likely that they are glueing them together into a shell script to perform an action, in which case bash completion for these commands is of relatively little use. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Shawn O. Pearce committed Nov 27, 2006 at 03:41 UTC f2bb9f88805f370b9de1c116f42e3ceb30321c80
1 file changed +57 -5
contrib/completion/git-completion.bash
+57 -5
@@ -125,6 +125,58 @@ __git_complete_file ()
125 esac
126 }
127
128 +__git_commands ()
129 +{
130 + local i IFS=" "$'\n'
131 + for i in $(git help -a|egrep '^ ')
132 + do
133 + case $i in
134 + check-ref-format) : plumbing;;
135 + commit-tree) : plumbing;;
136 + convert-objects) : plumbing;;
137 + cvsserver) : daemon;;
138 + daemon) : daemon;;
139 + fetch-pack) : plumbing;;
140 + hash-object) : plumbing;;
141 + http-*) : transport;;
142 + index-pack) : plumbing;;
143 + local-fetch) : plumbing;;
144 + mailinfo) : plumbing;;
145 + mailsplit) : plumbing;;
146 + merge-*) : plumbing;;
147 + mktree) : plumbing;;
148 + mktag) : plumbing;;
149 + pack-objects) : plumbing;;
150 + pack-redundant) : plumbing;;
151 + pack-refs) : plumbing;;
152 + parse-remote) : plumbing;;
153 + patch-id) : plumbing;;
154 + peek-remote) : plumbing;;
155 + read-tree) : plumbing;;
156 + receive-pack) : plumbing;;
157 + rerere) : plumbing;;
158 + rev-list) : plumbing;;
159 + rev-parse) : plumbing;;
160 + runstatus) : plumbing;;
161 + sh-setup) : internal;;
162 + shell) : daemon;;
163 + send-pack) : plumbing;;
164 + show-index) : plumbing;;
165 + ssh-*) : transport;;
166 + stripspace) : plumbing;;
167 + symbolic-ref) : plumbing;;
168 + unpack-file) : plumbing;;
169 + unpack-objects) : plumbing;;
170 + update-ref) : plumbing;;
171 + update-server-info) : daemon;;
172 + upload-archive) : plumbing;;
173 + upload-pack) : plumbing;;
174 + write-tree) : plumbing;;
175 + *) echo $i;;
176 + esac
177 + done
178 +}
179 +
180 __git_aliases ()
181 {
182 local i IFS=$'\n'
@@ -355,11 +407,11 @@ _git ()
407 done
408
409 if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
358 - COMPREPLY=($(compgen \
359 - -W "--git-dir= --version \
360 - $(git help -a|egrep '^ ') \
361 - $(__git_aliases)" \
362 - -- "${COMP_WORDS[COMP_CWORD]}"))
410 + COMPREPLY=($(compgen -W "
411 + --git-dir= --version --exec-path
412 + $(__git_commands)
413 + $(__git_aliases)
414 + " -- "${COMP_WORDS[COMP_CWORD]}"))
415 return;
416 fi
417