
Show HN: Gitfs – mount Git repos as local folders - vtemian
http://www.presslabs.com/gitfs/docs/
======
hardwaresofton
I think this kind of file system would do well to power platforms that AREN'T
for programmers. While this may not seem useful for programmers (because they
are so involved in git usage in the first place), I think others might benefit

I've had the idea to make an interative design/architecture plugin for
programs like photoshop/3dmax/etc rolling around in my head for a while now.
Git is a perfect way to store/save the progress people make in those programs
(as files change over time, or as they save), and gitfs seems like it would be
the fs to run on the backing server.

Instant branching (like when an artist decides to riff on a new idea),
undo/rollback, progress tweens/reports.

~~~
TranquilMarmot
It's my understanding that Git is pretty bad for storing binary files that
change a lot since it has to keep a copy of _every_ version of that file
(whereas with plaintext it can just store the diffs). Now, maybe that's what
you would want, but that repo is going to get _very_ big _very_ fast.

Pulls won't be so bad if your machine already has all the commits, but cloning
would be a nightmare. And it'll be taking up a lot of space on your git
server.

~~~
peff
It's not exactly plaintext versus binary. Git "stores" a copy of every file,
no matter the content. But it also does "delta compression" between objects
when you run "git gc"; it tries to find binary diffs between objects that are
similar. So the poor performance comes from files that don't "delta" well.

These tend to be things which are compressed or encrypted, where a small
semantic change can cascade into a lot of bytes changing. Of course, binary
formats often do both of those things. And the larger the files, the more
painful it is when it happens.

~~~
e12e
Incidentally, the new office formats (both the "open" and the open one) are
zip-files with (among other things) xml-documents. I saw someone a while back
recommending storing them uncompressed when working with VCS -- gives pretty
useful diffs with no extra work (I forget if they recommended extracting, or
just storing without compression).

------
btown
Does it batch changes, i.e. if 5 files are saved within a few seconds of each
other?

It would also be interesting if that was combined with naming commits based on
language processing (i.e. splitting on camel case and snake case, finding the
word whose frequency in the current diff is most different from its frequency
in the codebase overall). Then you could have human-readable history without
any conscious need to maintain it - and this would be developer-friendly, just
Save All in Sublime Text and fuhgettaboudit.

~~~
vtemian
Yes, it batches changes. Improving the commit messages is in the pipeline and
what you have described sounds interesting. Right now the focus is to get the
right semantics for git operations in the context of a filesystem.

------
dflock
This seems very similar to SparkleShare:
[https://github.com/hbons/SparkleShare](https://github.com/hbons/SparkleShare)

------
whoisthemachine
This seems nice as something that sits as a layer over any typical file
system, giving a user basic version control without extra effort.

------
zackmorris
This is reminiscent of Apple's Time Machine, except each save is the same as
manually clicking "Back Up Now", and I assume that commits are more granular
so directories can be committed individually rather than the whole tree.

I've often wondered if version control systems could be abstracted into a
filesystem where each write is a commit, handling merges by choosing the local
copy.

My primary dissatisfaction with git is that it lacks layers of abstraction.
For example it should have had at least the first two distinct components
listed below, something like:

1) git-fs (versioned filesystem, only supporting commit, clone and
permissions)

2) git-merge (diff utility to handle merge conflicts)

3) git-local (two repositories wrapped in an abstraction to provide local and
remote - the special sauce of git)

4) git-util (everything else like repair, reports, statistics, etc)

5) git (umbrella executable above previous layers)

I’m not super familiar with git console use so if it already is organized this
way, great. But since it is not presented this way in its documentation, I
feel that a great opportunity has been missed. We could have used git-fs the
same way that people use Dropbox. Instead we have something with a lot of
warts (things like .gitignore files interspersed with other files that
continue the same mistakes that cvs and svn made, and the inability to save
empty directories). I think git’s pattern of pull/commit/push is fantastic,
but its shortcomings are so numerous that I’m going to stop knocking it right
here before I get myself in trouble.

If gitfs ran on the Mac, I’d probably be using it right now to avoid frequent
headaches where git interferes with the simplest pattern of pulling, merging
by hand and pushing all files back if nobody else has committed in the
meantime. I think that’s the motivation behind a library like this, because so
many version control systems get the filesystem metaphor wrong and create two
much friction by touting their various levers.

~~~
calind
There is an update to the docs on how to install it on OSX:
[http://www.presslabs.com/gitfs/docs/usage/](http://www.presslabs.com/gitfs/docs/usage/)

~~~
Dorsai
Followed OS X insx but hit a wall with 'mount.fuse <git repo> <mount/folder>

What is mount.fuse?

I installed Python fuse.py... still poking around...

~~~
Dorsai
Figured it out:

I double checked the install - that everything linked properly etc.

For OS X users do this:

/usr/local/bin/gitfs <remote repo or local git parent folder>
<any/mount/folder>

and then you'll see a new volume mount on the desktop like "OSXFUSE Volume 0
(python 2.7)"

------
seppo0010
Nice. It looks like something I tried a while ago, but never got it stable
enough for someone to actually use:
[https://github.com/seppo0010/gitfuse](https://github.com/seppo0010/gitfuse)

------
filmor
Awesome, I have been looking for something like this for ages. I have already
two use-cases:

1\. At work we store a bunch of IPython notebooks in a git repository (with a
hook to strip them from any output and other non-essential varying data). Up
until now I had to manually or via a scheduled task run "git -A; git commit -m
'Current State.'" on regular intervals.

2\. I'm so gonna use this for my portage-tree, which is taking up a lot of
disk-space on my SSD :).

------
illumen
This might be nice for places where people can't figure out git.

I hope it puts "update" as the commit message ;)

~~~
vtemian
Yeap! Check [https://github.com/vtemian/gitfs-
demo/commits/master](https://github.com/vtemian/gitfs-demo/commits/master) and
you can see how the commit messages look

~~~
michaelmior
How do you get commits with more than one file changed? I assume a commit
happened every time there was a write to a file on disk which can't occur
simultaneously. Do commits just happen on some time interval?

~~~
vtemian
The files are queued and are committed in batches after some idle time.

------
wyldfire
The triumphant return of clearcase‽

~~~
nbardy
At the last company I worked at clearcase never left.

------
kasabali
Looks to have a similar use case scenario in mind with
[https://github.com/commandline/flashbake](https://github.com/commandline/flashbake),
but implemented in a different way. Hopefully it takes off.

------
rco8786
How does it handle merge conflicts?

Seems like an interesting idea, my concern would be that the abstraction of a
filesystem on top of git would break down really quickly once multiples users
started editing things.

~~~
vtemian
Merging is pluggable and the currently implemented strategy is to merge always
accepting the local changes. Actually we are currently using it in an
environment in which multiple edits on the same file can be made and as in the
case of "regular" filesystem the last one closing the file wins. The advantage
is that you will have all the revisions.

------
tughirin
Why would somebody use such a file system? To make life easier when working
with configuration files? I wish they also described their motive for creating
it.

~~~
zalmanu
A developer or sys admin would use it to keep track of changes a site owner
would do via ftp/sftp. We made it for this specific reason. Track everything!
:)

~~~
knowtheory
So is this intended as a single user sort of tool? I'm curious how merges,
conflicts & branching would interact w/ a tool like this, or whether it's just
intended as a way to implement a versioned file system essentially where files
can be rolled back to previous states.

~~~
vtemian
Currently it follows a single branch. The merge strategy is to merge with
local changes taking priority over remote ones but this can be plugged-in.
Rollbacks can be done by copying from history to current version. The only
thing shaky thing is when there is a force push because local commits will be
pushed back.

------
Igglyboo
Is this an alternative to cloning a repo and pushing changes or is this
supposed to be used as a full filesystem? I don't quite understand the blurb.

~~~
zalmanu
Hi. I'm one of the authors of GitFS! It is supposed to work as a fully-fledged
filesystem.

Do you have in mind a particular use case?

~~~
thebouv
No, I think the question is, what do you as an author of the software have in
mind as a particular use case? Some examples of why someone would use this
would be great.

~~~
vtemian
We are using it to expose website code through SFTP to non-developers. Another
possible use case can be publishing static sites using jekyll or another tool.

------
Jasitis
How is it different from SSHFS.Given that both are FUSE & give nearly same
functionality. as in sudo autosshfs-user add $(id -un)

------
bboreham
What's the performance like? That was always the downside of Clearccase - all
the indirecting slugged the machine.

~~~
vtemian
As with performance it really depends on your workload. For mostly reads the
performance should be quite good since access is mostly passtrough. This is
almost true with writes.

Reading on "history" has a small performance penalty since if you are reading
files which are packed they need to be unpacked on the fly.

Listing the "history" is quite fast. We tested on the WordPress repository
that has around 17k commits and it takes ~4s first time and less than 1s
afterwards.

------
baldfat
Besides its use for the work flow for a single person developing an app I fail
to see the case for this system.

~~~
vtemian
It is intended for non-developers so that they can integrate their workflow
with developers working on the same content. It can be used by multiple
persons of course but it's not generally targeted for people developing apps
or for replacing git.

~~~
listic
Same content (set of files) but different files?

Here's the use case I have in mind: let's say I'm a programmer extending a
game [1] built on Undum [2] engine, together with a writer who is writing a
story at the same time [3]

[1] The Play, A dress rehearsal gone horribly wrong, by Deirdra Kiai.
[http://squinky.me/theplay/](http://squinky.me/theplay/)

[2] [http://undum.com/](http://undum.com/)

[3] Story file: view-
source:[http://squinky.me/theplay/theplay.js](http://squinky.me/theplay/theplay.js)

~~~
vtemian
If you work on the same file the content will get versioned like it would when
you use command line git. Also you will get some sort of accountability for
changes.

~~~
listic
And the intent is that developers can access the same data via git. Right?

~~~
vtemian
Yep.

------
grizzles
Wow this is really cool. Too bad it's Ubuntu only. Is anyone working on
getting it running on Fedora?

~~~
akx
Considering it seems to be just Python, I don't see what makes it Ubuntu only.

~~~
grizzles
It doesn't build on fedora. I fixed a few of the obvious problems, but it
looks like there is more to it than that.. I assume that's why they say Ubuntu
only on the Download page.

~~~
vtemian
You need libgit2 >= 0.21.2 compiled(with libssh2 if you want support for ssh).

------
lemoncucumber
I misread the title as GIF FS. I can only imagine what that would consist
of...

~~~
TazeTSchnitzel
Each frame its own file?

------
buddy_tucker
I think I hear my dotfiles calling :)

------
motyar
How to install it?

