Re: [PATCH 0/2] completion of 'git [-C <dir>] checkout'
Junio C Hamano <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
Ben Knoble <[email protected]> writes: >> Le 11 août 2026 à 00:04, Junio C Hamano <[email protected]> a écrit : >> >> I did not, however, find any readily usable machinery in the >> 'git-completion.bash' script that allows completing a path within an >> arbitrary tree. If such machinery were available, 'git checkout >> other-branch foo<TAB>' could capture the output of 'git ls-tree -r >> other-branch' and offer paths that begin with the given prefix. >> >> Regardless, implementing this is beyond my 'git-completion-fu' right >> now. As I mentioned, I barely managed the 'diff' completion as a >> monkey-see-monkey-do patch series, and I would welcome others >> building on top of this once the dust settles. > > I do not know where it lives (and it may be Zsh-specific) [partly > because I haven’t looked while on mobile], but I think there is > support for completing « path » in « git show <tree>:», so there > might be something to build on there. I know where treeish:path<TAB> support is. The thing is, it is not a reusable machinery for "git checkout treeish path<TAB>". Thanks.