Bisect exports commits with git archive, which omits export-ignore paths

Aperta
#194 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
69/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, go
Ambito
cli, testing

Direzione di ricerca

Read internal/gitx/gitx.go around Archive and ExportIndex/writeBlobs, then inspect the sole caller and existing error handling in internal/engine/debug.go. Start by tracing how commit trees and blobs are exported and how untar applies file rules. Add coverage for both acceptance criteria: an export-ignore directory remains present and an export-subst file retains its committed bytes; run make test-short.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug severity: low

Summary

The bisect probe of spackle debug --good exports each commit with git archive, which applies the export-ignore and export-subst attributes, so the probe can run against a tree that is missing committed files.

Where

  • internal/gitx/gitx.go:754-761 (Archive; the comment says the export holds the bytes that were committed)
  • internal/engine/debug.go:652, :664 (the only caller, and the "test does not exist" message)

Details

git archive leaves out paths marked export-ignore in the archived tree's .gitattributes and rewrites $Format:...$ placeholders in export-subst files. Nothing in the repository mentions either attribute. The git behavior is documented in gitattributes(5); not run during the audit, since it needs a model and a container runtime.

Impact

For a repository whose .gitattributes marks its tests or fixtures export-ignore (common in packages that ship archives), every bisect probe runs on a tree without those files. With --test, the first probe ends with "the test ... does not exist at commit HEAD" although the test is committed. With --issue, the reproduction runs against an incomplete tree and can label commits wrongly. The working-tree reproduction that precedes bisect is not affected, so the two disagree.

Steps to reproduce

  1. In a repository with tests/ export-ignore in .gitattributes and a failing test under tests/, run spackle debug --test <name> --good <older-rev> .
  2. The working-tree reproduction succeeds, then bisect reports that the test does not exist at HEAD.

Suggested fix

Export the tree without archive attributes: list it with git ls-tree -r -z <rev> and read the blobs with git cat-file --batch, as ExportIndex / writeBlobs already do for the index (the helpers can be shared), keeping the regular-file-only and size rules of untar.

Acceptance criteria

  • A test exports a commit whose .gitattributes marks a directory export-ignore and finds the directory in the export
  • An export-subst file is exported byte for byte

Related: #84, #41

Getting started

  • Relevant files: internal/engine/debug.go, internal/gitx/gitx.go
  • How to run tests: make test-short (Unix) or .\make.ps1 test-short (Windows PowerShell); make lint before you call it done
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: M. audit-key: bug|internal/gitx/gitx.go|Archive-export-ignore

Lingua principale
Go
Stelle
0
Fork
1
Merge medio
8h 14m
PR unite (30g)
3

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/Spackle

Tutte le issue di TMHSDigital/Spackle

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.