lincheney / fzf-tab-completion

Tab completion using fzf
GNU General Public License v3.0
623 stars 40 forks source link

changed files not suggested for `git diff ...` completion #94

Closed valentin-krasontovitsch closed 5 months ago

valentin-krasontovitsch commented 6 months ago

when working in a local git repo, and the working tree is dirty (i.e. there are modified files), and i type git diff Ma and hit Tab to get completions, i get no suggestions (I'm looking for Makefile, in this example).

without a prefix, just hitting Tab after git diff, i only get branch names and stuff like HEAD and FETCH_HEAD etc.

same is true if i try with git diff -- (to make it clear that i'm looking for paths, not revisions) - her i get nothing, even without prefix. i see a quick Loading matches... flash, and then nada.

i'm on macos, using bash version 5.2.15, having coreutils and most gnu utils installed and in path and whatnot.

works very well otherwise, thank you for your work, very nifty tool!

lincheney commented 6 months ago

Hi

What behaviour do you get when you are doing tab completion without fzf-tab-completion? Does it show you files?

valentin-krasontovitsch commented 6 months ago

sorry about the late reply - indeed they are, yet only if i enter a prefix. without fzf completion in bash, if i type git diff and hit tab twice, i get branch names, so that behaviour is consistent. but when i type git diff Ma and hit double tab, i get file path suggestions. the same when i type git diff -- and hit tab tab.

lincheney commented 6 months ago

Ok, I'm not able to reproduce the bug on my end, so will need your assistance to help debug. Can you run complete -p git and show me the output? For reference mine is: complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git Also, it may also be helpful to try do tab completion under set -x, the logs would be helpful for troubleshooting.

valentin-krasontovitsch commented 5 months ago

thanks for following up on this! again, i apologize for the late feedback.

the output for complete -p git is a wee bit different for me compared to what you get - I got

complete -o bashdefault -o default -o nospace -F _fzf_path_completion git

just in case, here's a gist with the terminal output when trying to complete with set -x

lincheney commented 5 months ago

Thanks for that one, that's really helpful I've made https://github.com/lincheney/fzf-tab-completion/commit/0926941e14b7a35ede4cf540d52efdc995987dc2 which I think should help, can you try it?

valentin-krasontovitsch commented 5 months ago

happy to hear that : ) this seems to have fixed it, at least for me! Thanks a lot ^^