Open sambacha opened 9 months ago
Confirmed just in case
$ forge install foundry-rs/forge-std@v1.7.6
Installing forge-std in /Users/janitor/tstorish/lib/forge-std (url: Some("https://github.com/foundry-rs/forge-std"), tag: Some("v1.7.6"))
Cloning into '/Users/janitor/tstorish/lib/forge-std'...
remote: Enumerating objects: 2168, done.
remote: Counting objects: 100% (2164/2164), done.
remote: Compressing objects: 100% (722/722), done.
remote: Total 2168 (delta 1436), reused 2070 (delta 1375), pack-reused 4
Receiving objects: 100% (2168/2168), 610.57 KiB | 2.81 MiB/s, done.
Resolving deltas: 100% (1436/1436), done.
Submodule 'lib/ds-test' (https://github.com/dapphub/ds-test) registered for path 'lib/ds-test'
Cloning into '/Users/janitor/tstorish/lib/forge-std/lib/ds-test'...
remote: Enumerating objects: 313, done.
remote: Counting objects: 100% (171/171), done.
remote: Compressing objects: 100% (79/79), done.
remote: Total 313 (delta 91), reused 132 (delta 83), pack-reused 142
Receiving objects: 100% (313/313), 71.35 KiB | 1.32 MiB/s, done.
Resolving deltas: 100% (130/130), done.
Installed forge-std v1.7.6
01:59:55 Sat Feb 24 2024 janitor macbook /Users/janitor/tstorish feat/simple-tests
$ cat .gitmodules
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
branch
field can only contain a branch name in the specified repository, not a tag name.
Currently when installing submodule, forge tries to find a branch with the same name as the tag, and only if it's found, the branch
field is populated
branch
field can only contain a branch name in the specified repository, not a tag name.Currently when installing submodule, forge tries to find a branch with the same name as the tag, and only if it's found, the
branch
field is populated
$ forge install -h
Install one or multiple dependencies
Usage: forge install \[OPTIONS\] \[DEPENDENCIES\]...
forge install \[OPTIONS\] \<github username>/\<github project>@\<tag>...
forge install \[OPTIONS\] \<alias>=\<github username>/\<github project>@\<tag>...
forge install \[OPTIONS\] \<https:// git url>...
$ forge install /transmissions11/solmate@c892309933b25c03d32b1b0d674df7ae292ba925
Resolving deltas: 100% (130/130), done.
Installed solmate c892309933b25c03d32b1b0d674df7ae292ba925
08:11:40 Mon Feb 26 2024 janitor macbook /Users/janitor/solmate-tmp master
$ cat .gitmodules
\[submodule "lib/forge-std"\]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
\[submodule "lib/solmate"\]
path = lib/solmate
url = [https://github.com//transmissions11/solmate](https://github.com//transmissions11/solmate)
Forge uses 'tag' to mean any git commit hash, the behaviour is true in that regard. As you mention git submodules does not explicitly support proper git tags, however this is just really an alias for some git commit hash really.
Hi @sambacha, thanks for reporting this
Confirming this issue is still active (cc @klkvr)
I've created a minimal reproduction here: https://github.com/zerosnacks/foundry-bug-7225-repro that has a practical example people run into relating to the 0.8
branch of Uniswap V3 + forge update
.
we're going to add --branch/--tag
args with https://github.com/foundry-rs/foundry/issues/5996 and then use them to pin it to specific branch.
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (a436a0d 2024-02-20T00:25:57.253479000Z) && forge 0.2.0 (6d5de51 2024-02-23T00:19:38.512335000Z)
What command(s) is the bug in?
forge install
Operating System
macOS (Apple Silicon)
Describe the bug
Running this install,
solidstate-network/solidstate-solidity@v0.0.59
After we inspect
.gitmodules
and findHowever we want the
.gitmodules
file to reflect this correct configuration