Shawn O. Pearce wrote:I beat you to it ;-) This works just fine for me regardless of whether or not I have a colon in COMP_WORDBREAKS. --%<--%<--%<-- From: Andreas Ericsson <ae@op5.se> Subject: git-completion.bash: Handle "rev:path" completion properly The gvfs package on at least Fedora9 installs its own bash completion script which removes the colon from COMP_WORDBREAKS, which acts as a list of characters where bash should consider as word boundaries. Doing so breaks the git bash completion script when handling any rev:path style argument. This patch fixes it by prepending the "rev" part and the colon (which otherwise gets lost) before adding the "path" part if COMP_WORDBREAKS doesn't contain the colon we would otherwise need. Also fixes a nearby indented-with-spaces issue. Spotted-by: Linus Torvalds <torvalds@linux-foundation.org> Investigated-by: Björn Steinbrink <b.steinbrink@gmx.de> Signed-off-by: Andreas Ericsson <ae@op5.se> --- contrib/completion/git-completion.bash | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index d268e6f..e138022 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -293,7 +293,11 @@ __git_complete_file () *) ls="$ref" ;; - esac + esac + # When completing something like 'rev:path', bash behaves + # differently whether or not COMP_WORDBREAKS contains a + # colon or not. This lets it handle both cases + test "${COMP_WORDBREAKS//:}" = "$COMP_WORDBREAKS" && pfx="$ref:$pfx" COMPREPLY=($(compgen -P "$pfx" \ -W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \ | sed '/^100... blob /s,^.* ,, -- 1.5.6.3.315.g10ce0 -- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 -- 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
| Ingo Molnar | [patch 02/13] syslets: add syslet.h include file, user API/ABI definitions |
| Heiko Carstens | Re: 2.6.25-rc6-git6: Reported regressions from 2.6.24 |
| Greg Kroah-Hartman | [PATCH 010/196] Chinese: add translation of Codingstyle |
| Rafael J. Wysocki | [Bug #10629] 2.6.26-rc1-$sha1: RIP __d_lookup+0x8c/0x160 |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Linus Torvalds | Re: [GIT]: Networking |
| Mark Lord | Re: [BUG] New Kernel Bugs |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
