carapace-sh / carapace-bin

multi-shell multi-command argument completer
https://carapace.sh
MIT License
767 stars 45 forks source link

git: Filename completion with directory symlinks #2359

Open saviola777 opened 2 months ago

saviola777 commented 2 months ago

Current Behavior

When there's a symlink anywhere in the directory hierarchy to the current directory, filename completion will create a relative path to the symlink target, effectively breaking filename completion.

Expected Behavior

Completion should work for the current directory regardless of whether there's a symlink anywhere in the directory hierarchy.

Steps To Reproduce

With the default config:

mkdir /tmp/a
ln -s /tmp/a /tmp/b
cd /tmp/b
git clone <some repo> test
cd test
touch some_file
git add som<Tab> # will not offer completion
git add <Tab> # will complete to ../../a/test/some_file

Version

1.0.1

OS

Shell

Anything else?

No response

rsteube commented 2 months ago

I can imagine that there's still something amiss with symlinks. But following the given example it does complete some_file for me for both cases.

saviola777 commented 2 months ago

Thanks for the feedback, maybe it's something in my configuration / environment that's the issue, I'll try to see if I can identify it.

rsteube commented 2 months ago

One thing to note is that git add <file> is different from standard file completion and only completes relevant files.