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

オープン
#155 コメント 9 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
32/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
git, python
領域
devtools

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
6
フォーク
1
平均マージ
6分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

drevendev/Devostasis のほかの issue

drevendev/Devostasis の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。