From 291c9cf5e00e998af9c5d4e8506fa1c9d343edb2 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 11 Mar 2026 02:27:39 -0400 Subject: [PATCH] [IMP] script: add erplibre root repo to git server The root repo (erplibre/erplibre) was missing from the local git server because it is not in the Google Repo manifest. Include it so a full clone of the platform is possible from the local server across all 4 actions. Generated by Claude Code 2.1.72 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit --- script/git/git_local_server.py | 44 +++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/script/git/git_local_server.py b/script/git/git_local_server.py index 5709cc3..3f767bc 100755 --- a/script/git/git_local_server.py +++ b/script/git/git_local_server.py @@ -26,6 +26,8 @@ PRODUCTION_GIT_PATH = "/srv/git" DEFAULT_MANIFEST = ".repo/local_manifests/erplibre_manifest.xml" DEFAULT_REMOTE_NAME = "local" DEFAULT_PORT = 9418 +ERPLIBRE_REPO_NAME = "erplibre/erplibre" +ERPLIBRE_REPO_URL = "https://github.com/erplibre" def get_config(): @@ -178,6 +180,40 @@ def parse_manifest(manifest_path): return projects +def get_erplibre_root_project(erplibre_root): + """Build a project entry for the ERPLibre root repo. + + The root repo is not in the manifest (it is managed + by git directly, not Google Repo) but needs to be + included in the local git server. + """ + result = subprocess.run( + [ + "git", + "-C", + erplibre_root, + "rev-parse", + "--abbrev-ref", + "HEAD", + ], + capture_output=True, + text=True, + ) + revision = ( + result.stdout.strip() + if result.returncode == 0 + else "master" + ) + + return { + "name": ERPLIBRE_REPO_NAME, + "path": ".", + "remote": "origin", + "revision": revision, + "fetch_url": ERPLIBRE_REPO_URL, + } + + def init_bare_repos(git_path, projects): """Create bare repos for all projects in the manifest.""" os.makedirs(git_path, exist_ok=True) @@ -588,7 +624,13 @@ def main(): print() projects = parse_manifest(manifest_path) - print(f"Found {len(projects)} projects in manifest") + erplibre_project = get_erplibre_root_project(erplibre_root) + projects.append(erplibre_project) + print( + f"Found {len(projects)} projects" + f" ({len(projects) - 1} from manifest" + f" + erplibre root)" + ) print() action = config.action