Keeping Generated Artifacts Out of Unrelated Commits

A build can leave untracked output or modify tracked generated files. Review each artifact against the change's intended public result.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace two outputs
  2. Verify the selected snapshot
  3. Separate source inputs from disposable outputs
  4. Treat tracked fixtures and release artifacts according to their contracts

Trace two outputs

A temporary log and a checked-in generated fixture may both appear after testing. The log is usually local evidence, while a revised fixture may document a deliberate changed format. See ignored and tracked paths.

Verify the selected snapshot

Inspect status plus the staged diff so the commit includes needed source and expected outputs under project policy. Staging coherent changes helps keep unrelated execution data out.[1]

Separate source inputs from disposable outputs

A build writes a report into a generated directory and a one-off test creates an intermediate log. If neither is a source input or requested deliverable, keep them out of an unrelated feature commit. Review untracked paths and staged contents individually. See ignore rules for already tracked files.

Source configuration: expected change
Generated report: derived output, follow repo rule
Local debug log: temporary
Review the staged list before committing

Treat tracked fixtures and release artifacts according to their contracts

Some generated files intentionally belong to the repo, such as reviewed golden fixtures. Decide based on project policy and reproducibility. Check that ignoring outputs does not hide required new inputs.

References

  1. Scott Chacon and Ben Straub, Pro Git ↩