{"thread":{"id":"26245","subject":"[PATCH/RFC] completion: support git blame","startedAt":"2011-01-09T16:38:39Z","lastAt":"2011-01-09T16:38:39Z","messageCount":1,"participants":["Martin von Zweigbergk"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"159246","messageId":"1294591119-19701-1-git-send-email-martin.von.zweigbergk@gmail.com","threadId":"26245","inReplyTo":null,"subject":"[PATCH/RFC] completion: support git blame","fromName":"Martin von Zweigbergk","fromEmail":"martin.von.zweigbergk@gmail.com","sentAt":"2011-01-09T16:38:39Z","receivedAt":"2011-01-09T16:38:39Z","isPatch":true,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"Add basic support for completion of refs with git blame.\n\nSigned-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>\n---\n\nMaybe leave --porcelain and --incremental out since they are intended\nfor scripts?\n\nblame is pretty uninteresting on untracked files. It would be nice if\nto only complete files that exist in the specified commit, just like\n'git show $rev:$file' does. I think this applies to some other\ncommands as well, like 'git checkout $rev [--] $file'. Has this been\ndiscussed before? I didn't find anything when searching the\narchives. I can imagine it might have been rejected because of\nperformance problems.\n\n\n contrib/completion/git-completion.bash |   20 ++++++++++++++++++++\n 1 files changed, 20 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 645549c..d9074ba 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1128,6 +1128,26 @@ _git_bisect ()\n \tesac\n }\n \n+_git_blame ()\n+{\n+\t__git_has_doubledash && return\n+\n+\tlocal cur\n+\t_get_comp_words_by_ref -n =: cur\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp \"\n+\t\t\t--root --show-stats --reverse --encoding=\n+\t\t\t--contents --date --score-debug --show-name\n+\t\t\t--show-number --show-email\n+\t\t\t\"\n+\t\t;;\n+\t*)\n+\t\t__gitcomp \"$(__git_refs)\"\n+\t\t;;\n+\tesac\n+}\n+\n _git_branch ()\n {\n \tlocal i c=1 only_local_ref=\"n\" has_r=\"n\" cur words cword\n-- \n1.7.3.2.864.gbbb96\n"}]}