Re: [PATCH v2 2/2] completion: checkout: complete paths when ref given
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Feb 15, 2017, 14:26 UTC
- Message-ID
- <CAM0VKjkUu2k73+PxZ2UNKrnBg0nW_za+10O7eHEgcko6BaGx6Q@mail.gmail.com>
- In-Reply-To
- <20170214212404.31469-2-cornelius.weig@tngtech.com>
On Tue, Feb 14, 2017 at 10:24 PM, <cornelius.weig@tngtech.com> 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<TAB> 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<TAB> contrib/coccinelle/ contrib/completion/ contrib/contacts/ contrib/convert-grafts-to-replace-refs.sh
See the difference?
I once made a feeble attempt to make completion of the <ref>:<path> notation (i.e. what you extracted into __git_complete_tree_file()) look like regular filename completion, but couldn't.
Gábor