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

Untracked changes foundry #42

Merged
merged 3 commits into from
Jun 10, 2024
Merged

Untracked changes foundry #42

merged 3 commits into from
Jun 10, 2024

Conversation

technophile-04
Copy link
Collaborator

@technophile-04 technophile-04 commented Jun 3, 2024

Description :

When you do :

npx create-eth@latest 

and choose foundry, you get untracked changes:
Screenshot 2024-06-03 at 7 57 08 PM

Lol spend alot of time debugging this and this was best / minimal I could come up with.

I am completely not sure why this happening, but main reason seems OZ master branch and latest tag released divert a bit. Checkout master vs v5 release and some removing / adding of files from v4 => v5 which are not properly reflected in gitsubmodules.

There might some better approaches, but wasn't able to find any good working solution.

One better solution will be to use forge install instead of manually running git submodule but we are assuming that when people use CLI they be some case when forge is not installed and hence we show them

\t${chalk.bold.yellow("(NOTE: Foundryup is not installed in your system)")}

@technophile-04 technophile-04 assigned carletex and rin-st and unassigned carletex and rin-st Jun 3, 2024
@technophile-04 technophile-04 requested review from carletex and rin-st June 3, 2024 15:26
@rin-st
Copy link
Member

rin-st commented Jun 4, 2024

Lol spend alot of time debugging this and this was best / minimal I could come up with.

Same 😄

I am completely not sure why this happening, but main reason seems OZ master branch and latest tag released divert a bit. Checkout master vs v5 release and some removing / adding of files from v4 => v5 which are not properly reflected in gitsubmodules.

I think you already seen this https://github.com/OpenZeppelin/openzeppelin-contracts?tab=readme-ov-file#foundry-git . For some reason when initial commit is created

    await execa("git", ["add", "-A"], { cwd: targetDir });
    await execa("git", ["commit", "-m", "Initial commit with 🏗️ Scaffold-ETH 2", "--no-verify"], { cwd: targetDir });

last tag doesn't work and it always points to master. When we're doing

if (options.extensions?.includes("foundry")) {
      await execa("git", ["submodule", "update", "--init", "--recursive"], {
        cwd: path.resolve(targetDir, "packages", "foundry"),
      });
    }

it updates to last tag, and hence it can differ from master.


I tried to add another commit at the end (doesn't work since it don't see changed files) or do --ammend (still points to master) and other things but didn't find something adequate

So I think your solution is good, until they bump it to v6 :)

Gj!

Copy link
Collaborator Author

@technophile-04 technophile-04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tysm @rin-st for tinkering !!

So I think your solution is good, until they bump it to v6 :)

Ohh yes not the best, but merging this as hotfix since v6 is far but yeah def let's try to find a better / more generic solution 🙌

@technophile-04 technophile-04 merged commit a2c8bab into main Jun 10, 2024
1 check passed
@technophile-04 technophile-04 deleted the untracked-changes branch June 10, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants