docs(engineering): 补充大仓子模块按钉死 commit 浅取

- 新增 esp32-wifi-lib 等大仓子模块的 pinned-commit shallow fetch 修复
- 说明 --depth=1 submodule update 的 Unable to find current revision 陷阱
- 补充 deinit 后按实际 status 路径重拉的纪律
This commit is contained in:
Shinku committed 2026-09-09 10:13:17 +08:00
1 parent f7ac6db5f9
commit ebdb0e427c
4 files changed
+80 -2

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@
- Added the supplied 80-byte CW2017 profile for the specified 520 mAh cell, including content/update-flag checks, verified writes, the required restart sequence, and bounded SOC-readiness polling.
- Expanded the environment bootstrap document: added Espressif's Git service mirror (`git.espressif.com.cn`) as the preferred mainland-China route for ESP-IDF v5.5.3 and its submodules, documented submodule long-wait/timeout handling and in-place repair, warned about stale per-repository Jihulab `insteadOf` residue, and added the official offline release archive as a last-resort fallback (learned from `esp-mosaico/esp-mosaico-vibe`).
- Expanded the environment bootstrap document: added Espressif's Git service mirror (`git.espressif.com.cn`) as the preferred mainland-China route for ESP-IDF v5.5.3 and its submodules, documented submodule long-wait/timeout handling, in-place repair, and the pinned-commit shallow fetch for large submodules such as `esp32-wifi-lib`, warned about stale per-repository Jihulab `insteadOf` residue, and added the official offline release archive as a last-resort fallback (learned from `esp-mosaico/esp-mosaico-vibe`).
- Reorganized the documentation by function area with a dual entry point: the root `AGENTS.md` is now a thin router (hard constraints + task routing only) and the detailed AI workflow lives in `docs/development/ai-guide.md`; `agent-guide.md` was folded in. `docs/development/` gained a second level (`engineering/`, `ci/`, `release/`), and the `plays/` application archive and `experiences/` moved into a `docs/reference/` area with a dedicated README. Removed `docs/software-design/` (empty scaffold); folded the three `assets/{fonts,images,music}/README` leaves into the `assets/` README; flattened the six `project-completion` sub-documents into a single file; and unified each directory to a single README, eliminating every `INDEX` file and a duplicated experience index. All cross-references and bibliographic links were updated; no content was dropped.
+1 -1
View File
@@ -8,7 +8,7 @@
- 加入厂家为优特利 520mAh 电芯生成的 80 字节 CW2017 profile,并实现内容与更新标志检查、写入后校验、规定的重启时序以及有上限的 SOC 就绪等待。
- 扩充环境引导文档:新增乐鑫 Git 服务镜像(`git.espressif.com.cn`)作为中国大陆首选线路,覆盖 ESP-IDF v5.5.3 及其子模块;补充子模块长等待/超时处理与原地修复;提示按仓库残留的 Jihulab `insteadOf` 旧配置;并把官方离线 release 压缩包加入兜底方案(经验来自 `esp-mosaico/esp-mosaico-vibe`)。
- 扩充环境引导文档:新增乐鑫 Git 服务镜像(`git.espressif.com.cn`)作为中国大陆首选线路,覆盖 ESP-IDF v5.5.3 及其子模块;补充子模块长等待/超时处理、原地修复,以及 `esp32-wifi-lib` 等大仓的按钉死 commit 浅取;提示按仓库残留的 Jihulab `insteadOf` 旧配置;并把官方离线 release 压缩包加入兜底方案(经验来自 `esp-mosaico/esp-mosaico-vibe`)。
- 按功能域整理文档并采用双入口:根目录 `AGENTS.md` 变为薄路由(只保留硬约束与任务路由),详细的 AI 开发工作流下沉到 `docs/development/ai-guide.md`,`agent-guide.md` 并入其中。为 `docs/development/` 增加二级分区(`engineering/`、`ci/`、`release/`),把 `plays/` 应用档案与 `experiences/` 移入带专属 README 的 `docs/reference/` 参考区;删除 `docs/software-design/`(空脚手架);把 `assets/{fonts,images,music}/README` 三个叶子 README 并入 `assets/` README;把 `project-completion` 的六个子文档压平为单文件;并把每个目录统一为单一 README,消除所有 `INDEX` 文件与一处重复经验索引。所有交叉引用与文献链接已更新;未丢弃任何内容。
@@ -232,6 +232,46 @@ Keep the checkout clean before running `install.sh`; `idf.py` ignores
uninitialized submodules differently across versions and a partially updated
tree produces confusing compile errors.
### Large submodule fixes
`components/esp_wifi/lib` resolves to `espressif/esp32-wifi-lib`, a large
prebuilt repository, and a full fetch of it commonly exceeds any reasonable
wait limit. Do not retry the full fetch repeatedly on a short wait; fetch only
the pinned commit instead:
1. Read the exact commit `esp-idf` pins for that path:
```bash
git -C "${AI_PASSPORT_IDF_ROOT}" ls-tree HEAD components/esp_wifi/lib
# 160000 commit <sha> components/esp_wifi/lib
```
2. Remove the partial directory and fetch that single commit shallowly:
```bash
git -C "${AI_PASSPORT_IDF_ROOT}" rm -rf components/esp_wifi/lib
mkdir -p "${AI_PASSPORT_IDF_ROOT}/components/esp_wifi/lib"
cd "${AI_PASSPORT_IDF_ROOT}/components/esp_wifi/lib"
git init
git remote add origin https://github.com/espressif/esp32-wifi-lib.git
git fetch --depth 1 origin <sha-from-ls-tree>
git checkout FETCH_HEAD
```
3. Let `git submodule update --init` record the checkout, then verify:
```bash
git -C "${AI_PASSPORT_IDF_ROOT}" submodule update --init components/esp_wifi/lib
git -C "${AI_PASSPORT_IDF_ROOT}" status --short
```
Do not use `git submodule update --depth=1 <path>` for these pins: it fetches
only the default-branch tip and fails with
`Unable to find current revision in submodule path` when the pinned commit is
not the tip. For any remaining path that stays dirty after the ordinary repair,
run `git submodule deinit -f <path>` first, then `update --init` again. Always
use the paths printed by the latest `git status`; do not copy example paths.
### Offline archives as a last resort
If every source is unreachable after repeated attempts, the official Espressif
Loaded 3 of 4 files, more files were not shown because too many files have changed in this diff. Show more