Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.

From: Shawn O. Pearce <spearce@spearce.org>
Date: 2007-02-05 13:47:04
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.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Feb 05 13:51:16 2007

This archive was generated by hypermail 2.1.8 : 2007-02-05 13:53:04 EST