presslabs / gitfs

Version controlled file system
https://www.presslabs.com/code/gitfs/
Apache License 2.0
2.49k stars 153 forks source link

Should allow shallow clone of the git repo (i.e. --depth 1) #287

Open Kimi-Arthur opened 6 years ago

Kimi-Arthur commented 6 years ago

It takes quite a while to clone a big project (with long history), while maybe only HEAD is needed.

In general, configuring clone/pull/push options may be very helpful.

vtemian commented 6 years ago

Thank suggestion! A -o clone_depth=N can be added.

Kimi-Arthur commented 6 years ago

That will suffice for me. But general option for clone may be even more useful.

Anyway, clone_depth will be cool!

baryluk commented 4 years ago

I would also like to have clone_depth option.

As well making mounted file system either read-only, or any writes to it, not do any commits / pushes (instead preserve any changes locally in tmpfs or other backing storage). Or maybe this can be accomplished by stacking overlayfs on top of gitfs and tmpfs.

This would be rather nifty for running continuous integration testing using gitfs. They don't need full repo, or write access. In fact they shouldn't have write access, and on unmount all local modifications should be gone.

It is still not 100% optimal, as mounting even with clone_depth=1 will still do a lot of fetching which can take quite a bit of time. A specialized TCP server that exports read only view of git repo, that can be used maybe with nfs, sshfs or 9p network file system is another interesting option. This way mounting would be instantaneous, caching can be achieved on the client, and only files that are actually read will be fetched, and probably faster than using git fetch.