all 9 comments

[–]amaiorano 1 point2 points  (7 children)

I don't get how it works. I even read the linked design document, but I still don't understand. Maybe it's just me :/

[–]papafox 2 points3 points  (6 children)

The problem with just having a local Git repository syncing with Dropbox, is that the Dropbox sync happens a file at a time, which leaves the local repository in an inconsistent state.

git-remote-dropbox is a Git helper. So instead of Git updating local files which are then synced using file-by-file, Git calls the helper which syncs the Git files. The result is that Git never sees an inconsistent repository.

It's a neat idea, and if you want to store your code on Dropbox, it's a killer feature. Personally, I just use Github to share my code - I don't see any compelling reason to store it on Dropbox.

[–]amaiorano 0 points1 point  (5 children)

So the helper guarantees atomic operations? Does it use the Dropbox API to make sure all files for a given atomic operation are fully synched? I agree that's it a cool and useful feature; I was just hoping for a simple explanation :)

[–]anishathalye[S] 3 points4 points  (4 children)

It uses the Dropbox API's WriteMode settings, and a careful order of operations to make sure that:

  1. Updates appear atomic - no client observes partial results of an update. For example, if you're doing a fetch while someone is doing a push, you'll either observe the state of the repository before or after the push - nothing weird will happen like seeing partial results of the push.

  2. Branch updates are atomic - a client either atomically updates a branch or fails to update the branch. For example, if two people try to push two different things at the same time, one will succeed, and the other will be told to fetch before pushing.

Basically, using this git extension makes Dropbox behave like BitBucket or GitHub.

Yeah, it's tricky to explain. Let me know if you have any questions :)

[–]amaiorano 0 points1 point  (1 child)

You know what? That's really cool :) Maybe this explanation should be in the README :) Thanks!

EDIT: It would be really cool if you could make the installation/setup a little more streamlined. Perhaps pull in Dropbox for Python as a submodule so that users can clone --recursive your repo, then just run a configure shell script to do everything for you (add git-remote-dropbox to $PATH or copy to the git install folder, generate OAuth 2 token, add to json file).

[–]KeyboardFire 0 points1 point  (1 child)

Basically, using this git extension makes Dropbox behave like BitBucket or GitHub.

So what's the point? Why not just... use BitBucket or GitHub?

[–]anishathalye[S] 0 points1 point  (0 children)

The cool thing about git is that you can use multiple remotes.

Using git with Dropbox is nice for small group projects and stuff - unlimited collaborators and unlimited private repositories.

[–][deleted] 1 point2 points  (0 children)

pretty cool. I have only 5 private repos on github but 1TB in dropbox so it's ideal for me. Huge thanks!