commit 9be28298176a33ce9e66c71491a8542868357c44 from: ale date: Thu Jul 23 21:05:35 2026 UTC Refuerza el fix de entorno: ParentEnvironmentType.SYSTEM + diagnóstico 'got fetch -v' no aportó líneas de debug adicionales de ssh (confirmado reproduciendo el mismo -v sin SSH_AUTH_SOCK desde una shell normal: sale idéntico, sin más detalle) -- ese camino de diagnóstico no sirve para este fallo en particular. Se refuerza el fix anterior: en vez de solo sobreescribir SSH_AUTH_SOCK sobre el snapshot de entorno CONSOLE (cacheado por la plataforma), se fuerza ParentEnvironmentType.SYSTEM para que GeneralCommandLine use System.getenv() completo como base -- el mismo entorno que ya se confirmó correcto vía /proc//environ del proceso de IntelliJ. Además, el mensaje de VcsException ahora incluye el valor real de SSH_AUTH_SOCK visto por la JVM en el momento del fallo, para confirmar en vivo sin más rondas de adivinar si el valor que llega al subproceso es el correcto. commit - a3b2a2982f2e4086fe074ca7a16f14c241d40576 commit + 9be28298176a33ce9e66c71491a8542868357c44 blob - d984cea7da4d753e302e50588df38472f9ba3fca blob + ca1c724995286dc63875bd1e1e3a5386cdf4466d --- src/main/kotlin/dev/nezzontli/gotvcs/GotCommandLineWrapper.kt +++ src/main/kotlin/dev/nezzontli/gotvcs/GotCommandLineWrapper.kt @@ -31,12 +31,14 @@ class GotCommandLineWrapper { val commandLine = GeneralCommandLine(binaryPath(), *args) .withWorkDirectory(workDir) .withCharset(StandardCharsets.UTF_8) - // GeneralCommandLine usa por defecto un snapshot de entorno cacheado - // por la plataforma (EnvironmentUtil), no el entorno real del proceso - // de IntelliJ. En este setup (gpg-agent con soporte ssh) ese snapshot - // puede no coincidir con SSH_AUTH_SOCK actual, y got/ssh fallan con - // "Permission denied (publickey)" aunque el agente esté vivo y con la - // clave cargada. Se fuerza explícitamente el valor real del proceso. + // Fuerza el entorno real del proceso de IntelliJ (System.getenv, + // el mismo que ve /proc//environ) en vez del snapshot + // cacheado por la plataforma (EnvironmentUtil) que usa CONSOLE + // por defecto. Ver GotCommandLineWrapper: el fix anterior (solo + // forzar SSH_AUTH_SOCK sobre el snapshot CONSOLE) no fue + // suficiente para got fetch por SSH -- se prueba reemplazando + // la base entera del entorno. + .withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.SYSTEM) System.getenv("SSH_AUTH_SOCK")?.let { commandLine.environment["SSH_AUTH_SOCK"] = it } val output = try { ExecUtil.execAndGetOutput(commandLine) @@ -44,7 +46,13 @@ class GotCommandLineWrapper { throw VcsException("No se pudo ejecutar got ${args.joinToString(" ")}: ${e.message}", e) } if (output.exitCode != 0) { - throw VcsException("got ${args.joinToString(" ")} salió con código ${output.exitCode}: ${output.stderr.trim()}") + // SSH_AUTH_SOCK visto por el JVM se incluye temporalmente en el + // mensaje (deuda de diagnóstico, Fase 6) para confirmar en vivo + // qué valor recibe realmente el subproceso. + throw VcsException( + "got ${args.joinToString(" ")} salió con código ${output.exitCode}: " + + "${output.stderr.trim()} [SSH_AUTH_SOCK=${System.getenv("SSH_AUTH_SOCK")}]" + ) } return output.stdout }