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.
Safe to run repeatedly: the block of an earlier run is replaced, never duplicated.
Does nothing to
.gitignorewhengenerated/dot-ignore-localis missing or has no entries.Stages
generated/dot-ignore-local(force-added, asgenerated/may be ignored). Committing is left to the caller.
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:
moves the entries after the last
# Auto-generated online intogenerated/dot-ignore-local(merged with entries already there; a file without that line yields none),removes
generated/dot-gitignoreandgenerated/diff-dot-gitignore.txt(also from the Git index when tracked).
Usage¶
./tools/apply_ignore_local.shRun it from the root of the repository. It takes no arguments.
Testing: see the testing plan.