Hacker News new | ask | show | jobs
by jeroenhd 1664 days ago
Git allows checking out only a limited set of changes with the --depth flag:

    git clone --branch v1.0 --depth 1 https://github.com/example/example.git
The parameter is called --branch but it also takes tags.

It's not as fast as fetching a ZIP file, but it gets pretty close.

From my count, this method only requires one dependency (git) whereas the curl + unzip method requires, well, both curl and unzip.

The zip download method (download, decompress, build, compress into package, decompress onto system) is already silly enough, the first decompression part can easily be dropped.

1 comments

> It's not as fast as fetching a ZIP file, but it gets pretty close.

In the context of distro packages (the bug report mentioned OpenBSD and Fedora) you might be building tens of thousands of packages of which thousands are likely to come from GitHub. A small difference becomes greatly magnified.

> From my count, this method only requires one dependency (git) whereas the curl + unzip method requires, well, both curl and unzip.

You’re forgetting that git itself depends on curl.