jachin / gitsync Goto Github PK
View Code? Open in Web Editor NEWThis tool allows a developer to work on files on their local machine and have their work synced on a remote system. It uses git to manage the syncing process.
License: MIT License
This tool allows a developer to work on files on their local machine and have their work synced on a remote system. It uses git to manage the syncing process.
License: MIT License
When files get pulled down the file system monitoring triggers syncs for everyone. When it needs to to a pull it should turn off the file system monitoring and then do that. Then maybe do a check after the pull to make sure nothing has chanced in the mean time.
If the directory specified in the local_path
of the config is already there, git syn complains about a missing repository.
fatal: Not a git repository (or any of the parent directories): .git
It should give a more helpful error message, and ideally, it would use the directory anyway as long as it was empty and complain if it wasn't.
Allow configuration files to inherit from each other, so a config file can specify a parent, then just overwrite the settings it needs to. This would be really handy for all the "ignore" stuff.
Example:
If local path in yaml file reads:
local_path: /Users/andy/Files/folder_to_sync
But the actual directory structure exists as:
Users -> andy -> files -> folder_to_sync
GitSync will start fine, and I think even perform the initial sync. But once a filesystem change event occures, this exception is thrown. My guess is that fsevents.py discriminates against case insensitivity, whereas other libraries and tools in use do not.
The following is the error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fsevents.py", line 73, in run
loop(self)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fsevents.py", line 166, in __call__
snapshot = self.snapshots[path]
KeyError: '/Users/andy/files/folder_to_sync/some_sub_folder_that_had_change'
There's too much output be default. We should make it less chatty with the ability to see more information optionally.
Not exactly sure the best way to do this, but set it up so it can be installed.
If a sync fails do not just die.
Instead say the sync failed and try again the next time a sync is triggered.
Currently we are using ini files. It's a little awkward. Need to upgrade to YAML. http://www.yaml.org/
Or at least not notify and push if something nothing was found.
Do any of you get this after having it not sync for awhile?
[[email protected]] Executing task 'remote_has_modified_files'
No handlers could be found for logger "paramiko.transport"
sync failed.
<class 'socket.error'>
(54, 'Connection reset by peer')
[Errno 54] Connection reset by peer
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in bootstrap_inner
self.run()
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fsevents.py", line 73, in run
loop(self)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fsevents.py", line 218, in __call
self.callback(event)
File "/usr/bin/git_sync", line 391, in callback
if run_remote_has_modified_files():
File "/usr/bin/git_sync", line 333, in run_remote_has_modified_files
remote_path=remote_path
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/tasks.py", line 368, in execute
multiprocessing
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/tasks.py", line 264, in _execute
return task.run(_args, *_kwargs)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/tasks.py", line 171, in run
return self.wrapped(_args, *_kwargs)
File "/usr/bin/git_sync", line 91, in remote_has_modified_files
git_status_output = run("git status --porcelain .")
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/network.py", line 578, in host_prompting_wrapper
return func(_args, *_kwargs)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/operations.py", line 1042, in run
shell_escape=shell_escape)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/operations.py", line 909, in _run_command
channel=default_channel(), command=wrapped_command, pty=pty,
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/state.py", line 388, in default_channel
chan = _open_session()
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fabric/state.py", line 380, in _open_session
return connections[env.host_string].get_transport().open_session()
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paramiko/transport.py", line 662, in open_session
return self.open_channel('session')
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paramiko/transport.py", line 764, in open_channel
raise e
error: [Errno 54] Connection reset by peer
If the remote file "file.png" doesn't have the correct permissions, the following error happens on the initial sync:
[[email protected]] Executing task 'initial_sync'
[[email protected]] Setting up /remote/dir/
[[email protected]] The git repo already exist: /remote/dir/.git
[localhost] local: git clone ssh://example.com/remote/dir/ /local/dir/
Cloning into '/local/dir'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
[localhost] local: git branch branch
[localhost] local: git checkout branch
Switched to branch 'branch'
[[email protected]] /remote/dir/ (remote) has uncommitted changes.
[[email protected]] run: git add .
[[email protected]] out: error: open("file.png"): Permission denied
[[email protected]] out: error: unable to index file file.png
[[email protected]] out: fatal: adding files failed
[[email protected]] out:
Fatal error: run() received nonzero return code 128 while executing!
Requested: git add .
Executed: /bin/bash -l -c "cd /remote/dir/ && git add ."
Aborting.
To get the initial sync to work again (after fixing the permissions issue), you need to delete both the local directory, and the ".git" directory from the remote server.
Add a setup.py that will take care of the install. Look at gacli for an example for how to set that up so it can run from a virtualenv.
GitSync could be cross platform if it used the watchdog library instead of fsevents.
https://pypi.python.org/pypi/watchdog
there's some issue where changes from one client branch are not making it on to a different client's branch. Probably an issue with how git is being used.
GitSync should support different notification systems depending on what operating system it's on and what is available. This should also be configurable via project config files (and a global config file).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.