poboiko added a comment.

  I believe can do something better here. 
  I think if we stick to canonical paths everywhere, and resolve symlinks ASAP 
(but still follow them), that might solve all the problems.
  
  In D16878#359864 <https://phabricator.kde.org/D16878#359864>, @bruns wrote:
  
  > Because it can never be consistent.
  >  What happens when I create two symlinks to the same folder, and put one 
link into includeFolders, the other one in excludeFolders?
  
  
  Here the behavior would be the same as if user just add the same folder to 
both lists. Not quite sure how it works now (I guess, one of two rules will 
just pop first). 
  But here the undefined behavior would be acceptable, because it seems like 
user tried to shoot his leg intentionally :)
  
  > What really should happen, the indexer should **never** follow symlinks, 
but only add files by their canonical path. This avoids a bunch of problems, 
symlink loops, nondeterministic pathes for files when these are added to the 
index, ...
  
  As for symlink loops, `QDirIterator` with `FollowSymlinks` seems to be able 
to handle this nicely (at least according to Qt docs).
  As for nondeterministic pathes - just add canonical path, and that's it.
  
  The only problem I see here is that if we try `baloosearch -d folder/` and 
inside there will be symlink `folder/subfolder -> /somewhere/else`, we won't 
find any results inside `subfolder`. 
  This is less trivial, to work with it we need to store the whole FS graph 
(which is not tree anymore) with symlinks. But for now we can live without it, 
I suppose.

REPOSITORY
  R293 Baloo

REVISION DETAIL
  https://phabricator.kde.org/D16878

To: poboiko, #frameworks, #baloo
Cc: bruns, kde-frameworks-devel, ashaposhnikov, michaelh, astippich, spoorun, 
ngraham, abrahams

Reply via email to