Git Repo Update 2

I have made another change to the git repo handling code so that when publishing, only the repos that have been updated are added to IPFS again. This way, large repos only slow down the publish process when they are updated and not every time any repository is updated. The new process is this:

  1. post-update hook adds its path to the spool directory
  2. Monitor process sees update and starts publish
  3. The existing repo is added to a temporary directory in the mutable file system (MFS)
  4. For each updated repo:
    1. The repo is added to ipfs without pinning
    2. The directory for that repo in MFS is removed and replaced with the new hash
  5. The old hash is unpinned and the new hash pinned
  6. The root hash of the new repo directory structure is published
  7. Remove temporary directory from MFS

Now, git push is almost exactly the same speed as a plain ssh remote (only an additional flag set), the update is fast for small repositories and only slows down when processing a large repo.

As always, there is still room for improvement. Adding the repositories could be either added beginning with the smallest and updating the publish as it completes each repo add, or the repo adds could be done in parallel and update the publish as each finished.

Comments