Skip to content

Conversation

@petersalomonsen
Copy link
Contributor

@petersalomonsen petersalomonsen commented Dec 22, 2019

This takes a different approach than #4400 as there are hardly any changes to existing code. A separate transport is added for emscripten, and the built-in examples are used for calling from js (added an extra example for commit). Instead of adding a workaround for emscripten mmap, I've submitted a PR for handling offset emscripten-core/emscripten#10095, and emscripten-core/emscripten#10526.

Would be great with some feedback on this approach compared to my previous pull-request (#4400).

@petersalomonsen
Copy link
Contributor Author

added example for push and also a local git http server for testing.

add http transport for emscripten
add example for git commit
fix example for git add
add example for git push
add synchronous http worker for nodejs
add web http support using sync XmlHttpRequest
add nodejs and webworker examples for interacting with libgit2.js
@pks-t
Copy link
Member

pks-t commented Feb 22, 2020

I'm still not sure about whether we want to support Emscripten in libgit2 directly, which is probably why I've deferred reviewing this for so long. Sorry about that! I'd imagine that we should treat Emscripten the same as we do treat bindings: provide the required bits in order to make it work together so that you can live as a downstream user of libgit2.

As far as I see, the only real change required on our side is swapping out the HTTP transport. I'm honestly not too keen to include the Emscripten transport directly, but we already provide git_transport_register with which you can register an externally hosted Emscripten transport. The only thing we'd have to do is make the HTTP transport build-time configurable, which I'd be fine with.

Does the above make sense to you? Do you feel like this is a feasible way to go?

Anyway, I'd definitely like to pull in your changes to our examples. Would you like to spin up a separate PR for them?

@petersalomonsen
Copy link
Contributor Author

Yes that sounds like a good idea. Good to get this clarified.

If HTTP transport can be configurable at build time, I can set up a separate project for emscripten and reference libgit2 from there.

And yes, I'll look into making a separate PR for the examples.

Thanks for review and response :-)

@ethomson
Copy link
Member

Thanks @petersalomonsen for your patience. And thanks @pks-t for this wonderful suggestion. I think that this is a great path forward.

I'm really thrilled to see that there is so little code churn. emscripten seems to have become incredibly mature! The mmap support in particular is great to see.

@petersalomonsen
Copy link
Contributor Author

@pks-t
Copy link
Member

pks-t commented Feb 23, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants