Skip to content

Concurrent views of a worktree #285

@amznpurple

Description

@amznpurple

Hi,

First, thank you for your very useful library. I'd like to try pushing it a bit further. Here's my use-case:

I'd like to first clone a repository, and then checkout more than one different branch or commit sha1 for simultaneous reading from multiple goroutines.

I'd like to have two different worktree's checked out from the same repo so that I can view the contents of these in parallel in two different goroutines. My understanding is that since a worktree encapsulates a filesystem object, in theory this should be possible. The advantage of doing it with your library would be that I wouldn't need to necessarily copy the entire repo and history to two different places on the disk. Preferably we could be efficient about it.

Maybe the new golang https://golang.org/pkg/io/fs/#FS interface can replace the billy one you use, so that different libraries can all speak the same way, and start passing around MemFs's and similar for when we want to make these copies.

I opened this bug to track this issue.

Thanks for your hard work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststaleIssues/PRs that are marked for closure due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions