{"thread":{"id":"28382","subject":"[PATCH/RFC] bash: add --word-diff option to diff auto-completion","startedAt":"2011-09-13T19:14:48Z","lastAt":"2011-09-16T20:47:22Z","messageCount":5,"participants":["Jonathan Nieder","SZEDER Gábor","Rodrigo Rosenfeld Rosas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"175418","messageId":"20110913191448.GC14917@elie","threadId":"28382","inReplyTo":"4E6FA541.7000100@yahoo.com.br","subject":"[PATCH/RFC] bash: add --word-diff option to diff auto-completion","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-09-13T19:14:48Z","receivedAt":"2011-09-13T19:14:48Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>\nDate: Tue, 13 Sep 2011 15:24:38 -0300\n\nAdd \"--word-diff\" to diff completion, since this is a common\ndesired option when looking at diffs.\n\nSigned-off-by: Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>\n---\nHi Gábor,\n\nHere's a patch.  What do you think?\n\nI was thinking it would be nice to complete --word-diff-regex, too,\nand to be able to do\n\n\tgit diff --color-words=<TAB>\n\tgit diff --word-diff=<TAB>\n\nbut I couldn't find any examples of the latter to crib from, so I've\nleft the patch unmangled except for stealing a patch description from\na separate email.\n\nRodrigo Rosenfeld Rosas wrote:\n\n> I use Thunderbird, but couldn't find all options as instructed in 'git help\n> format-patch'.\n\nIndeed, sending patches unmangled seems to be a common difficult step\nwhen starting to contribute to projects like linux and git.  I wonder\nif it would make sense to include some sort of\npatch-sending-reviewing-tweaking-and-receiving tutorial to point to in\nthe documentation.\n\nThanks for keeping the completion code in good shape.\nJonathan\n\n contrib/completion/git-completion.bash |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 8648a36..f4aaffe 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1300,7 +1300,7 @@ _git_describe ()\n \n __git_diff_common_options=\"--stat --numstat --shortstat --summary\n \t\t\t--patch-with-stat --name-only --name-status --color\n-\t\t\t--no-color --color-words --no-renames --check\n+\t\t\t--no-color --color-words --word-diff --no-renames --check\n \t\t\t--full-index --binary --abbrev --diff-filter=\n \t\t\t--find-copies-harder\n \t\t\t--text --ignore-space-at-eol --ignore-space-change\n-- \n1.7.5.4\n"},{"id":"175440","messageId":"20110913232941.GC2078@goldbirke","threadId":"28382","inReplyTo":"20110913191448.GC14917@elie","subject":"Re: [PATCH/RFC] bash: add --word-diff option to diff auto-completion","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2011-09-13T23:29:41Z","receivedAt":"2011-09-13T23:29:41Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\n\nOn Tue, Sep 13, 2011 at 02:14:48PM -0500, Jonathan Nieder wrote:\n> From: Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>\n> Date: Tue, 13 Sep 2011 15:24:38 -0300\n> \n> Add \"--word-diff\" to diff completion, since this is a common\n> desired option when looking at diffs.\n> \n> Signed-off-by: Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>\n> ---\n> Hi Gábor,\n> \n> Here's a patch.  What do you think?\n\nLooks obviously good to me, ...\n\n> I was thinking it would be nice to complete --word-diff-regex, too,\n> and to be able to do\n> \n> \tgit diff --color-words=<TAB>\n> \tgit diff --word-diff=<TAB>\n\n... but yeah, there is room for while-at-its ;)\n\nThe completion script currently only offers --color-words but not\n--color-words=.  This is sort of OK, because --color-words' parameters\nare optional.  However, in several cases the completion script offers\nboth --option and --option= to indicate that it takes an optional\nparameter, see e.g.\n\n  diff --dirstat --dirstat-by-file\n  commit --untracked-files\n  format-patch --thread\n  init --shared\n  log --decorate\n\n(But we don't do this in all such cases, see e.g. diff --stat --color\nor log --branches --tags --remotes.)\n\nSo I think it's fine to offer both --color-words and --color-words=,\nand both --word-diff and --word-diff=.\n\n> but I couldn't find any examples of the latter to crib from\n\nI'm not sure what you mean by git diff --color-words=<TAB>, because it\ntakes a regexp.  Or is it just too late here and I'm missing something\nobvious?\n\nCompleting the mode for --word-diff=<TAB> is a good idea, but c'mon,\nthere are plenty of examples ;)  Have a look at _git_am(),\n_git_format_patch(), or _git_init() for something easy, and\n_git_commit(), _git_log(), or _git_notes() for something fancy.\n\nNote that --word-diff= is also valid for log and shortlog, so the same\ncan be done there, too.\n\n\nBest,\nGábor\n"},{"id":"175441","messageId":"20110913233712.GE2078@goldbirke","threadId":"28382","inReplyTo":"20110913232941.GC2078@goldbirke","subject":"Re: [PATCH/RFC] bash: add --word-diff option to diff auto-completion","fromName":"SZEDER Gábor","fromEmail":"szeder@fzi.de","sentAt":"2011-09-13T23:37:12Z","receivedAt":"2011-09-13T23:37:12Z","isPatch":true,"sender":{"key":"szeder@fzi.de","avatar":null},"body":"On Wed, Sep 14, 2011 at 01:29:41AM +0200, SZEDER Gábor wrote:\n> Or is it just too late here and I'm missing something\n> obvious?\n> \n> Completing the mode for --word-diff=<TAB> is a good idea, but c'mon,\n> there are plenty of examples ;)  Have a look at _git_am(),\n> _git_format_patch(), or _git_init() for something easy, and\n> _git_commit(), _git_log(), or _git_notes() for something fancy.\n> \n> Note that --word-diff= is also valid for log and shortlog, so the same\n> can be done there, too.\n\nNot shortlog, show.  It's definitely too late... ;)\n"},{"id":"175647","messageId":"4E737199.1000107@yahoo.com.br","threadId":"28382","inReplyTo":"20110913233712.GE2078@goldbirke","subject":"Re: [PATCH/RFC] bash: add --word-diff option to diff [AND --set-upstream TO push] auto-completion","fromName":"Rodrigo Rosenfeld Rosas","fromEmail":"lbocseg@yahoo.com.br","sentAt":"2011-09-16T15:56:09Z","receivedAt":"2011-09-16T15:56:09Z","isPatch":true,"sender":{"key":"lbocseg@yahoo.com.br","avatar":null},"body":"While on the topic, it would also be interesting to add \"--set-upstream\" \nto \"git push\" autocompletion. Don't you agree?\n\nCheers, Rodrigo.\n\nEm 13-09-2011 20:37, SZEDER Gábor escreveu:\n> On Wed, Sep 14, 2011 at 01:29:41AM +0200, SZEDER Gábor wrote:\n>> Or is it just too late here and I'm missing something\n>> obvious?\n>>\n>> Completing the mode for --word-diff=<TAB>  is a good idea, but c'mon,\n>> there are plenty of examples ;)  Have a look at _git_am(),\n>> _git_format_patch(), or _git_init() for something easy, and\n>> _git_commit(), _git_log(), or _git_notes() for something fancy.\n>>\n>> Note that --word-diff= is also valid for log and shortlog, so the same\n>> can be done there, too.\n>\n> Not shortlog, show.  It's definitely too late... ;)\n>\n>\n"},{"id":"175666","messageId":"20110916204722.GD4683@elie","threadId":"28382","inReplyTo":"4E737199.1000107@yahoo.com.br","subject":"Re: [PATCH/RFC] bash: add --word-diff option to diff [AND --set-upstream TO push] auto-completion","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-09-16T20:47:22Z","receivedAt":"2011-09-16T20:47:22Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Rodrigo Rosenfeld Rosas wrote:\n\n> While on the topic, it would also be interesting to add \"--set-upstream\" to\n> \"git push\" autocompletion. Don't you agree?\n\nYes, of course.\n"}]}