From 43fd5a17aeedabfada12a314b7c16ad656872143 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 11 Mar 2026 02:17:07 -0400 Subject: [PATCH] [REF] script: use Execute helper in git daemon Replace raw subprocess.Popen and manual signal handling with Execute.exec_command_live for consistency with other refactored scripts. Generated by Claude Code 2.1.72 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit --- script/git/git_local_server.py | 35 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/script/git/git_local_server.py b/script/git/git_local_server.py index c55a5ef..5709cc3 100755 --- a/script/git/git_local_server.py +++ b/script/git/git_local_server.py @@ -5,11 +5,17 @@ import argparse import logging import os -import signal import subprocess import sys import xml.etree.ElementTree as ET +new_path = os.path.normpath( + os.path.join(os.path.dirname(__file__), "..", "..") +) +sys.path.append(new_path) + +from script.execute.execute import Execute + _logger = logging.getLogger(__name__) DEFAULT_ERPLIBRE_PATH = os.path.normpath( @@ -529,28 +535,21 @@ def serve_git_daemon(git_path, projects, port): """Start git daemon to serve repos.""" print_clone_commands(git_path, projects, port) - cmd = [ - "git", - "daemon", - "--reuseaddr", - f"--base-path={git_path}", - f"--port={port}", - "--export-all", - "--enable=receive-pack", - git_path, - ] + cmd = ( + f"git daemon --reuseaddr" + f" --base-path={git_path}" + f" --port={port}" + f" --export-all" + f" --enable=receive-pack" + f" {git_path}" + ) print(f"Starting git daemon on port {port}...") print(f" Base path: {git_path}") print(f" URL: git://localhost:{port}/") print(" Press Ctrl+C to stop") - try: - process = subprocess.Popen(cmd) - process.wait() - except KeyboardInterrupt: - print("\nStopping git daemon...") - process.send_signal(signal.SIGTERM) - process.wait() + execute = Execute() + execute.exec_command_live(cmd, source_erplibre=False) def main():