libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.58k stars 382 forks source link

Support for creating zip archives #1239

Open OpenBagTwo opened 8 months ago

OpenBagTwo commented 8 months ago

Given that pygit2 is probably the best option for Python developers building cross-platform Git applications When a Windows (or, to a lesser extent) Mac user wants to create an archive, equivalent to using the git archive command, Then they probably are going to want to create a zip archive So that archive can be opened easily with their system's default file explorer

pygit2.Repository.write_archive currently only supports tarfiles.

I have written my own version of this method that I would like to contribute back to the project which supports creating zip archives, to the extent possible with the zipfile library (read: does not support symlink).

If that is something the maintainers would be interested in, please let me know, and I'll rework this into a PR that adds the code to repository.py and matches the existing style guide.

Thanks for building and maintaining such a stellar library!