* [PATCH/RFC] bash: add --word-diff option to diff auto-completion
[not found] ` <4E6FA541.7000100@yahoo.com.br>
@ 2011-09-13 19:14 ` Jonathan Nieder
2011-09-13 23:29 ` SZEDER Gábor
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Nieder @ 2011-09-13 19:14 UTC (permalink / raw)
To: SZEDER Gábor; +Cc: Rodrigo Rosenfeld Rosas, Thomas Rast, git
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH/RFC] bash: add --word-diff option to diff auto-completion
2011-09-13 19:14 ` [PATCH/RFC] bash: add --word-diff option to diff auto-completion Jonathan Nieder
@ 2011-09-13 23:29 ` SZEDER Gábor
2011-09-13 23:37 ` SZEDER Gábor
0 siblings, 1 reply; 5+ messages in thread
From: SZEDER Gábor @ 2011-09-13 23:29 UTC (permalink / raw)
To: Jonathan Nieder
Cc: SZEDER Gábor, Rodrigo Rosenfeld Rosas, Thomas Rast, git
Hi,
On Tue, Sep 13, 2011 at 02:14:48PM -0500, Jonathan Nieder wrote:
> 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?
Looks obviously good to me, ...
> 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 yeah, there is room for while-at-its ;)
The completion script currently only offers --color-words but not
--color-words=. This is sort of OK, because --color-words' parameters
are optional. However, in several cases the completion script offers
both --option and --option= to indicate that it takes an optional
parameter, see e.g.
diff --dirstat --dirstat-by-file
commit --untracked-files
format-patch --thread
init --shared
log --decorate
(But we don't do this in all such cases, see e.g. diff --stat --color
or log --branches --tags --remotes.)
So I think it's fine to offer both --color-words and --color-words=,
and both --word-diff and --word-diff=.
> but I couldn't find any examples of the latter to crib from
I'm not sure what you mean by git diff --color-words=<TAB>, because it
takes a regexp. Or is it just too late here and I'm missing something
obvious?
Completing the mode for --word-diff=<TAB> is a good idea, but c'mon,
there are plenty of examples ;) Have a look at _git_am(),
_git_format_patch(), or _git_init() for something easy, and
_git_commit(), _git_log(), or _git_notes() for something fancy.
Note that --word-diff= is also valid for log and shortlog, so the same
can be done there, too.
Best,
Gábor
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH/RFC] bash: add --word-diff option to diff auto-completion
2011-09-13 23:29 ` 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
0 siblings, 1 reply; 5+ messages in thread
From: SZEDER Gábor @ 2011-09-13 23:37 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Rodrigo Rosenfeld Rosas, Thomas Rast, git
On Wed, Sep 14, 2011 at 01:29:41AM +0200, SZEDER Gábor wrote:
> Or is it just too late here and I'm missing something
> obvious?
>
> Completing the mode for --word-diff=<TAB> is a good idea, but c'mon,
> there are plenty of examples ;) Have a look at _git_am(),
> _git_format_patch(), or _git_init() for something easy, and
> _git_commit(), _git_log(), or _git_notes() for something fancy.
>
> Note that --word-diff= is also valid for log and shortlog, so the same
> can be done there, too.
Not shortlog, show. It's definitely too late... ;)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH/RFC] bash: add --word-diff option to diff [AND --set-upstream TO push] auto-completion
2011-09-13 23:37 ` SZEDER Gábor
@ 2011-09-16 15:56 ` Rodrigo Rosenfeld Rosas
2011-09-16 20:47 ` Jonathan Nieder
0 siblings, 1 reply; 5+ messages in thread
From: Rodrigo Rosenfeld Rosas @ 2011-09-16 15:56 UTC (permalink / raw)
To: SZEDER Gábor; +Cc: Jonathan Nieder, Thomas Rast, git
While on the topic, it would also be interesting to add "--set-upstream"
to "git push" autocompletion. Don't you agree?
Cheers, Rodrigo.
Em 13-09-2011 20:37, SZEDER Gábor escreveu:
> On Wed, Sep 14, 2011 at 01:29:41AM +0200, SZEDER Gábor wrote:
>> Or is it just too late here and I'm missing something
>> obvious?
>>
>> Completing the mode for --word-diff=<TAB> is a good idea, but c'mon,
>> there are plenty of examples ;) Have a look at _git_am(),
>> _git_format_patch(), or _git_init() for something easy, and
>> _git_commit(), _git_log(), or _git_notes() for something fancy.
>>
>> Note that --word-diff= is also valid for log and shortlog, so the same
>> can be done there, too.
>
> Not shortlog, show. It's definitely too late... ;)
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH/RFC] bash: add --word-diff option to diff [AND --set-upstream TO push] auto-completion
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
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Nieder @ 2011-09-16 20:47 UTC (permalink / raw)
To: Rodrigo Rosenfeld Rosas; +Cc: SZEDER Gábor, Thomas Rast, git
Rodrigo Rosenfeld Rosas wrote:
> While on the topic, it would also be interesting to add "--set-upstream" to
> "git push" autocompletion. Don't you agree?
Yes, of course.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-09-16 20:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4E6F720A.3020103@yahoo.com.br>
[not found] ` <20110913165847.GB11076@elie>
[not found] ` <4E6FA541.7000100@yahoo.com.br>
2011-09-13 19:14 ` [PATCH/RFC] bash: add --word-diff option to diff auto-completion Jonathan Nieder
2011-09-13 23:29 ` 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
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).