You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
list_files ripgrep path still uses would_match_directory band-aid for the ignore-ancestor bug #882
Follow-up to #881, deliberately left out of that fix to keep its diff reviewable.
_list_files' local ripgrep path solves the same problem a third way: it writes the ignore patterns to the temp ignore file but drops any pattern that would_match_directory(pattern, directory) says would match the search root, then hands ripgrep the absolute root.
That works, but compared with the . + cwd=<root> approach now used by _grep:
It over-prunes in the other direction. Dropping **/tmp/** wholesale means a real tmp/ directory below a root that happens to sit under /tmp is no longer ignored either. The relative-to-root approach prunes it correctly.
Three mechanisms, one problem._grep (cwd-relative), _list_files local (pattern filter), _list_entries_via_backend/_grep_via_backend (_relative_ignore_predicates). The next person to touch ignore semantics has to find all of them.
Converting the local path to the . + cwd shape would let would_match_directory (and its tests) go away entirely, leaving exactly two mechanisms -- one per HTTP... sorry, one per traversal style: subprocess and backend-walk.
Note also: code_puppy/tools/file_operations.py is ~1493 lines, well past the 600-line guideline. The natural split is grep / list / read-edit / subprocess-plumbing. Worth doing before more is bolted onto it, but not inside a bug fix.
Activity
fix(tools): match grep/list ignore patterns relative to the search root