Subject: Re: [PATCH] bash completion: Fix the . -> .. revision range completion

From: "Shawn O. Pearce" <[email-masked]>
Date: Tue, 15 Jul 2008 04:25:53 +0000

Linus Torvalds <[email-masked]> wrote:
> On Mon, 14 Jul 2008, Shawn O. Pearce wrote:
> > 
> > What is $COMP_WORDBREAKS set to in your shell?  In mine it
> > appears to be:
> > 
> > 	" \"'@><=;|&(:"
> 
> Ahhah. Indeed. I don't have the ':'.
...
> Umm, if so, git should just set it in the completion script, no?

OK, so it turns out not having : in COMP_WORDBREAKS is a very common
case that we should somehow deal with, to aid our users.

I'm concerned about just setting COMP_WORDBREAKS back to the default
in the git completion script because then we get into an ordering
game with the profile scripts, don't we?  If git completion sources
before the gvfs script we don't get our COMP_WORDBREAKS setting.

I think we may need to do two things.

If COMP_WORDBREAKS doesn't contain a :, try to reset it to include
one when the script is sourced.  This may "fix" git completion but
make gvfs completion act differently, resulting in a thread on the
gvfs lists.  ;-)

If COMP_WORDBREAKS doesn't contain : during a completion event than
we need to do what your original patch asked, which is to include
"$ref:" in the prefix, so the ref isn't lost.

At least we understand the problem now, finally.  I'll try to write
up a patch for it tomorrow.  Unfortunately packing to move has been
really sucking up my time lately.
 
-- 
Shawn.