Skip to content
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

Support for limits on memfs? #64

Open
evankanderson opened this issue Jun 8, 2024 · 3 comments
Open

Support for limits on memfs? #64

evankanderson opened this issue Jun 8, 2024 · 3 comments

Comments

@evankanderson
Copy link
Contributor

We're using memfs alongside go-git to perform a shallow clone of Git repositories. We'd like to be able to limit the data written to the memfs (other than heap memory / crashing).

Would additions to the memfs interface to support limiting the filesystem contents be of interest / accepted?

@pjbgf
Copy link
Member

pjbgf commented Jun 9, 2024

Hey @evankanderson, thanks for creating your first issue.

Here's a discussion around the topic of limiting storage. Overall, I am not opposed to having this capability, we just need to ensure the user experience is solid. The question is what precisely are we going to limit and how are we going to enforce it?

I am happy to review a PR on this if you are keen to propose one.

@evankanderson
Copy link
Contributor Author

I'm willing to look at a filter option for go-git as well, but I'll see about sending a PR to add upper bounds on total file size and total number of files to memfs.

Is it expected that memfs is thread-safe? (I'm assuming not given current code)

@pjbgf
Copy link
Member

pjbgf commented Jun 10, 2024

Is it expected that memfs is thread-safe?

It isn't at the moment, and is one of the causes of go-git's thread-safety problems. That is something I would also be happy to review a separate PR for. As this could have an impact on performance, I would just make sure it is something folks can opt-in/out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants