Download - Introducing gitfs
| open source
from pygit2 import clone_repository, Keypair
credentials = Keypair("git", "/home/wok/.ssh/ unsafe_key.pub","/home/wok/.ssh/unsafe_key", "")
gitfs
| open source
from pygit2 import clone_repository, Keypair
credentials = Keypair("git", "/home/wok/.ssh/ unsafe_key.pub","/home/wok/.ssh/unsafe_key", "")
repository = clone_repository("[email protected]:vtemian/gitfs-demo","/home/wok/gitfs-demo", credentials=credentials)
gitfs
| open source
from pygit2 import clone_repository, Keypair
credentials = Keypair("git", "/home/wok/.ssh/ unsafe_key.pub","/home/wok/.ssh/unsafe_key", "")
repository = clone_repository("[email protected]:vtemian/gitfs-demo","/home/wok/gitfs-demo", credentials=credentials)
remote = [remote for remote in repo.remotes if remote.name == "origin"] remote[0].credentials = credentials
gitfs
| open source
from pygit2 import clone_repository, Keypair
credentials = Keypair("git", "/home/wok/.ssh/ unsafe_key.pub","/home/wok/.ssh/unsafe_key", "")
repository = clone_repository("[email protected]:vtemian/gitfs-demo","/home/wok/gitfs-demo", credentials=credentials)
remote = [remote for remote in repo.remotes if remote.name == "origin"] remote[0].credentials = credentials remote[0].push("refs/heads/master")
gitfs
| open source
class Memory(Operations): def open(self, path, flags): self.fd += 1 return self.fd
gitfs
| open source
class Memory(Operations): def open(self, path, flags): self.fd += 1 return self.fd
def read(self, path, size, offset, fh): return self.data[path][offset:offset + size]
gitfs
| open source
class Memory(Operations): def open(self, path, flags): self.fd += 1 return self.fd
def read(self, path, size, offset, fh): return self.data[path][offset:offset + size]
def rename(self, old, new): self.files[new] = self.files.pop(old)
gitfs
| open source
class Memory(Operations): def open(self, path, flags): self.fd += 1 return self.fd
def read(self, path, size, offset, fh): return self.data[path][offset:offset + size]
def rename(self, old, new): self.files[new] = self.files.pop(old)
def rmdir(self, path): self.files.pop(path) self.files['/']['st_nlink'] -= 1
gitfs
| open source
class Memory(Operations): def open(self, path, flags): self.fd += 1 return self.fd
def read(self, path, size, offset, fh): return self.data[path][offset:offset + size]
def rename(self, old, new): self.files[new] = self.files.pop(old)
def rmdir(self, path): self.files.pop(path) self.files['/']['st_nlink'] -= 1
def write(self, path, data, offset, fh): self.data[path] = self.data[path][:offset] + data self.files[path]['st_size'] = len(self.data[path]) return len(data)
gitfs
| open source
very dirty
def rename(self, old, new): if "history" in old or new: # raise EROFS elif old == "/" or new == "/": # raise EROFS else: # do the actual rename
gitfs
| open source
Fuse threads Commit queue Sync worker
commits
commit
want to sync
don't open for write
gitfs
| open source
Fuse threads Commit queue Sync worker
commits
commit
want to sync
sync done
don't open for write
gitfs
| open source
Fuse threads Commit queue Sync worker Fetch worker
commits
commit
want to sync
sync done
don't open for write
FETCH
FETCH
FETCH
gitfs
| open source
Fuse threads Commit queue Sync worker Fetch worker
commits
commit
want to sync
sync done
don't open for write
Nothing happens FETCH
FETCH
FETCH
gitfs
| open source
Fuse threads Commit queue Sync worker Fetch worker
commits
commit
want to sync
sync done
don't open for write
Nothing happens
Nothing happens but somebody is still writing
FETCH
FETCH
FETCH
gitfs
| open source
Fuse threads Commit queue Sync worker Fetch worker
commits
commit
want to sync
sync done
don't open for write
Nothing happens
Nothing happens but somebody is still writing
Nothing happens but somebody is still writing so we can merge and push
FETCH
FETCH
FETCH
gitfs
| open source
$ sudo add-apt-repository ppa:presslabs/gitfs $ sudo apt-get update $ sudo apt-get install gitfs
gitfs