junegunn / fzf-git.sh

bash and zsh key bindings for Git objects, powered by fzf
612 stars 53 forks source link

_fzf_git_files lists all files in the repository #32

Closed sakamossan closed 6 months ago

sakamossan commented 1 year ago

When calling _fzf_git_files in a subdirectory of the repository, it lists the files under the current directory. While this behavior seems reasonable, but there are cases where we also want a list of all files in the repository. to achieve this, I modified it to pass the repository's root directory to git ls-files, which lists all files in the repository.

Given that this might result in breaking changes, it's alright if this can't be merged. However, since fzf is a tool for filtering lists, I think convenience outweighs troublesomeness when we have more options.

junegunn commented 6 months ago

Thanks, I like the idea. But what I don't like is that it lists files in the parent directory first, so it's not easy to see what's in the current directory.

One idea is to filter out items with ../ by starting fzf with --query '!../ ' as in 02ebf1b.

sakamossan commented 6 months ago

Thanks! I think It's an excellent solution.

That approach would maintain the default behavior as before, while also available all files in the repository if desired.

junegunn commented 6 months ago

Merged, thanks!