With a recent Git, if I want to clone only a specific directory of a repo with minimal fluff, I can do something like:
$ mkdir zig
$ cd zig
$ git init
$ git remote add origin https://github.com/ziglang/zig.git
$ git fetch --depth 1 --filter=tree:0 origin bedf806672d9e00203f9942c62887b271d12eb7f
$ git sparse-checkout init --no-cone
$ git sparse-checkout set /src
$ git checkout bedf806672d9e00203f9942c62887b271d12eb7f
(The resulting repo is only 24M; a regular clone is 535M.)
It seems to me that it would be useful for the package manager to support some moral equivalent of this. I'm thinking, in particular, of making it less wasteful to depend on a library that lives in a monorepo.
I'm not sure what the url syntax should look like, though; ideas welcome. Maybe something like git+https://github.com/ziglang/zig.git#bedf806672d9e00203f9942c62887b271d12eb7f@src?
With a recent Git, if I want to clone only a specific directory of a repo with minimal fluff, I can do something like:
(The resulting repo is only 24M; a regular clone is 535M.)
It seems to me that it would be useful for the package manager to support some moral equivalent of this. I'm thinking, in particular, of making it less wasteful to depend on a library that lives in a monorepo.
I'm not sure what the
urlsyntax should look like, though; ideas welcome. Maybe something likegit+https://github.com/ziglang/zig.git#bedf806672d9e00203f9942c62887b271d12eb7f@src?