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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, 14 Jul 2008, Shawn O. Pearce wrote:
> > > 
> > > Does it fix this one too:
> > > 
> > > 	git show origin/pu:Makef<tab>
> > > 
> > > which totally screws up and becomes
> > > 
> > > 	git show Makefile
> > > 
> > > dropping the version specifier?
> 
> What version of bash do you have?

GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)

> It definitely doesn't work for me with 
> 
> 	GNU bash, version 3.2.33(1)-release (x86_64-redhat-linux-gnu)

So between .17 and .33 they changed something.
 
> Something like this seems to be totally missing, and definitely required. 
> How can you say that it works for you? I don't see how that is possible 
> even in theory? Did you actually test it?

Yes, of course dammit, I did test it before writing an email that
said "I tested this ...".
 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 27332ed..0a87337 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -290,7 +290,7 @@ __git_complete_file ()
>  			ls="$ref"
>  			;;
>  	    esac
> -		COMPREPLY=($(compgen -P "$pfx" \
> +		COMPREPLY=($(compgen -P "$ref:$pfx" \
>  			-W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
>  				| sed '/^100... blob /s,^.*	,,
>  				       /^040000 tree /{

In bash 3.2.17 your change above causes completion to include the
ref name _twice_:

	git show jc/html:in<tab>
	git show jc/html:jc/html:index.html

This is not good news because it means we need to perform a version
test to identify the correct behavior we need for this shell, and
we also have to figure out what version of 3.2.X this changed in.
*sigh*

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux