Kirottu / kidex

A simple file indexing service for looking up file locations
GNU General Public License v3.0
19 stars 1 forks source link

Some more documentation #1

Closed LorenzoBettini closed 1 year ago

LorenzoBettini commented 1 year ago

Hi, thank you for the program (including anyrun).

I'm evaluating kidex (through the AUR package "kidex") but I think some more documentation might help:

Thank you in advance!

Kirottu commented 1 year ago

Yes, the index is simply stored in memory is it is very simplistic and does not take long at all to recreate whenever kidex launches.

Reindexing generally doesn't need to be manually triggered as the program continuously watches the directories to keep them indexed, but for manually triggering it the kidex_client crate inside the repo can be used.

And for the exclusion patterns, globber is used. That syntax for the pattern should be fine though so I don't quite know what is going on with it.

LorenzoBettini commented 1 year ago

Thank you for the quick answer. Is there any way I can try to understand why it doesn't work? I mean, can I enable some logging? Just to be sure: the exclusion patterns are for files and directories, aren't they?

Kirottu commented 1 year ago

The exclusions are for all paths, you should be able to plop in some log statements in the code in Index::create_index, where the patterns are checked.

LorenzoBettini commented 1 year ago

I didn't mean to debug: I mean if kidex logs something somewhere.

What do you mean by "plop"?

LorenzoBettini commented 1 year ago

@Kirottu I had a look at https://github.com/Kirottu/kidex/blob/master/kidex/src/index.rs#L62

I know nothing about Rust, but I have the impression that the ignore pattern is used only for events.

In fact, if I run kidex and a create a .class file or rename an existing one, the new (or renamed) files are not shown, while the previously existing ones are still shown.

If I stop kidex and start it again, all the .class files are shown (again, new ones or renamed are not shown).

I guess that's not intentional ;)

Kirottu commented 1 year ago

Ah, that must be the issue then. I'll get it fixed soon enough.

LorenzoBettini commented 1 year ago

By the way, in index_dir you don't use as_os_str while in create_index you do

Kirottu commented 1 year ago

Should be fixed now on the master branch, do test it out.

LorenzoBettini commented 1 year ago

@Kirottu I've just tried AUR kidex-git and the problem is still there... I'm assuming that AUR package is based on this Git repository, or not?

LorenzoBettini commented 1 year ago

I have also cloned this repository and compiled it from source: the behavior is exactly the same as before (new and renamed files are excluded, but the existing ones when kidex starts are not excluded), so I'm afraid this but is still there... I would suggest the use of some automated tests. Please let me know if I can help further.

Kirottu commented 1 year ago

Automated tests would probably be useful yeah. But implementing them could be kinda difficult.

Kirottu commented 1 year ago

Ok now it should actually work.

LorenzoBettini commented 1 year ago

@Kirottu thanks! Looks like it's working fine now :)

Automated tests are an investment and they are what allows a program to be easily maintained ;)

Kirottu commented 1 year ago

I really should look into that at some point, thanks for the help!