From c84fbc559d0a99dbd1d574a9f024ee2160af5f21 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Mon, 10 Aug 2026 03:10:50 -0400 Subject: [PATCH] [FIX] manifest: give repo init a branch name, not a bare SHA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit repo cannot resolve a commit into a manifest revision on a FRESH workspace: it gave up on « unparseable HEAD », then repo sync on « manifest not found ». An already-initialised .repo accepts the SHA, which is why only new installations were hit — four fresh VMs failed identically. --- FR --- repo ne sait pas résoudre un commit en révision de manifeste sur un espace de travail NEUF : il abandonnait sur « unparseable HEAD », puis repo sync sur « manifest not found ». Un .repo déjà initialisé accepte le SHA, d'où un défaut limité aux installations neuves — quatre VM ont échoué ainsi. Assisted-by: Claude Opus 5 --- script/manifest/update_manifest_local_dev.sh | 23 +++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/script/manifest/update_manifest_local_dev.sh b/script/manifest/update_manifest_local_dev.sh index 122978f..abd4131 100755 --- a/script/manifest/update_manifest_local_dev.sh +++ b/script/manifest/update_manifest_local_dev.sh @@ -44,7 +44,28 @@ fi # Generate local manifest .venv.erplibre/bin/python ./script/git/git_merge_repo_manifest.py --output .repo/local_manifests/erplibre_manifest.xml --with_OCA -.venv.erplibre/bin/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --verify HEAD) -m ${MANIFEST_TARGET} "$@" +# Révision du manifeste : un NOM DE BRANCHE, jamais un SHA nu. +# +# « repo init -b » échoue sur un espace de travail NEUF : repo doit y +# cloner .repo/manifests et ne sait pas résoudre un commit en révision de +# manifeste. Il abandonne sur « unparseable HEAD », puis repo sync sur +# « manifest not found ». Mesuré : -b main réussit, -b échoue. +# Le piège est qu'un .repo DÉJÀ initialisé accepte le SHA — le défaut reste +# donc invisible sur toute machine ayant réussi un init une fois, et ne frappe +# que les installations neuves : les 4 VM du 2026-08-07 ont toutes échoué là. +MANIFEST_REV=$(git symbolic-ref --quiet --short HEAD || true) +if [ -z "${MANIFEST_REV}" ]; then + # HEAD détaché : prendre une branche qui contient ce commit plutôt que de + # retomber sur le SHA, qui ne marcherait pas. + MANIFEST_REV=$(git branch --contains HEAD --format='%(refname:short)' 2>/dev/null | grep -v '[()]' | head -1) +fi +if [ -z "${MANIFEST_REV}" ]; then + echo "Erreur : impossible de déterminer une branche pour repo init." >&2 + echo " HEAD est détaché et aucune branche ne contient ce commit." >&2 + exit 1 +fi + +.venv.erplibre/bin/repo init -u git://127.0.0.1:9418/ -b "${MANIFEST_REV}" -m ${MANIFEST_TARGET} "$@" .venv.erplibre/bin/repo sync -c -j "$JOBS" ${REPO_VERBOSE} -m ${MANIFEST_TARGET} # Daemon cleanup handled by the EXIT trap above (tolerant of an already-dead PID).