Subject: [PATCH/RFC] bash: add --word-diff option to diff auto-completion

From: Jonathan Nieder <[email-masked]>
Date: Tue, 13 Sep 2011 14:14:48 -0500

From: Rodrigo Rosenfeld Rosas <[email-masked]>
Date: Tue, 13 Sep 2011 15:24:38 -0300

Add "--word-diff" to diff completion, since this is a common
desired option when looking at diffs.

Signed-off-by: Rodrigo Rosenfeld Rosas <[email-masked]>
---
Hi Gábor,

Here's a patch.  What do you think?

I was thinking it would be nice to complete --word-diff-regex, too,
and to be able to do

	git diff --color-words=<TAB>
	git diff --word-diff=<TAB>

but I couldn't find any examples of the latter to crib from, so I've
left the patch unmangled except for stealing a patch description from
a separate email.

Rodrigo Rosenfeld Rosas wrote:

> I use Thunderbird, but couldn't find all options as instructed in 'git help
> format-patch'.

Indeed, sending patches unmangled seems to be a common difficult step
when starting to contribute to projects like linux and git.  I wonder
if it would make sense to include some sort of
patch-sending-reviewing-tweaking-and-receiving tutorial to point to in
the documentation.

Thanks for keeping the completion code in good shape.
Jonathan

 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8648a36..f4aaffe 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1300,7 +1300,7 @@ _git_describe ()
 
 __git_diff_common_options="--stat --numstat --shortstat --summary
 			--patch-with-stat --name-only --name-status --color
-			--no-color --color-words --no-renames --check
+			--no-color --color-words --word-diff --no-renames --check
 			--full-index --binary --abbrev --diff-filter=
 			--find-copies-harder
 			--text --ignore-space-at-eol --ignore-space-change
-- 
1.7.5.4