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

DGit 9P file server #65

Open
sirnewton01 opened this issue Jul 21, 2018 · 2 comments
Open

DGit 9P file server #65

sirnewton01 opened this issue Jul 21, 2018 · 2 comments

Comments

@sirnewton01
Copy link
Collaborator

sirnewton01 commented Jul 21, 2018

While DGit aims to be a drop-in replacement for git, especially for Plan 9 that lacks an official git client, there can be more that we can do with this project than just aim for parity.

I think that it would be interesting to have a subcommand that would start a 9P file server for a specified git repository.

Here's a rough proposal:
dgit serve <git repository path>
-Creates a 9P file server at /srv/git that can be mounted

Filesystem structure:
/worktree/ - the current contents of the work tree
/ctl -send git plumbing commands here with some adjustments
/commits/ - access commits as-needed using a ctl file
/log/ - the history of the current branch in ascending order (0, 1, 2, ...)
/branch/ - create and read branch information
/tag/ - create and read tag information

I'm not sure if we should expose object and index files directly from the .git directory.

This would allow anyone to mount a git repository and bind it anywhere they like. Modifications that they make to it can be tracked and committed. The repository can be shared across your processes and network. You can use acme/sam to perform your git operations without using interactive ('win') mode.

It would be nice to try to hook into other plan 9 services and conventions in this server mode. For example, use factotum for authenticating against other servers. Use plumber to bring up editors.

@driusan
Copy link
Owner

driusan commented Jul 21, 2018

I'm not opposed to incorporating something like this directly, but you can probably move on it a lot faster/experiment more if you do it in a different repo and just import the dgit/git library package (as long as you stick to the functions that map directly to git command line functions, I don't foresee the interface changing in any incompatible way any time soon.)

If you want to look into it, Harvey OS has a pure Go 9p package that might be a good place to start: https://github.com/Harvey-OS/ninep. I thought 9front had a hgsrv implementation that you could look into for the filesystem structure inspiration, but I can't find any sign of it right now, so maybe I'm imagining that.

@mischief
Copy link

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

No branches or pull requests

3 participants