go-billy icon indicating copy to clipboard operation
go-billy copied to clipboard

go-billy afero wrapper

Open Maldris opened this issue 5 years ago • 2 comments

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.

Maldris avatar May 21 '20 09:05 Maldris

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

gebv avatar Sep 03 '20 12:09 gebv

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

smola avatar Sep 03 '20 18:09 smola