From: Cornelius Weig Date: Wed, 15 Feb 2017 22:45:47 GMT Subject: Re: [PATCH v2 2/2] completion: checkout: complete paths when ref given Message-ID: <11424310-7f76-12fe-0e56-e585ccf06aea@tngtech.com> In-Reply-To: On 02/15/2017 03:26 PM, SZEDER Gábor wrote: > On Tue, Feb 14, 2017 at 10:24 PM, wrote: > >> + *) >> + __git_complete_tree_file "$ref" "$cur" >> + ;; > > There is one more caveat here. > > Both our __git_complete_index_file() and Bash's builtin filename > completion lists matching paths like this: > > $ git rm contrib/co > coccinelle/ contacts/ > completion/ convert-grafts-to-replace-refs.sh > > i.e. the leading path components are not redundantly repeated. > > Now, with this patch in this code path the list would look like this: > > $ git checkout completion-refs-speedup contrib/co > contrib/coccinelle/ > contrib/completion/ > contrib/contacts/ > contrib/convert-grafts-to-replace-refs.sh > > See the difference? Now that you say it.. I had never noticed it though. > I once made a feeble attempt to make completion of the : > notation (i.e. what you extracted into __git_complete_tree_file()) > look like regular filename completion, but couldn't. Can you dig up what you tried out? Maybe somebody comes up with a good idea.