omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Pythonista sync between 1.5, 1.6, GitHub

    Pythonista
    1.6 github 1.5
    3
    8
    7554
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Webmaster4o
      Webmaster4o last edited by

      Would it be possible to write a script compatible with both 1.5 and 1.6 that syncs files across multiple devices through GitHub?

      I could have a repo called Pythonista in my github. Any changes I made would be saved to Github, maybe by running a script manually. Then, when I opened pythonista on either device, the files would be replaced with those from GitHub. Therefore, all files would be synced across devices.

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        It might be tricky if you actually use git elsewhere -- not sure what would happen if you have a repo that contains other repos. For instance all of the hidden .git files would need to get synced. That should work, but will br annoying to fix if you ever have to merge manually.

        Otherwise... it should be possible to have the Documents folder be a top level repo, this should be doable now in stash.. To add all files, you would have to do a

        git add *
        git add */*
        ....
        git add */*/*/*/*/*/*.....
        

        (or else we could add a new switch to git add that does a full tree walk). You will need to be diligent about always doing a git pull before starting work on a device, and a commit and push when finished, otherwise you will easily get out of sync and have to use merge... while get merge does work in stash, It can be tricky, and ai am not sure how many people have actually used it other than me. It is also embarrassingly easy to cause work to be lost in the current stash git implementation.

        1 Reply Last reply Reply Quote 1
        • Webmaster4o
          Webmaster4o last edited by

          Is it possible to put this in pythonista_startup.py?

          1 Reply Last reply Reply Quote 0
          • JonB
            JonB last edited by

            yes, but i wouldn't advise it... i think it would be very time consuming, for instance it pythonista crashes you might be waiting several minutes for it to get going again.
            Maybe you could keep a log of how long it has been since the last time it ran.

            To avoid dangerous overwriting of in process work, i would recommend doing a git fetch, but then only manually use git merge to merge origin into your current work, after first committing the current working copy. This should then let you git push.

            This will be extremely slow, as currently we have thin packs turned off (dulwich issue), so as a result, every time you sync the entire history will be transferred. I have a kludge that enables thin packs, but was waiting until dulwich incorporated a fix.

            1 Reply Last reply Reply Quote 1
            • Webmaster4o
              Webmaster4o last edited by Webmaster4o

              If I decide I don't care about GitHub is there an easier solution using dropbox/iCloud drive?

              EDIT:
              FTP sync should work well, I think my deentaylor.com domain server supports FTP accounts. I can create a folder on my server called Pythonista, and then create a special FTP account to modify it.

              1 Reply Last reply Reply Quote 0
              • Gerzer
                Gerzer last edited by

                I wrote an FTP sync script specifically for this type of situation, feel free to use it.

                1 Reply Last reply Reply Quote 0
                • Webmaster4o
                  Webmaster4o last edited by

                  Yeah. I'm not sure I've gotten it working, but I'll see.

                  1 Reply Last reply Reply Quote 0
                  • Gerzer
                    Gerzer last edited by

                    @Webmaster4o If you are having problems, please tell me. I need all the bug reports I can get.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB Forums | Contributors