Skip to main content
← Back to list
01Issue
FeatureClosedSwamp Club
AssigneesNone

Populate .gitattributes with linguist-generated markers during repo init

Opened by swampadmin · 12/4/2024

Problem

When swamp-managed repositories are used with GitHub PRs, runtime-generated files (data, outputs, definitions-evaluated, etc.) show up expanded in PR diffs. These files are tracked for reconstruction purposes but aren't meant for human review — they add noise and inflate diff stats, making PRs harder to review.

Users currently have to manually create .gitattributes entries with linguist-generated=true to get GitHub to auto-collapse these files.

Proposed Solution

swamp repo init (and swamp repo upgrade) should populate .gitattributes with linguist-generated=true markers for swamp runtime directories, similar to how the managed .gitignore section works today.

Suggested entries:

# BEGIN swamp managed section - DO NOT EDIT
.swamp/definitions-evaluated/** linguist-generated=true
.swamp/data/** linguist-generated=true
.swamp/outputs/** linguist-generated=true
.swamp/ssh/** linguist-generated=true
deno.lock linguist-generated=true
# END swamp managed section

This would cause GitHub (and other platforms using linguist) to:

  • Auto-collapse these files in PR diffs
  • Exclude them from +/- line count stats
  • Still allow reviewers to expand and inspect if needed

User-authored content (extensions, definitions, vault configs, .swamp.yaml) should NOT be marked, so it shows normally for review.

Alternatives Considered

  • Gitignoring these files entirely — but swamp expects them tracked for reconstruction
  • Manually maintaining .gitattributes — works but is easy to labt and doesn't stay in sync as swamp adds new runtime directories
02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.