FUSE fs for git.

5 messages, 4 authors, 2021-03-01 · open the first message on its own page

FUSE fs for git.

From: Stef Bon <hidden>
Date: 2021-02-21 10:13:29

Hi,

I'm working on a network fs mount service for Linux (I call it Open
Secure Network Services, short OSNS) which mounts sftp access on hosts
found in the network (using Avahi) and provides a browseable map to
the user like:

sbon@ws-001 OSNS]$ ls -al /run/network/sbon/fs/Open\ Secure\
Network/bononline.nl/alarm/public
total 3
drwxrwx--- 5 nobody users 4096 Feb 21 05:05  .
drwxr-xr-x 5 root   root  4096 Feb 21 05:04  ..
-rw-r--r-- 1 sbon   users    0 Aug 15  2018  1234
drwxr-xr-x 2 nobody users 4096 Jan 24 04:52  backup
-rw-r--r-- 1 nobody users   21 Feb 21  2017  .bash_logout
-rw-r--r-- 1 nobody users   57 Feb 21  2017  .bash_profile
-rw-r--r-- 1 nobody users  141 Feb 21  2017  .bashrc
drwxr-xr-x 2 nobody users 4096 May 27  2017  Projects
-rw-r--r-- 1 nobody users    4 Jul  1  2017  test
-rw-r--r-- 1 sbon   users   24 Aug  6  2017  test1
-rw-r--r-- 1 sbon   users    4 Aug 10  2017  test2
-rw------- 1 sbon   users    0 Aug 15  2018 'Text File'
-rw------- 1 sbon   users    0 Aug 15  2018 'Text File (1)'
-rw------- 1 sbon   users    0 Aug 15  2018 'Text File (2)'

See: https://github.com/stefbon/OSNS

It supports SFTP (over SSH) versions 3 (used by Openssh) to 6 (latest draft).
Other things I want to add is:
- own sftp client (osns_sftp_subsystem)
- backup on server of user defined directories and files (osns_backup_subsystem)
- next to SFTP also support SMB using libsmb2 by R. Sahlberg for
integration in Windows Networks
- fsnotify support in SFTP and in userland using a specific user agent
like osns_client_user (maybe also in SMB) (support in SFTP means an
extension)
- textchat and/or videochat (osns_chat_subsystem)
- forward connection to server over SSH using a simple api to talk to
osns_client for databases, and something like nx (emulation of
desktop)
- an own server osns_server
- support for use in large environments and roaming users (-> CA, ldap etc)

Now I'm looking it's possible and usefull to add a git fuse fs. The
thing I ask is:

- is there an api I can use (lowlevel and/or highlevel or whatever is
available)?

- is it usefull, in other words is there a serious benefit of a git
filesystem: does it add something?

Any other suggestion is appreciated,

Stef Bon
the Netherlands

Re: FUSE fs for git.

From: Ori Bernstein <hidden>
Date: 2021-02-25 04:48:03

On Sun, 21 Feb 2021 11:12:19 +0100, Stef Bon [off-list ref] wrote:
<snip>
Now I'm looking it's possible and usefull to add a git fuse fs. The
thing I ask is:

- is there an api I can use (lowlevel and/or highlevel or whatever is
available)?
Not provided as part of git, as far as I'm aware,
but there are other options.

You can probably look at what cgit does to abuse
git internals as an API:

	https://git.zx2c4.com/cgit/tree/cgit.h

It may also make sense to lift code from game
of trees:

	http://gameoftrees.org/

There's also libgit2:

	https://libgit2.org/
- is it usefull, in other words is there a serious benefit of a git
filesystem: does it add something?
That seems like a question you'd have to ask yourself.
What would you do with it?

For me: I've got a 9p based git file system as part of
my implementation of git[1].  It's convenient for scripts
on top of git, avoiding scratch files or pipeline wrangling.
But on Unix, git already has much of that implemented.

I also tend to open files from old commits or other branches
to peek at how some code evolved.

[1] http://shithub.us/ori/git9/HEAD/info.html

-- 
    Ori Bernstein

Re: FUSE fs for git.

From: Eric Wong <hidden>
Date: 2021-02-25 05:37:17

Stef Bon [off-list ref] wrote:
- is there an api I can use (lowlevel and/or highlevel or whatever is
available)?
I've used "git cat-file --batch" in many places via pipes.
Git.pm provides a convenient interface for it.
It handles requests like "$REFNAME:$PATHNAME" so it'd be
pretty easy to map FS-like paths to it.

"git fast-import" is also nice if you need write access and
nowadays has "cat-blob" functionality similar to the
aforementioned --batch.

Re: FUSE fs for git.

From: Stef Bon <hidden>
Date: 2021-03-01 07:46:15

Thanks a lot Ori.

Especially the link to libgit2 and your own 9p based git filesystem I
appreciate.
What is 9p? Is it a name or something?

Stef Bon
the Netherlands

Re: FUSE fs for git.

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-03-01 14:09:30

On Mon, Mar 01 2021, Stef Bon wrote:
Thanks a lot Ori.

Especially the link to libgit2 and your own 9p based git filesystem I
appreciate.
What is 9p? Is it a name or something?
https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help