Hi all,
I would like to gather some feedback before a more intentional proposal to add a new :depth option when specifying a Git dependency on mix.exs.
I noticed that Mix Git dependencies have several smart options, including :ref and :sparse, but there is no way to tell mix to make shallow clones for use cases where the full repository history is not needed.
Shallow clones have the potential to reduce the space in disk for dependencies installed from Git/GitHub, as well as save time on deployments/CI by downloading less data.
One use case for me is to depend on a tagged version of Heroicons by pulling in as little data as possible (see Vendored heroicons take up considerable space on new projects · Issue #5622 · phoenixframework/phoenix · GitHub).
Would your workflows benefit from such new :depth option? Would you prefer having something else instead?
Notes
- Impact on existing eco-system: I think minimal. The change would add one more line in the Mix documentation linked above, code changes to pass the
--depthflag togit(though I’m not familiar with how Git integration is actually implemented yet). The option can be safely ignored by most people, and appreciated by those who need it. - Impact on learning: No one needs to learn about this until they need to use it (and then they might bring their Git knowledge from elsewhere anyway).
- I have not found similar suggestions in the past. I found that the most recent addition was
:subdirin Elixir 1.13.
If the community finds this useful and a proposal would be accepted, I would like to work on it and submit a PR.






















