Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

apply_ignore_local.sh - Append local additions to .gitignore

Description

Appends generated/dot-ignore-local to .gitignore, under the comment # local additions - auto-generated on (date).

generated/dot-ignore-local holds the files that are too large for Git (01_check_file_sizes.sh writes it) and is committed, so the additions survive from one run to the next. Because only the additions are stored, refreshing .gitignore from the template (4-refresh-tools) never reverts them: the script is run again and puts them back.

Used by the ingest pipelines (1-populate-from-icpsr, w-big-populate-from-icpsr, and the shared Stata step), which commit generated/dot-ignore-local and .gitignore as two separate commits with 20_commit_code.sh before committing the deposit, and by tools/update_tools.sh, which also reapplies it after replacing .gitignore.

Old-style generated/dot-gitignore

Earlier versions kept a full copy of .gitignore, with the large files appended after an # Auto-generated on line, in generated/dot-gitignore (and the difference in generated/diff-dot-gitignore.txt). When the script finds generated/dot-gitignore, it:

  1. moves the entries after the last # Auto-generated on line into generated/dot-ignore-local (merged with entries already there; a file without that line yields none),

  2. removes generated/dot-gitignore and generated/diff-dot-gitignore.txt (also from the Git index when tracked).

Usage

./tools/apply_ignore_local.sh

Run it from the root of the repository. It takes no arguments.

Testing: see the testing plan.