Skip to content

migrate-bundles 的 dry-run 不显示 source_sha 补写 #44

Description

@SongshGeo

scripts/migrate-bundles.mjs 第三步(补写缺失的 source_sha)被这个条件包住:

if (write || planned.length === 0) {

于是在有其它变更的 dry-run 里,这一步完全不出现在计划里——用户看到的
「N change(s) planned」少报了将要写入的 sha。等到加上 --write,实际发生的
改动比预告的多。dry-run 的全部意义就是「先看清楚会发生什么」。

写成这样是因为 sha 要在迁移后的树上算,而 dry-run 时树还没动。

建议

dry-run 时把这一步也列出来(可以标成「stamp-sha (after move)」),或者在
内存里模拟迁移后的路径再算。至少不能静默少报。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions