I could not reproduce it. I’m probably not trying to do the thing that is broken?!
Here’s what I’ve done:
- Fresh Elixir 1.17.1 env:
$ cat Dockerfile
FROM docker.io/hexpm/elixir:1.17.1-erlang-27.0-debian-bookworm-20240701-slim
RUN apt-get update && apt-get install -y git vim && rm -rf /var/lib/apt/lists/*
RUN mix new app
WORKDIR /app
$ podman build -t elixir-1.17.1 .
$ podman run --rm -it elixir-1.17.1
- Configure deps using
ref
and depth
:
$ vim mix.exs
$ sed -n '/defp deps/,/end/p' mix.exs
defp deps do
[
{:heroicons,
github: "tailwindlabs/heroicons",
ref: "c1b192b8cd0f1b3c569d25ba995d170f3db86039",
sparse: "optimized",
app: false,
compile: false,
depth: 1},
]
end
- Fetch first time:
$ mix deps.get
* Getting heroicons (https://github.com/tailwindlabs/heroicons.git - c1b192b8cd0f1b3c569d25ba995d170f3db86039)
remote: Enumerating objects: 2405, done.
remote: Counting objects: 100% (2405/2405), done.
remote: Compressing objects: 100% (2178/2178), done.
remote: Total 2405 (delta 277), reused 1905 (delta 217), pack-reused 0
- Sanity checks:
$ cat mix.lock
%{
"heroicons": {:git, "https://github.com/tailwindlabs/heroicons.git", "c1b192b8cd0f1b3c569d25ba995d170f3db86039", [ref: "c1b192b8cd0f1b3c569d25ba995d170f3db86039", sparse: "optimized", depth: 1]},
}
$ git -C /app/deps/heroicons log --oneline
c1b192b (grafted, HEAD) 2.1.4
- Downgrade to a previous commit:
$ vim mix.exs
$ sed -n '/defp deps/,/end/p' mix.exs
defp deps do
[
{:heroicons,
github: "tailwindlabs/heroicons",
ref: "01c786b0353c7e51b86bc903a329e81d7578333d",
sparse: "optimized",
app: false,
compile: false,
depth: 1},
]
end
- Fetch second time, updating repo:
$ mix deps.get
* Updating heroicons (https://github.com/tailwindlabs/heroicons.git - 01c786b0353c7e51b86bc903a329e81d7578333d)
remote: Enumerating objects: 2405, done.
remote: Counting objects: 100% (2405/2405), done.
remote: Compressing objects: 100% (2179/2179), done.
remote: Total 2405 (delta 277), reused 1901 (delta 216), pack-reused 0
- Sanity checks:
$ cat mix.lock
%{
"heroicons": {:git, "https://github.com/tailwindlabs/heroicons.git", "01c786b0353c7e51b86bc903a329e81d7578333d", [ref: "01c786b0353c7e51b86bc903a329e81d7578333d", sparse: "optimized", depth: 1]},
}
$ git -C /app/deps/heroicons log --oneline
01c786b (grafted, HEAD) 2.1.3
- Upgrade to an intermediate commit:
$ vim mix.exs
$ sed -n '/defp deps/,/end/p' mix.exs
defp deps do
[
{:heroicons,
github: "tailwindlabs/heroicons",
ref: "cafc7d6cb6c2233b07667ae1fb77a43866a333e3",
sparse: "optimized",
app: false,
compile: false,
depth: 1},
]
end
$ mix deps.get
* Updating heroicons (https://github.com/tailwindlabs/heroicons.git - cafc7d6cb6c2233b07667ae1fb77a43866a333e3)
remote: Enumerating objects: 2405, done.
remote: Counting objects: 100% (2405/2405), done.
remote: Compressing objects: 100% (2179/2179), done.
remote: Total 2405 (delta 277), reused 1902 (delta 216), pack-reused 0
- Sanity checks:
$ cat mix.lock
%{
"heroicons": {:git, "https://github.com/tailwindlabs/heroicons.git", "cafc7d6cb6c2233b07667ae1fb77a43866a333e3", [ref: "cafc7d6cb6c2233b07667ae1fb77a43866a333e3", sparse: "optimized", depth: 1]},
}
$ git -C /app/deps/heroicons log --oneline
cafc7d6 (grafted, HEAD) use `size-*` instead of `w-* h-*` (#1182)
All of the above seems to be working as expected for me. The deps.get
works and the repository has the correct commit with depth 1.
I wonder what did I miss in the steps above?