feat(firmware): add persistent-clone git sync spike (git_sync)

Milestone #2 increment A: the product's real publish flow, distinct from
git_push's fresh-init-per-boot throwaway branch. open-or-clone a persistent
/spiflash/repo, append to a tracked notes.md, commit on top of the branch,
and fast-forward push over mbedTLS HTTPS+PAT. Reconcile handles up-to-date
and fast-forward; a true divergence (merge commit on FATFS) is deferred to
increment B. Runs on the dedicated 96 KB git thread; gated behind `git`.

Compiles clean; on-device clone/open+fast-forward not yet hardware-verified
(clone/checkout is deeper than the proven init path — the flash may need a
GIT_STACK bump).
This commit is contained in:
Julien Calixte
2026-07-07 00:06:13 +02:00
parent cce62bf9f7
commit 859c4787cf
3 changed files with 480 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ elf_wifi := "target/xtensa-esp32s3-espidf/release/wifi_tls"
elf_sd := "target/xtensa-esp32s3-espidf/release/sd_fat"
elf_git := "target/xtensa-esp32s3-espidf/release/git_smoke"
elf_git_push := "target/xtensa-esp32s3-espidf/release/git_push"
elf_git_sync := "target/xtensa-esp32s3-espidf/release/git_sync"
# Custom partition table (adds the `storage` FAT partition for the git working
# copy). Only the git-push flash applies it — the editor flash keeps the default
@@ -92,6 +93,19 @@ flash-git-push: build-git-push
monitor-git-push:
espflash monitor --elf {{elf_git_push}}
# Milestone #2A — build the persistent-clone publish cycle (clone + fast-forward push)
build-git-sync:
{{esp_env}} {{git_env}} cargo build --release --bin git_sync --features git
# Milestone #2A — flash + monitor. Applies the same custom partition table as
# git-push (the `storage` FAT partition holds the persistent clone).
flash-git-sync: build-git-sync
espflash flash --monitor --partition-table {{partition_table}} --flash-size 16mb {{elf_git_sync}}
# serial monitor for the git sync, with decoded backtraces
monitor-git-sync:
espflash monitor --elf {{elf_git_sync}}
# detect board, print chip/MAC/flash size
info:
espflash board-info