=f to limit to files will try to help by building up a list of paths for completion. However, with moderately large repositories, which have a path like
ssh://..., Emacs may lock up for something like five minutes (the watch is displayed and no interaction with Emacs is possible). Setting
ignore does not help. Is there a workaround to avoid this delay?
Reading the files is done using
magit-read-files, which builds the list of files using
magit-list-files, which runs git like so:
git ls-files -z --full-name
I.e. this prints one long line that separates individual files using the null character instead of newlines. That is necessary to support crazy file names that contain newline characters.
This is known to cause issues with Tramp, which searches that line backwards using a regexp. Backward regexp search is known to be very slow. I will have to look into this with the Tramp maintainer at some point.