-
Notifications
You must be signed in to change notification settings - Fork 2
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
implement cache based listing #29
Conversation
a real-life example would be the `nushell` and `nushell.github.io` repos: we want them both.
a real-life example would be the `nushell` and `nushell.github.io` repos: before this change, `nushell.github.io` would be discarded by `list-repos-in-store` because `nushell.github.io` starts with `nushell`. keeping the trailing `/` in all paths fixes the error because `nushell.github.io/` does not start with `nushell/` anymore 👌
because the paths are sanitized, they will all use `/`
|
related to - amtoine/nu-git-manager#29 will require to install `nu-git-manager` with Nupm from amtoine/nu-git-manager#29.
all paths should be sanitized now
i've added NOTEs in the PR description about fixing this PR's CI for Windows, hope that's clear enough 👀 🤞 |
Nice!!
I don't see this exposed? edit: the whole module silently failed to load actually... I see it in code but it wasn't working in the cli
Wouldn't that be super slow? (I still have to test it out) Not sure what it is, maybe the imports, I'll check that |
use ./nu-git-manager/ "gm cache" works on my side 👍
it will very likely be much slower than just updating the cloned / removed project 🤔
if i'll work on a little toolkit to simplify that 😌 |
when cloning or removing a project, there is no need to update the whole cache, that takes unnecessary time... this commit only appends the new project to the cache or removes it when using `gm clone` or `gm remove`. because it started to be used in multiple places, i've refactored the check of the cache existence in `check-cache-file` in the `fs/store/` module.
that should be muuuuuch faster anyways thanks to fa3f5ea 🤞 |
Yep this was before I understand that all commands are imported individually, I added it to the readme here b12bd94 I wasn't sure because it was only used to get the cache path but with your new commit it make sense imo to mention it in the import examples
Awesome! |
oooh ok ok 👍 use nu-git-manager * 😋
tell me when the changes are ok, or feel free to land if there's nothing more to add right now 😌 |
There is no much point in my addition to the readme, I reverted it |
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.
🚀
thanks for landing this 🙏 |
this has been introduced in #29, likely through an annoying and automatic formatting of the Markdown document 😮
description
#26 had three major flaws,
list-repos-in-store
find
on Linux and MacOSglob
on Windows, which is slowthis PR tries to solve these at once
glob
only for all the OSes and removed the dependency onfind
gm
new features
gm cache
is a new command that gives the cache currently used~/.local/share/nu-git-manager/cache.nuon
--update
switch to force a full update of the cache: this might take some timegm list
will simplyopen
the cache and dump it's content as a list: this will be super fastgm clone
andgm remove
will update the cache in a super fast way, withoutlist-repos-in-store
gm clone
will just append the new path to the cachegm remove
will just remove the removed path from the cachegm cache --update
manually to fixgm list
's outputgm list
will be used in other commands instead oflist-repos-in-store
to use the cachedetails on the changes
with this PR,
list-repos-in-store
willglob
HEAD
fileHEAD
s that are stored in multiple places in.git/
directoriestests
this PR adds two tests
get-repo-cache
to make sure the cache is properly setuplist-all-repos-in-store
to make surelist-repos-in-store
can list all repos, bare ones included, without nested duplicates, in a fake store