{"thread":{"id":"18690","subject":"[PATCH] bash completion: add git-difftool","startedAt":"2009-04-02T11:30:57Z","lastAt":"2009-04-05T19:43:23Z","messageCount":2,"participants":["David Aguilar","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"110208","messageId":"1238671857-8811-1-git-send-email-davvid@gmail.com","threadId":"18690","inReplyTo":null,"subject":"[PATCH] bash completion: add git-difftool","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2009-04-02T11:30:57Z","receivedAt":"2009-04-02T11:30:57Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"This adds completion for difftool's --tool flag.\nThe known diff tool names were also consolidated into\na single variable.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n contrib/completion/git-completion.bash |   27 ++++++++++++++++++++++-----\n 1 files changed, 22 insertions(+), 5 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 4fcd77a..33a8ec7 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -909,6 +909,26 @@ _git_diff ()\n \t__git_complete_file\n }\n \n+__git_mergetools_common=\"diffuse ecmerge emerge kdiff3 meld opendiff\n+\t\t\ttkdiff vimdiff gvimdiff xxdiff\n+\"\n+\n+_git_difftool ()\n+{\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--tool=*)\n+\t\t__gitcomp \"$__git_mergetools_common kompare\" \"\" \"${cur##--tool=}\"\n+\t\treturn\n+\t\t;;\n+\t--*)\n+\t\t__gitcomp \"--tool=\"\n+\t\treturn\n+\t\t;;\n+\tesac\n+\tCOMPREPLY=()\n+}\n+\n __git_fetch_options=\"\n \t--quiet --verbose --append --upload-pack --force --keep --depth=\n \t--tags --no-tags\n@@ -1171,11 +1191,7 @@ _git_mergetool ()\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n \tcase \"$cur\" in\n \t--tool=*)\n-\t\t__gitcomp \"\n-\t\t\tkdiff3 tkdiff meld xxdiff emerge\n-\t\t\tvimdiff gvimdiff ecmerge diffuse\n-\t\t\topendiff\n-\t\t\t\" \"\" \"${cur##--tool=}\"\n+\t\t__gitcomp \"$__git_mergetools_common\" \"\" \"${cur##--tool=}\"\n \t\treturn\n \t\t;;\n \t--*)\n@@ -1900,6 +1916,7 @@ _git ()\n \tconfig)      _git_config ;;\n \tdescribe)    _git_describe ;;\n \tdiff)        _git_diff ;;\n+\tdifftool)    _git_difftool;;\n \tfetch)       _git_fetch ;;\n \tformat-patch) _git_format_patch ;;\n \tfsck)        _git_fsck ;;\n-- \n1.6.2.1.469.gdffc1\n"},{"id":"110439","messageId":"20090405194323.GM23521@spearce.org","threadId":"18690","inReplyTo":"1238671857-8811-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH] bash completion: add git-difftool","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-04-05T19:43:23Z","receivedAt":"2009-04-05T19:43:23Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"David Aguilar <davvid@gmail.com> wrote:\n> This adds completion for difftool's --tool flag.\n> The known diff tool names were also consolidated into\n> a single variable.\n\nLooks good to me.  I see Junio has it slated in pu currently.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n \n-- \nShawn.\n"}]}