Re: [completion] Request: Include remote heads as push targets
- From
Peter van der Does <peter@avirtualhome.com>
- Date
- Oct 22, 2010, 01:08 UTC
- Message-ID
- <20101021210842.6545a661@montecarlo.grandprix.int>
- In-Reply-To
- <20101021191045.GC11759@burratino>
On Thu, 21 Oct 2010 14:10:45 -0500 Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 11 quoted lines
> Marc Branchaud wrote: > > > Hmmm, perhaps this is really a bug. > > Compare: > http://thread.gmane.org/gmane.comp.version-control.git/159448 > > Gábor, would it be possible to summarize the problem with a simple > test case that could be used to get help on this from the (upstream > or distro-specific) bash maintainers? > --
In the case of Marc's problem, it would be helpful to see what the result is in Bash 3.
As for Gábor find: The problem resides in Bash 4. Bash 4 has a new set of characters that are defined as break up characters Thanks to Brain Gernhard: From the Bash 4.0 changelog: i. The programmable completion code now uses the same set of characters as readline when breaking the command line into a list of words.
As far as I can tell, from the Bash 4.0 source, these are the characters: " \t\n\"'@><=;|&(:" In the completion script checks are performed if an option is given. The test includes the equal sign but the array with words does not the equal sign. Example to clarify:
local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
case "$cur" in
--whitespace=*)
__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
return
;;If you execute: $ git am --whitespace=<tab><tab>
The variable cur holds the equal sign and so the __gitcomp function is never executed.
I have patched the entire completion script which fixes this, and some other issues related to the Bash 4 change, but it will only work in Bash 4.0 and I am sure it will dramatically fail in Bash 3.0. I don't have the knowledge to determine which Bash version is running in the git.spec.in file. If you could that would be a way to either install the new version or the old one.
-- Peter van der Does GPG key: E77E8E98 IRC: Ganseki on irc.freenode.net Twitter: @petervanderdoes WordPress Plugin Developer Blog: http://blog.avirtualhome.com Forums: http://forums.avirtualhome.com Twitter: @avhsoftware