{"thread":{"id":"43728","subject":"[PATCH 2/2] Added bash completion support for git-reset.","startedAt":"2006-11-04T18:57:44Z","lastAt":"2006-11-04T18:57:44Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"297418","messageId":"20061104185744.GB2500@spearce.org","threadId":"43728","inReplyTo":null,"subject":"[PATCH 2/2] Added bash completion support for git-reset.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-04T18:57:44Z","receivedAt":"2006-11-04T18:57:44Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Completion for the --hard/--soft/--mixed modes of operation as\nwell as a ref name for <commit-ish> can be very useful and save\nsome fingers.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex b7b8a43..a3fbb90 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -271,6 +271,13 @@ _git_push ()\n \tesac\n }\n \n+_git_reset ()\n+{\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tlocal opt=\"--mixed --hard --soft\"\n+\tCOMPREPLY=($(compgen -W \"$opt $(__git_refs .)\" -- \"$cur\"))\n+}\n+\n _git_show ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n@@ -304,6 +311,7 @@ _git ()\n \t\tls-tree)     _git_ls_tree ;;\n \t\tpull)        _git_pull ;;\n \t\tpush)        _git_push ;;\n+\t\treset)       _git_reset ;;\n \t\tshow)        _git_show ;;\n \t\tshow-branch) _git_log ;;\n \t\twhatchanged) _git_log ;;\n@@ -332,6 +340,7 @@ complete -o default -o nospace -F _git_l\n complete -o default            -F _git_merge_base git-merge-base\n 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            -F _git_reset git-reset\n complete -o default            -F _git_show git-show\n complete -o default -o nospace -F _git_log git-whatchanged\n \n-- \n"}]}