* [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.
@ 2007-02-04 7:38 Shawn O. Pearce
2007-02-04 10:27 ` Jakub Narebski
0 siblings, 1 reply; 6+ messages in thread
From: Shawn O. Pearce @ 2007-02-04 7:38 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
The short options (-l, -f, -d) for git-branch are rather silly to
include in the completion generation as these options must be fully
typed out by the user and most users already know what the options
are anyway, so including them in the suggested completions does
not offer huge value. (The same goes for git-checkout and git-diff.)
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
contrib/completion/git-completion.bash | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 83c69ec..971fefb 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -359,7 +359,7 @@ _git_apply ()
_git_branch ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
- COMPREPLY=($(compgen -W "-l -f -d -D $(__git_refs)" -- "$cur"))
+ COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
}
_git_cat_file ()
@@ -381,7 +381,7 @@ _git_cat_file ()
_git_checkout ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
- COMPREPLY=($(compgen -W "-l -b $(__git_refs)" -- "$cur"))
+ COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
}
_git_cherry_pick ()
@@ -421,7 +421,7 @@ _git_diff ()
_git_diff_tree ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
- COMPREPLY=($(compgen -W "-r -p -M $(__git_refs)" -- "$cur"))
+ COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
}
_git_fetch ()
--
1.5.0.rc3.22.g5057
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.
2007-02-04 7:38 [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff Shawn O. Pearce
@ 2007-02-04 10:27 ` Jakub Narebski
2007-02-04 10:49 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Narebski @ 2007-02-04 10:27 UTC (permalink / raw)
To: git
[Cc: git@vger.kernel.org]
Shawn O. Pearce wrote:
> The short options (-l, -f, -d) for git-branch are rather silly to
> include in the completion generation as these options must be fully
> typed out by the user and most users already know what the options
> are anyway, so including them in the suggested completions does
> not offer huge value. (The same goes for git-checkout and git-diff.)
Not true. It is nice to have on "git branch -" TAB TAB list of all
(well, all included in completion) short options to git-branch.
So I'd vote NAK.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.
2007-02-04 10:27 ` Jakub Narebski
@ 2007-02-04 10:49 ` Junio C Hamano
2007-02-05 2:47 ` Shawn O. Pearce
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2007-02-04 10:49 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git, Shawn O. Pearce
Jakub Narebski <jnareb@gmail.com> writes:
> [Cc: git@vger.kernel.org]
>
> Shawn O. Pearce wrote:
>
>> The short options (-l, -f, -d) for git-branch are rather silly to
>> include in the completion generation as these options must be fully
>> typed out by the user and most users already know what the options
>> are anyway, so including them in the suggested completions does
>> not offer huge value. (The same goes for git-checkout and git-diff.)
>
> Not true. It is nice to have on "git branch -" TAB TAB list of all
> (well, all included in completion) short options to git-branch.
>
> So I'd vote NAK.
Ah, sorry, but it's already done.
I tried "git branch <TAB>" and saw hundreds of possibilities
offered, and thought mixing -d/-l and friends are useless. I
didn't think of the possibility of saying "git branch -<TAB>".
Presumably it was trying to suggest the <start-point> argument
but that does not make much sense actually either.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.
2007-02-04 10:49 ` Junio C Hamano
@ 2007-02-05 2:47 ` Shawn O. Pearce
2007-02-05 9:16 ` Jakub Narebski
0 siblings, 1 reply; 6+ messages in thread
From: Shawn O. Pearce @ 2007-02-05 2:47 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jakub Narebski, git
Junio C Hamano <junkio@cox.net> wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
> > Shawn O. Pearce wrote:
> >> The short options (-l, -f, -d) for git-branch are rather silly to
> >> include in the completion generation as these options must be fully
> >> typed out by the user and most users already know what the options
> >> are anyway, so including them in the suggested completions does
> >> not offer huge value. (The same goes for git-checkout and git-diff.)
> >
> > Not true. It is nice to have on "git branch -" TAB TAB list of all
> > (well, all included in completion) short options to git-branch.
> >
> > So I'd vote NAK.
>
> Ah, sorry, but it's already done.
>
> I tried "git branch <TAB>" and saw hundreds of possibilities
> offered, and thought mixing -d/-l and friends are useless. I
> didn't think of the possibility of saying "git branch -<TAB>".
>
> Presumably it was trying to suggest the <start-point> argument
> but that does not make much sense actually either.
Yeah. The completion behind git-branch is pretty stupid. Completing
the first argument from the existing set of branch names is stupid,
unless we are using -m/-M/-d/-D/-f, as we'd otherwise refuse to do
the operation. But we certainly do want completion on the second
argument.
I could be smarter about it and scan backwards looking for the mode
in use and control completion based on that, but its just weird.
Besides, I sometimes like completing the new branch name from the
existing set, as often I want to make the new branch name using
a leading prefix of another existing name. Completing part of it
saves a few keystrokes.
Completing single character options is rather useless in my mind.
The bash completion is always out of date with respect to the
actual set of supported options, and by definition they are a
single character. Hitting '-<tab><tab>' to identify the list of
supported options gives *no* detail about what the options do,
and I still have to enter the option letter to complete it.
Completing `git am --w<tab>hitespace=s<tab>trip ` with just 6
keystrokes on the other hand is very informative (whitespace,
strip!) and saves many keystrokes. That's why long options are
supported, for at least the more commonly accessed ones.
--
Shawn.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.
2007-02-05 2:47 ` Shawn O. Pearce
@ 2007-02-05 9:16 ` Jakub Narebski
2007-02-05 9:19 ` Shawn O. Pearce
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Narebski @ 2007-02-05 9:16 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Junio C Hamano, git
Shawn O. Pearce wrote:
> Completing single character options is rather useless in my mind.
> The bash completion is always out of date with respect to the
> actual set of supported options, and by definition they are a
> single character. Hitting '-<tab><tab>' to identify the list of
> supported options gives *no* detail about what the options do,
> and I still have to enter the option letter to complete it.
>
> Completing `git am --w<tab>hitespace=s<tab>trip ` with just 6
> keystrokes on the other hand is very informative (whitespace,
> strip!) and saves many keystrokes. That's why long options are
> supported, for at least the more commonly accessed ones.
It would be nice to have long option for each git command single
character (short) option, for example --patch as long option to
git-diff-tree -p option, etc.
--
Jakub Narebski
Poland
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.
2007-02-05 9:16 ` Jakub Narebski
@ 2007-02-05 9:19 ` Shawn O. Pearce
0 siblings, 0 replies; 6+ messages in thread
From: Shawn O. Pearce @ 2007-02-05 9:19 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Junio C Hamano, git
Jakub Narebski <jnareb@gmail.com> wrote:
> It would be nice to have long option for each git command single
> character (short) option, for example --patch as long option to
> git-diff-tree -p option, etc.
Sure. And I'd support them when possible in the bash completion.
But I think that sort of change to git should wait for a real
command line option parser. What we have now makes things a
tad painful.
--
Shawn.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-02-05 9:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-04 7:38 [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff Shawn O. Pearce
2007-02-04 10:27 ` Jakub Narebski
2007-02-04 10:49 ` Junio C Hamano
2007-02-05 2:47 ` Shawn O. Pearce
2007-02-05 9:16 ` Jakub Narebski
2007-02-05 9:19 ` Shawn O. Pearce
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).