-
-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend indexer rules with .gitignore
when available
#2459
Extend indexer rules with .gitignore
when available
#2459
Conversation
@matheus-consoli is attempting to deploy a commit to the Spacedrive Team on Vercel. A member of the Team first needs to authorize it. |
3827c7d
to
9727e5f
Compare
I'm personally not entirely sure how I feel about this; Having the indexer skip over certain files feels like it defeats any chance of Spacedrive being used as a true file-explorer replacement it's supposedly aims to be. A developer building an application being unable to even see their
I could understand perhaps disabling higher-level metadata extraction or something similar for files falling under |
I agree with you, @0xBA5E64 - I'm still quite new to this codebase, but I think the current indexer cannot express this configuration for now. I would love to be pointed wrong though, and it's probably something that should be added to the roadmap |
130a9ec
to
29943f5
Compare
The indexer rules aren't only for showing files in the explorer, for indexed locations they define what should or shouldn't be stored in db and syncronized between multiple devices. I agree that maybe excluding these files from the explorer may not be great, but usually files ignored by .gitignore, really must not be stored in db synchronized between multiple devices. Imagine having to store and sync a |
A possible option, I've discussed internally this week, is about merging results from database and from file system when showing indexed locations in the explorer. This way we will index everything for storing and sync purposes according to indexer rules, but show everything contained in the file system, maybe with a small icon in files not in db for example. |
IMHO I think this is the best approach. The only question is if we handle this in the frontend or the backend. Technically we already have all the api call necessary for handling this entirely in the front, just need to call |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
A file being listed in
Indeed, but I urge you to look at this in the reverse as well: The indexer rules don't just define what's to be synchronized between multiple devices, but also, what's being indexed and showed in the explorer.
For things like web-development, What about, say, game-devs, that occasionally leave out all their game assets out of version management via Excluding files from the indexer based on To be clear I do certainly find the value in something like this, I just feel that something like avoiding |
Yeah that is the intent, the sync system is being develop as an extension of the indexer. Under the hood the sync is mostly a way for sharing your indexed database between Spacedrive clients + the ability to request remote file data on-the-fly through a p2p connection. So, the indexer rules will influence what is being synced. About what is being displayed on the explorer we are discussing how to improve this, the idea is to integrate our indexed locations with the logic for the ephemeral file explorer, so that a local machine can seamlessly display all files for a location independently if they are actually being indexed or not. That way the indexed locations would work more like a normal file explorer with the added benefit of almost instantaneous search and sync for the indexed files. We would also like to implement something similar for the sync system, such as a client could remotely request an ephemeral view of a synced location to allow the user to see all the files on the remote Spacedrive, as long as the source is online.
We need to find a balance so that the indexer, by default, can be performant enough while retaining most of its usability. Having good defaults for files being ignored at first is an important part of this, and ignoring files listed in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. However some files ignored by the root .gitignore
which are present in sub-directories are still being indexed. I think this can be fixed if we adapt the implementation of the following functions from gix-ignore
:
gix_ignore::search::Search::pattern_matching_relative_path
gix_ignore::search::pattern_matching_relative_path
However I would be fine merging this as is and leaving the changes recommended above as an improvement for later if they are not something straight-forward to implement.
77121e4
to
841eba1
Compare
841eba1
to
df5bd6b
Compare
…reRules - Make IndexerRules names unique - CLippy fmt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Great work @matheus-consoli
Extend the file indexer to account for ignored files within a git repository.
Example
Using this
.gitignore
:partial/*.ignoreme secrets
and this file structure:
the files listed in the
.gitignore
are skipped by the indexer and does not appear in the frontend:Closes #(issue)