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
After #5682 and #18649, the situation is that Pants uses the root and global .gitignore files when --pants-ignore-use-gitignore is enabled (as it is by default).
This ticket covers supporting non-root/global .gitignore files in child directories.
The implementation of --pants-ignore-use-gitignoreinitially used a naive recursive-upward parse of .gitignore files: this meant that for every file-ignore lookup, we would re-parse all parent .gitignore files. Consequently, that aspect was skipped in #9310.
Instead, in order to support nested .gitignore files efficiently while watching changes made to them, we would need to add recursive-upward memoization of .gitignore parsing. The memoization could either be accomplished by:
creating a new Gitignore node, which recursively depended upwards on itself to parse parent Gitignore nodes.
adding Gitignore information to the Scandir node, such that whenever we called Scandir on a directory, we also exposed and memoized a GitignoreStyleExcludes struct from the Node. Then, Scandir nodes would recursively depend on the parent Scandir node.
To reduce overhead (by creating fewer Nodes), I think that approach 2 would be cleaner. But if it ended up increasing complexity too much, then approach 1 would be fine as well.
The text was updated successfully, but these errors were encountered:
After #5682 and #18649, the situation is that Pants uses the root and global
.gitignore
files when--pants-ignore-use-gitignore
is enabled (as it is by default).This ticket covers supporting non-root/global
.gitignore
files in child directories.The implementation of
--pants-ignore-use-gitignore
initially used a naive recursive-upward parse of.gitignore
files: this meant that for every file-ignore lookup, we would re-parse all parent.gitignore
files. Consequently, that aspect was skipped in #9310.Instead, in order to support nested
.gitignore
files efficiently while watching changes made to them, we would need to add recursive-upward memoization of.gitignore
parsing. The memoization could either be accomplished by:Gitignore
node, which recursively depended upwards on itself to parse parentGitignore
nodes.Gitignore
information to theScandir
node, such that whenever we calledScandir
on a directory, we also exposed and memoized a GitignoreStyleExcludes struct from theNode
. Then,Scandir
nodes would recursively depend on the parentScandir
node.To reduce overhead (by creating fewer
Nodes
), I think that approach 2 would be cleaner. But if it ended up increasing complexity too much, then approach 1 would be fine as well.The text was updated successfully, but these errors were encountered: