rhcarvalho

rhcarvalho

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 --depth flag to git (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 :subdir in 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.

First 2 of 2 Posts Switch mode

rhcarvalho

rhcarvalho OP

For (perhaps my own) reference, this is the PR that added :subdir back in July 2021: mix deps: Add :subdir option to git deps by wojtekmach · Pull Request #11125 · elixir-lang/elixir · GitHub

josevalim

josevalim

Creator of Elixir

I would accept a PR for --depth but we need to be careful with what happens when you initially clone a repo with --depth 1 and then you change it to point to another reference. Our code needs to be smart enough to know that it needs to fetch something more recent.

— All posts loaded —

Where Next? Top

Trending in Proposals: Ideas Top

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement