Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forge install modifies top-level .gitmodules in existing project repo instead of where foundry.toml lives #3962

Open
2 tasks done
opqpop opened this issue Dec 26, 2022 · 1 comment · May be fixed by #9695
Open
2 tasks done
Labels
C-forge Command: forge Cmd-forge-pm Command: forge install/update/remove T-bug Type: bug T-to-investigate Type: to investigate
Milestone

Comments

@opqpop
Copy link

opqpop commented Dec 26, 2022

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (d3d8c0b 2022-12-26T00:04:10.853709324Z)

What command(s) is the bug in?

forge install

Operating System

Linux

Describe the bug

Repro

  • Make any git repro so you have an existing repro. For ex: src/admin, src/analysis, src/some_project, src/blockchain_proj, also touch .gitmodules so there's one at the top level

image

  • blockchain_proj needs to write .sol, so will use foundry. Go make the backend there w/ cd src/blockchain_proj && foundry init backend_contract_proj1

  • cd backend_contract_proj1, Run forge install openzeppelin/openzeppelin-contracts --no-commit

This will add new code into my top-level .gitmodules, instead of creating a src/blockchain_proj/backend_contract_proj1/.gitmodules, which is diff from how npm, pip/poetry, etc all do it. They will detect the top-level "for the project" (i.e. where foundry.tml lives @ src/blockchain_proj/backend_contract_proj1/foundry.toml) and modify any .git files there, instead of always going all the way up to the top of the root.

What's the best way to get forge install to stop doing this? I tried creating a src/blockchain_proj/backend_contract_proj1/.gitmodules but everytime I install it still installs into my top-level .gitmodules and I have to copy paste it over

@opqpop opqpop added the T-bug Type: bug label Dec 26, 2022
@2facedsquid
Copy link

any update on this? having the same issue and its annoying

@zerosnacks zerosnacks added C-forge Command: forge Cmd-forge-pm Command: forge install/update/remove T-to-investigate Type: to investigate labels Jun 27, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-pm Command: forge install/update/remove T-bug Type: bug T-to-investigate Type: to investigate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants