Skip to content

feat: ignore LaTeX build artifacts and add .olignore support (#19)#20

Merged
aloth merged 2 commits intomainfrom
feat/olignore
Apr 27, 2026
Merged

feat: ignore LaTeX build artifacts and add .olignore support (#19)#20
aloth merged 2 commits intomainfrom
feat/olignore

Conversation

@aloth
Copy link
Copy Markdown
Owner

@aloth aloth commented Apr 27, 2026

Closes #19.

What

Local LaTeX compilers drop build artifacts (.aux, .bbl, .log, .fls, .synctex.gz, beamer/biber/glossaries/minted intermediates, …) next to source files. Previously olcli sync uploaded these to Overleaf, which would either:

  1. Break Overleaf's compile (stale .aux pinned), or
  2. Produce wrong PDFs (Overleaf compiled against stale .bbl instead of regenerating it).

This PR adds a layered ignore subsystem to prevent that.

Layered design

Layer Source Status
1 Built-in defaults (43 patterns) Always on, opt out with --no-default-ignore
2 .olignore (gitignore-style) Project-level, version-controlled, supports negation
3 .olignore.local Machine-specific, never synced

Special PDF rule

X.pdf is ignored only if a same-named X.tex (or .ltx) exists in the same folder. Kills thesis.pdf next to thesis.tex but preserves a hand-uploaded figures/diagram.pdf.

CLI surface

olcli sync                       defaults + .olignore (default)
olcli sync --no-default-ignore   only .olignore applies
olcli sync --no-ignore           escape hatch — uploads everything
olcli sync --show-ignored        print files filtered out
olcli push  …                    same flags on push
olcli ignored [dir]              list patterns currently in effect

New code

  • src/ignore.tsloadIgnore(), shouldIgnore(), buildTexSiblingSet(), DEFAULT_IGNORE_PATTERNS
  • src/cli.ts — wired into scanDir (push) and scanLocalFiles (sync); new ignored subcommand
  • New dep: ignore (~30KB, zero deps, used by ESLint/Prettier)

Tests

test/e2e-ignore.sh31/31 passing. Covers:

  • Built-in defaults visible via olcli ignored
  • --no-default-ignore hides defaults
  • .olignore loaded with negation support
  • .olignore.local stacks on top
  • push --dry-run filters .aux/.bbl/.log/.synctex.gz while keeping .tex and standalone .pdf
  • Sibling-of-tex .pdf rule fires correctly
  • --no-default-ignore re-enables artifact upload
  • --no-ignore bypasses both defaults and .olignore
  • Real round-trip smoke test: actually push to Overleaf, then verify ignored files are absent on remote and non-ignored files arrive

test/e2e-issue7.sh (deletion-propagation regression) — 22/22 still passing.

Versioning

v0.3.0 — minor bump per pre-1.0 policy: new feature, new file format (.olignore), new flags.

aloth added 2 commits April 27, 2026 10:56
Closes #19.

Local LaTeX compilers (pdflatex/xelatex/lualatex/latexmk/biber/etc.) drop
build artifacts next to source files. Previously `olcli sync` happily
uploaded these to Overleaf, which would either break Overleaf's compile
(stale .aux pinned) or produce wrong PDFs (compiled against stale .bbl
instead of regenerating it).

This change adds a layered ignore subsystem:

  1. Built-in defaults (43 patterns) — LaTeX intermediates, OS noise,
     common build dirs. Always on, opt out with --no-default-ignore.
  2. .olignore — gitignore-style project-level patterns, version
     controlled, supports negation.
  3. .olignore.local — machine-specific, never committed.

Special PDF rule: ignore X.pdf only if a same-named X.tex (or .ltx)
exists in the same folder. This kills thesis.pdf next to thesis.tex
but preserves a hand-uploaded figures/diagram.pdf.

New CLI surface:
  olcli sync --no-default-ignore      only .olignore applies
  olcli sync --no-ignore              uploads everything (escape hatch)
  olcli sync --show-ignored           prints what was filtered
  olcli push --no-default-ignore      same flags on push
  olcli push --no-ignore
  olcli push --show-ignored
  olcli ignored [dir]                 list patterns currently in effect

New module: src/ignore.ts (loadIgnore, shouldIgnore, buildTexSiblingSet,
DEFAULT_IGNORE_PATTERNS).

New dep: ignore (~30KB, zero deps, used by ESLint/Prettier).

Tests: test/e2e-ignore.sh — 31 assertions covering defaults, .olignore,
.olignore.local, negation, the PDF sibling rule, the --no-* escape
hatches, and a real round-trip upload smoke test that verifies ignored
files actually do not reach the Overleaf project. Also re-ran
test/e2e-issue7.sh: 22/22 still passing.
README:
- Features list mentions two-way deletions, delete/rename, smart ignore
- Commands table adds 'olcli ignored', notes rm/mv aliases
- 'Sync Behavior' section documents deletion-propagation manifest
- New 'Ignoring files' section: three layers, PDF special rule, .olignore
  example, --no-default-ignore / --no-ignore / --show-ignored flags
- Push section mentions ignore filtering and --show-ignored

SKILL.md:
- Bumped metadata version 1.1 → 1.2
- 'Edit and sync changes' shows --no-delete flag
- New 'Delete or rename remote files' subsection (delete/rm + rename/mv)
- New 'Inspect ignore rules' subsection
- Commands table adds delete/rename/ignored
- Tips: documents two-way deletes, ignore defaults, PDF rule

docs/index.html:
- Hero badge bumped v0.1.6 → v0.3.0
- Feature grid: bidirectional sync card mentions deletion propagation
- New 'Smart Ignore' feature card
@aloth aloth merged commit e0c039d into main Apr 27, 2026
@aloth aloth deleted the feat/olignore branch April 27, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: ignore LaTeX build artifacts and add .olignore support

1 participant