{"thread":{"id":"6708","subject":"[PATCH 2/2] bash: Complete git-remote subcommands.","startedAt":"2007-02-06T02:37:58Z","lastAt":"2007-02-06T02:37:58Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"33685","messageId":"20070206023758.GB9922@spearce.org","threadId":"6708","inReplyTo":null,"subject":"[PATCH 2/2] bash: Complete git-remote subcommands.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-06T02:37:58Z","receivedAt":"2007-02-06T02:37:58Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Completing the 3 core subcommands to git-remote, along with the\nnames of remotes for 'show' and 'prune' (which take only existing\nremotes) is handy.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   28 ++++++++++++++++++++++++++++\n 1 files changed, 28 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex b0ff87d..eecdaa0 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -852,6 +852,32 @@ _git_config ()\n \t\"\n }\n \n+_git_remote ()\n+{\n+\tlocal i c=1 command\n+\twhile [ $c -lt $COMP_CWORD ]; do\n+\t\ti=\"${COMP_WORDS[c]}\"\n+\t\tcase \"$i\" in\n+\t\tadd|show|prune) command=\"$i\"; break ;;\n+\t\tesac\n+\t\tc=$((++c))\n+\tdone\n+\n+\tif [ $c -eq $COMP_CWORD -a -z \"$command\" ]; then\n+\t\t__gitcomp \"add show prune\"\n+\t\treturn\n+\tfi\n+\n+\tcase \"$command\" in\n+\tshow|prune)\n+\t\t__gitcomp \"$(__git_remotes)\"\n+\t\t;;\n+\t*)\n+\t\tCOMPREPLY=()\n+\t\t;;\n+\tesac\n+}\n+\n _git_reset ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n@@ -934,6 +960,7 @@ _git ()\n \tpull)        _git_pull ;;\n \tpush)        _git_push ;;\n \trebase)      _git_rebase ;;\n+\tremote)      _git_remote ;;\n \treset)       _git_reset ;;\n \tshow)        _git_show ;;\n \tshow-branch) _git_log ;;\n@@ -979,6 +1006,7 @@ complete -o default -o nospace -F _git_pull git-pull\n complete -o default -o nospace -F _git_push git-push\n complete -o default -o nospace -F _git_rebase git-rebase\n complete -o default -o nospace -F _git_config git-config\n+complete -o default -o nospace -F _git_remote git-remote\n complete -o default -o nospace -F _git_reset git-reset\n complete -o default -o nospace -F _git_show git-show\n complete -o default -o nospace -F _git_log git-show-branch\n-- \n1.5.0.rc3.58.g79812\n"}]}