-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Hi @Wilfred, thanks again for this, I use it all the time.
It would be very useful (at least to me) to provide the ability to identify several directory trees to search instead of just one as it's the case with the current Directory: interface.
For instance some projects use libraries located inside a completely disjoint directory tree. Having the ability to identify the directory ytree holding the project as well as the library directory tree or directory trees would be very useful.
What would be the easiest way to implement this?
It's possible that the concept of "current" directory would have to be modified and that all file names would have to be shown with their complete absolute paths. Perhaps the current behaviour would have to be retained when only one directory is identified and a new behaviour would be used if there was any additional directories identified.
- It might be useful to specify additional in two places:
- one would be a deadgrep customization user option that could identify one or several additional directories
- another would be a dynamic entry/button one could press to add extra directories, one at a time.
I'm looking at the code to see if I can implement something. I noticed deadgrep-project-root-overrides, which provides another dimension for overriding. The current overriding only support overriding to a single directory. It might be nice to have the ability to override to several directories. Perhaps one way would be to have a user option that is an alist that associates a root with a list of extra directories to search. The code would check and append the extra directories to the rg command line if there are any for the current context. This way it would be possible to make this information persistent without affecting the current behaviour of deadgrep and without changing the user interface.
At the moment, as a partial (but not fully working) work-around, what I do is to create a directory with symbolic links to the various directories I need to search and then specify that directory. But then I need to specify the --follow option to ripgrep and if there are any broken symbolic links into any of the sub-tree rigprep complains and sometime stops. In some cases I can't fix the broken symlinks. For instance when I'm debugging a remote system and trying to see what is wrong and the broken symlink(s) are not the cause. Then I need to revert to multiple deadgrep buffers.