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

go-billy afero wrapper #2

Open
Maldris opened this issue May 21, 2020 · 2 comments
Open

go-billy afero wrapper #2

Maldris opened this issue May 21, 2020 · 2 comments
Assignees

Comments

@Maldris
Copy link

Maldris commented May 21, 2020

As a bit of a test as one of my projects uses spf13/afero for all other disk operations I implemented the go-billy interface as a wrapper for afero for use in go-git.

https://github.com/Maldris/go-billy-afero

This was done as a quick and dirty implementation to test the concept, but as part of it, I have gotten optional support for Symlink and ReadLink merged into afero.

To revisit the idea and look at potentially cleaning it up for actual use, I would appreciate some feedback to see what needs to be done, and if this could be imported as a new filesystem option.

My main concern for support is the file Lock and Unlock methods, which do not have equivalents in afero. To control the behaviour within memory I've provided a mutex, however if multiple instances are created in different processes, or multiple applications try to access the same file, this is an inadequate solution, requiring additional application level logic.

@gebv
Copy link

gebv commented Sep 3, 2020

As far as I understood go-git uses go-billy only for git worktree (like snapshots).
And go-git not works in parallel with FS. Then it is not required mutexes on files? Can only be one mutex for all worktree - lock if worktree is modificatios. But I think it's application layer.

The core message - required mutex on files for go-git for worktree? Please advice

@smola
Copy link
Contributor

smola commented Sep 3, 2020

@gebv go-git uses go-billy for all filesystem operations, including everything in the GIT_DIR (.git), not just the worktree.

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

4 participants