Coder Social home page Coder Social logo

gitfs's Introduction

gitfs Build Status Coverage Status PyPI

Welcome to GitFS

gitfs is a FUSE file system that fully integrates with git. You can mount a remote repository's branch locally, and any subsequent changes made to the files will be automatically committed to the remote.

gitfs was developed by the awesome engineering team at Presslabs, a Managed WordPress Hosting provider.

What's its purpose?

gitfs was designed to bring the full powers of git to everyone, no matter how little they know about versioning. A user can mount any repository and all their changes will be automatically converted into commits. gitfs will also expose the history of the branch you're currently working on by simulating snapshots of every commit.

gitfs is useful in places where you want to keep track of all your files, but at the same time you don't have the possibility of organizing everything into commits yourself. A FUSE filesystem for git repositories, with local cache.

Installing

We provide packages for the major Ubuntu releases and MacOS, but you can find community packages for most of popular Linux distributions. If you want to build packages for a distribution, or you already did, please contact us and we'll list it here.

Ubuntu 18.04+

sudo add-apt-repository ppa:presslabs/gitfs
sudo apt-get update
sudo apt-get install gitfs

MacOS

brew install gitfs

Pip

We also publish a package to PyPI, which can be installed via pip using the following commmand:

pip install gitfs

Usage

You can mount a remote or local repository easly, just by providing the repository to clone and a directory used to mount.

gitfs http://your.com/repository.git /mount/directory

The entire filesystem can be tweaked when mounting it, using a set of options.

gitfs [email protected]:user/repo.git /mypath -o
repo_path=/tmp/path,branch=dev,log=-,debug=true,foreground=true,fetch_timeout=0.1,merge_timeout=0.1...

For an entire list of options, you can check the arguments page.

Features

  • Automatically commits changes: create, delete, update files and their metadata
  • Browse through working index and commit history
  • Merges with upstream by automatically accepting local changes
  • Caching commits reduces the memory footprint and speeds up navigation
  • Reduces the number of pushes by batching commits

Development

You can find more documentation on gitfs homepage.

Contributing

Development of gitfs happens at http://github.com/presslabs/gitfs.

Issues are tracked at http://github.com/presslabs/gitfs/issues.

The Python package can be found at https://pypi.python.org/pypi/gitfs/.

You are highly encouraged to contribute with code, tests, documentation or just sharing experience.

Please see CONTRIBUTING.md.

License

This project is licensed under Apache 2.0 license. Read the LICENSE file in the top distribution directory for the full license text.

gitfs's People

Contributors

aacaz avatar balazser avatar bogdanpetrea avatar calind avatar christianalexander avatar dependabot-preview[bot] avatar desero avatar domt4 avatar dragostis avatar f9n avatar justuswilhelm avatar krodyrobi avatar oschrenk avatar oxr463 avatar rciorba avatar srishanbhattarai avatar stjeanp avatar tadwhitaker avatar tusharmakkar08 avatar vasiioandre avatar vegaminer avatar vtemian avatar zalmanu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitfs's Issues

Browse working tree

  • clone in a directory specified at mount point
  • follow branch specified at mountpoint

Strange race condition on commit/push

for i in {1..100};
do echo "some test" >> current/me; touch current/tmp$i; mv current/tmp$i current/tmp_$i;
done

Will raise:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/home/wok/presslabs/gfs/gitfs/worker/base.py", line 20, in run
    self.execute(jobs)
  File "/home/wok/presslabs/gfs/gitfs/worker/commit.py", line 25, in execute
    message = self._index_paths(add, 'add', "Updated %s items")
  File "/home/wok/presslabs/gfs/gitfs/worker/commit.py", line 38, in _index_paths
    getattr(self.repository.index, operation)(path)
KeyError: 'tmp1'

On open and access, raise specific error

When we try to read a file from a ReadView, in open we should check for write flags(os.O_WRONLY | os.O_RDWR | os.O_APPEND | os.O_TRUNC | os.O_CREAT), otherwise, raise EROFS and in access, check for right mode(R_OK|F_OK), otherwise, raise EACCES

Restructure code

  • a lot of decorators.py
  • remove duplicate code
  • move repository.py from utils
  • restructure accept_mine.py

Folder creation create a `.keep` file

Git works only with files. In order to add a folder to VCS a placeholder file should be created. This file should not be deletebale. Only deleting the folder deletes this file.

Create file

Enable file writes. Commits should be done when the file handle is closed.

Browse directory structure

ls -l should display the file mode for working directory as well as /history

  • CurrentView
  • HistoryView
  • IndexView
  • CommitView

Batch pushes

  • Do git push if writes are idling more that coalesce_writes seconds or after coalesce_timeout is hit

Browse commits

Commits should be available under /history root folder. They should be organised like this:

gitium-fs
├── current
└── history
    ├── 2014-06-30
    │   └── 14-30-40-33f9603
    │       └── INFO
    └── 2014-07-03
        ├── 14-30-40-6f04e04
        │   └── INFO
        └── 14-30-40-a3f09de
            └── INFO

They are grouped by commit day (UTC time) and each commit short sha1 is prefiex with the commit time (UTC).

Each commit folder has an INFO file containing the full commit description (eg. from git log).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.