aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-05-24 01:46:49 -0400
committerShawn O. Pearce <spearce@spearce.org>2007-05-24 01:46:49 -0400
commitfb72759b7de504f077250fd5bd557e3b9e2a5682 (patch)
tree9320c174a6c7cbc8a6d84127d99f55cc6887e434 /contrib
parentc70680ce7cec72a465468c223d43c08f5254d31f (diff)
downloadgit-fb72759b7de504f077250fd5bd557e3b9e2a5682.tar.gz
git-fb72759b7de504f077250fd5bd557e3b9e2a5682.tar.xz
Teach bash completion about 'git remote update'
Recently the git-remote command grew an update subcommand, which can be used to execute git-fetch across multiple repositories in a single step. These can be configured with the 'remotes.*' configuration options, so we can offer completion for any name that matches and appears to be useful to git-remote update. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/completion/git-completion.bash16
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 48ba3f8e8..d6252068c 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -877,13 +877,13 @@ _git_remote ()
while [ $c -lt $COMP_CWORD ]; do
i="${COMP_WORDS[c]}"
case "$i" in
- add|show|prune) command="$i"; break ;;
+ add|show|prune|update) command="$i"; break ;;
esac
c=$((++c))
done
if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
- __gitcomp "add show prune"
+ __gitcomp "add show prune update"
return
fi
@@ -891,6 +891,18 @@ _git_remote ()
show|prune)
__gitcomp "$(__git_remotes)"
;;
+ update)
+ local i c='' IFS=$'\n'
+ for i in $(git --git-dir="$(__gitdir)" config --list); do
+ case "$i" in
+ remotes.*)
+ i="${i#remotes.}"
+ c="$c ${i/=*/}"
+ ;;
+ esac
+ done
+ __gitcomp "$c"
+ ;;
*)
COMPREPLY=()
;;