icyphox / legit

web frontend for git
https://git.icyphox.sh
MIT License
376 stars 25 forks source link

Proposal for adding archive endpoints to refs #37

Closed gabrielgio closed 1 month ago

gabrielgio commented 2 months ago

Hello,

I'd like to know if you are interested in adding an endpoint to return tar files.

I would add something like:

    mux.HandleFunc("GET /{name}/archive/{ref...}", d.Archive)

It would return a .tar.gz file from this following example:

curl https://git.icyphox.sh/legit/archive/v0.2.2.tar.gz -o /dev/null

The archive is placeholder let me know if want a different path.

For the ui (like in this page^1) I'd add tar.gz next to browse and log

For the implementation I'd do an in-memory implementation, so no storage would be required.

Let me know if you are interested and I can submit the patch myself :smile:

icyphox commented 2 months ago

Hi! Thanks for writing this up! I really like this, and would gladly accept a patch. :)