Files
fitme3070.pt/PLATFORM_TOOLS.md
andreandClaude Sonnet 5 0ecc38774a feat(platform-tools): volta a ser submódulo, agora com branch fixo
Estava vendorizado como cópia simples desde 24/09 (VENDORED.md) depois
de um submódulo anterior ter partido a produção: .gitmodules sem
branch fazia "Atualizar submódulo" cair para refs/remotes/origin/HEAD,
uma ref que um clone só-servidor nunca cria, e a URL era http:// (523
na origem). Corrigidos os dois: branch = main fixo e URL https (via
../platform-tools.git, relativa como a fotografia usa). A terceira
razão do VENDORED.md — "o site é deployado por upload" — não se aplica
ao deploy.sh actual (é git pull), por isso deixou de justificar ficar
vendorizado depois de corrigir as outras duas.

Confirmado antes de converter: a cópia vendorizada era byte-idêntica
ao upstream @12f26fd (única diferença, CRLF→LF em 4 ficheiros de
social/, já notada no VENDORED.md) — nada foi perdido. Submódulo fixo
nesse mesmo commit. deploy.sh (fora do repo, em /srv/stacks/) passa a
correr `git submodule update --init --recursive` a seguir ao pull.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 12:30:26 +01:00

1.9 KiB

shared/platform-tools is a git submodule (again)

Was vendored as a plain committed directory from 2026-09-24 to 2026-09-25 (VENDORED.md, since removed — its content is folded in below). Switched back to a proper submodule on 2026-09-25 once the two concrete problems that broke it the first time were fixed:

  • .gitmodules now pins branch = main explicitly. The old submodule had no branch, so "Atualizar submódulo" fell back to refs/remotes/origin/HEAD — a ref a plain server-side clone never creates — and failed with Unable to find refs/remotes/origin/HEAD revision.
  • The submodule URL is ../platform-tools.git (relative, resolves to https://git.andmore.pt/andre/platform-tools.git), not http://. The old one used http://, which the origin answers with 523.

The third original reason ("the site is deployed by uploading files, so a submodule is invisible to it") doesn't apply to fitme's actual deploy method — deploy.sh does git pull --ff-only — so it no longer justifies staying vendored once the other two are fixed. deploy.sh now runs git submodule update --init --recursive after the pull, matching every other config/-based platform in the fleet (fotografia, dsa, moremio, tickets).

Before converting back (2026-09-25): verified the vendored copy was byte-identical to upstream platform-tools@12f26fd (the SHA it was frozen at) — only difference was CRLF→LF normalization in four social/ files, already noted in the old VENDORED.md. Nothing site-specific was hand-patched into the vendored copy, so nothing was lost by re-pointing at the submodule pinned to that same commit.

To bump the submodule to a newer platform-tools commit: git submodule update --remote shared/platform-tools && git add shared/platform-tools && git commit (see the platform-tools README, "Wiring up a platform", step 6) — same as fotografia.