git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: Rodrigo Rosenfeld Rosas <lbocseg@yahoo.com.br>,
	Thomas Rast <trast@student.ethz.ch>,
	git@vger.kernel.org
Subject: [PATCH/RFC] bash: add --word-diff option to diff auto-completion
Date: Tue, 13 Sep 2011 14:14:48 -0500	[thread overview]
Message-ID: <20110913191448.GC14917@elie> (raw)
In-Reply-To: <4E6FA541.7000100@yahoo.com.br>

From: Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>
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 <rr.rosas@gmail.com>
---
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

       reply	other threads:[~2011-09-13 19:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4E6F720A.3020103@yahoo.com.br>
     [not found] ` <20110913165847.GB11076@elie>
     [not found]   ` <4E6FA541.7000100@yahoo.com.br>
2011-09-13 19:14     ` Jonathan Nieder [this message]
2011-09-13 23:29       ` [PATCH/RFC] bash: add --word-diff option to diff auto-completion SZEDER Gábor
2011-09-13 23:37         ` SZEDER Gábor
2011-09-16 15:56           ` [PATCH/RFC] bash: add --word-diff option to diff [AND --set-upstream TO push] auto-completion Rodrigo Rosenfeld Rosas
2011-09-16 20:47             ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110913191448.GC14917@elie \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lbocseg@yahoo.com.br \
    --cc=szeder@ira.uka.de \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).