Skip to content

feat(forge): forge install should run git submodule sync #9611

@CodeSandwich

Description

@CodeSandwich

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.3.0 (68aff72 2024-12-31T00:22:19.465395448Z)

What command(s) is the bug in?

forge install

Operating System

Linux

Describe the bug

I have a fork (https://github.com/CodeSandwich/era-contracts/) of a repo (https://github.com/matter-labs/era-contracts) that I want to use as a dependency. I had the upstream installed as a dependency, so to keep it clean I uninstalled it (git rm lib/era-contracts && git commit, which removed lib/era-contracts and the entry from .gitmodules) and installed it again with forge install CodeSandwich/era-contracts. The installation succeeded, it added the appropriate [submodule "lib/era-contracts"] to .gitmodules along with the correct url = https://github.com/CodeSandwich/era-contracts, but when I go to lib/era-contracts, it's the upstream that is installed. When I cd lib/era-contracts/ and git remote, I get just origin, but git remote get-url origin returns https://github.com/matter-labs/era-contracts, which is the upstream. Of course I can't check out my fork's branch in the installed dependency submodule, it's the upstream after all. Also when doing forge install CodeSandwich/era-contracts@fix_system_contracts which is my branch, I get Error: Tag: "fix_system_contracts" not found for repo "https://github.com/CodeSandwich/era-contracts"!, which is wrong but makes some sense since forge installs the upstream, but it also seems aware that I'm asking for the fork.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Cmd-forge-pmCommand: forge install/update/removeT-featureType: featureT-to-discussType: requires discussion

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions