Local Git collector requires undocumented Git >=2.45 --no-lazy-fetch capability

Abierto
#155 9 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
32/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
git, python
Área
devtools

Línea de trabajo

Start in src/devostasis/codeanalysis/git.py: Git.run() builds the global option prefix that includes --no-lazy-fetch, and Git.__init__() fires it via the two rev-parse calls before any collection. Read those two methods alongside tests/test_code_analysis.py, the README and code-analysis spec to see where a minimum Git version belongs, then add an explicit pre-flight version/capability check that raises the new diagnostic instead of GIT_READ_FAILED. Done means the supported Git range is documented in all three places, the fail-closed path is covered by offline tests against real 2.44.x and 2.45+ binaries plus a missing-object control, and existing v1/v2 behaviour is unchanged.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Finding — local code collector unconditionally requires a Git global flag introduced in 2.45

Pinned current source (2026-11-21): release/0.6.0@6d935ee111e2efab7a5f7d7c8f8d050af8d35567, src/devostasis/codeanalysis/git.py blob 7dc1576140f8bce9676ecbf896d9cc2129e179c1; the same Git.run() command occurs at open PR #81 HEAD a4761daa9fa87026ea106a3d722e7299b3de3b8b (blob 6953eb20afff2e22646b0e41b7dca7521fd677a5).

Git.run() prefixes every Git operation with:

command = [self.executable, "--no-lazy-fetch", "--no-replace-objects", "-c", "core.fsmonitor=false", "-c", "core.pager=cat", *args]

Git.__init__() immediately invokes self.run(["rev-parse", "--is-bare-repository"]) and self.run(["rev-parse", "--show-object-format"]). Thus an installed Git that does not recognize the global --no-lazy-fetch option cannot even begin ordinary local repository collection, regardless of completeness of the local object store. The subprocess nonzero exit is currently reduced to ValueError("GIT_READ_FAILED"), obscuring the actual compatibility problem.

Versioned upstream evidence: the official Git 2.44.0 git manual lists global --no-replace-objects but does not offer --no-lazy-fetch in its synopsis/options; the official Git 2.45.0 manual does document --no-lazy-fetch, including its equivalence to GIT_NO_LAZY_FETCH=1. No minimum Git version is declared in the inspected release/0.6.0 README, code-analysis spec or existing tests/test_code_analysis.py. The published Python >=3.12 baseline is independent of installed Git version.

Verification actually performed: On available Git 2.47.3, the exact global option sequence plus version exits 0. Source and versioned manuals were inspected. NOT_RUN: a real Git 2.44-or-earlier binary, Devostasis collect() with that binary, full repository pytest, conformance, wheel or fixing-head CI. This is a strong compatibility finding from source plus official versioned CLI contract, not a claim of a reproduced older-Git failure or a production incident.

Impact

A user installing the 0.6 local code-analysis companion on an older Git installation may get generic GIT_READ_FAILED even for a complete healthy local repository. That makes installation/first-run behavior unreliable and fails to tell the user which tool capability is missing. Simply deleting the flag without an equivalent guarantee is not an acceptable workaround: the spec explicitly forbids lazy network fetch during local immutable-object collection.

Bounded implementation / acceptance
  1. Decide and document the actual minimum supported Git version/capability for the local collector in README, code-analysis spec and CLI help/installation guidance as appropriate. If only Git >=2.45 can securely supply the required no-lazy-fetch guarantee, fail before repository collection on older Git with a stable, explicit GIT_VERSION_UNSUPPORTED or GIT_NO_LAZY_FETCH_UNSUPPORTED diagnostic, not generic GIT_READ_FAILED.
  2. If supporting older Git, prove an alternative that really disables lazy fetching, preserves --no-replace-objects, does not mutate the repository, and works for SHA-1/SHA-256 and partial-clone/missing-object cases. An unverified environment variable or silent removal of the flag is insufficient.
  3. Add deterministic offline compatibility controls using real Git 2.44.x and 2.45+ binaries (or a CI matrix/container image actually providing those versions) and a complete local repo; assert fail-closed/no network under unsupported capability and successful collection under supported versions. Include a missing local object control, a benign complete-repo control, and a clear CLI error/exit without producing a successful bundle. Keep existing v1/v2 behavior.
  4. Run Python >=3.12 source tests, conformance vectors, sample/historical verification, installed-wheel gate and exact-head hosted CI; land one focused fix PR into release/0.6.0, followed by independent review. No thresholds, Vitals semantics, policy calibration or read-only guarantees should change.

Dedup: searched repository open and closed Issues and PRs for --no-lazy-fetch, 2.44, and local Git version compatibility. Existing #154 concerns ls-tree returning BAD for an unavailable blob under a working newer Git; it does not cover command-line flag support before the collector starts.

Provider boundary: GitHub identity andy-zen-dev currently has pull=true, push=false, triage=false, maintain=false, admin=false; this issue is a read/code-backed handoff and does not claim a code commit, PR, merge or release.

Target: E4

Lenguaje dominante
Python
Estrellas
6
Forks
1
Merge medio
6 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de drevendev/Devostasis

Todos los issues de drevendev/Devostasis

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.