Now that clone/fetch is working, push is the next step.
For now, I just plan to add commits to a remote, and print the new root hash of that repo. Updating IPNS entries will come later.
I'm also not sure if I can update the local path of the remote that was used after a push. Might need a 'git remote rm ipfs $oldHash && git remote add ipfs $newHash' dance until ipns is added... (dislike..)
For the mechanics: When running git push with an ipfs origin, git asks the helper for a list of remote refs (just like with fetch, but with the for-push argument, not sure what that is about)
>list for-push
<3f7ba9486ffcaa277b28598c7bfc061bffcfb10e HEAD
<3f7ba9486ffcaa277b28598c7bfc061bffcfb10e refs/heads/master
Next, git will send one ore more push <src>:<dst> commands.
>push refs/heads/master:refs/heads/master
At that point I already know the hash of that remote ref (I just received it myself). I think the idea is, to walk down the history of the local repo (GIT_DIR) and find that remote ref. Everything up from that point, are the commits we need to push.
Open questions:
Now that clone/fetch is working, push is the next step.
For now, I just plan to add commits to a remote, and print the new root hash of that repo. Updating IPNS entries will come later.
I'm also not sure if I can update the local path of the remote that was used after a push. Might need a 'git remote rm ipfs $oldHash && git remote add ipfs $newHash' dance until ipns is added... (dislike..)
For the mechanics: When running
git pushwith an ipfs origin, git asks the helper for a list of remote refs (just like with fetch, but with the for-push argument, not sure what that is about)Next, git will send one ore more
push <src>:<dst>commands.At that point I already know the hash of that remote ref (I just received it myself). I think the idea is, to walk down the history of the local repo (
GIT_DIR) and find that remote ref. Everything up from that point, are the commits we need to push.Open questions:
.git/object/ab/cdefs..or do I need to update some index? Refs at least, I guess.ipfs://newto publish new repos?