{"thread":{"id":"6700","subject":"[PATCH 3/6] bash: Offer --prune completion for git-gc.","startedAt":"2007-02-05T20:44:28Z","lastAt":"2007-02-05T20:44:28Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"33664","messageId":"20070205204428.GC8824@spearce.org","threadId":"6700","inReplyTo":null,"subject":"[PATCH 3/6] bash: Offer --prune completion for git-gc.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-05T20:44:28Z","receivedAt":"2007-02-05T20:44:28Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"I'm lazy.  I don't want to type out --prune if bash can do it for\nme with --<tab>.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex c4d433f..dcf5e4b 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -508,6 +508,18 @@ _git_format_patch ()\n \t__git_complete_revlist\n }\n \n+_git_gc ()\n+{\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp \"--prune\"\n+\t\treturn\n+\t\t;;\n+\tesac\n+\tCOMPREPLY=()\n+}\n+\n _git_ls_remote ()\n {\n \t__gitcomp \"$(__git_remotes)\"\n@@ -907,6 +919,7 @@ _git ()\n \tdiff-tree)   _git_diff_tree ;;\n \tfetch)       _git_fetch ;;\n \tformat-patch) _git_format_patch ;;\n+\tgc)          _git_gc ;;\n \tlog)         _git_log ;;\n \tls-remote)   _git_ls_remote ;;\n \tls-tree)     _git_ls_tree ;;\n@@ -950,6 +963,7 @@ complete -o default -o nospace -F _git_diff git-diff\n complete -o default -o nospace -F _git_diff_tree git-diff-tree\n complete -o default -o nospace -F _git_fetch git-fetch\n complete -o default -o nospace -F _git_format_patch git-format-patch\n+complete -o default -o nospace -F _git_gc git-gc\n complete -o default -o nospace -F _git_log git-log\n complete -o default -o nospace -F _git_ls_remote git-ls-remote\n complete -o default -o nospace -F _git_ls_tree git-ls-tree\n-- \n1.5.0.rc3.58.g79812\n"}]}