Automattic / Automattic/php-toolkit

Feature: Add support for .gitignore parsing and system file whitelisting

Aperta
#88 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
PHP
Stelle
22
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Summary
I was trying to use Obsidian to edit Markdown files, and faced a problem to sync the Obsidian vault `.obsidian`.. Because it does not exist on the server. While one could use the Gutenberg Guidelines structure for brand voice and other items, it would be useful to allow people to keep other files in their checked out repos and only push what Push MD supports.

Since Push MD does not have a `.gitignore`, this can cause ignored build artifacts or temporary files to be scanned and pushed into WordPress - and the whole push to fail.

**The proposal:**

Push MD checkout repositories can contain `.gitignore` file. And the rules here will specifically check for file paths Push MD needs, and ignore everything else.

This can also address potential issues when people have multi remote setup - one from local to their own "staging" or "pre-approval" Git server, and from there to live WordPress site.

### Features & How This Should Work

1. **`.gitignore` Pattern Parser**:
- Interpret root and sub-folder `.gitignore` files during push scan.
- Support standard pattern syntax: wildcards (`*`), directory prefixes (`/`), comments (`#`), trailing slashes, and negations (`!`).

2. **System File Whitelist Policy**:
- System configuration files (`.gitignore`, `AGENTS.md`, `CLAUDE.md`) should be explicitly whitelisted so they are preserved and never ignored, even if broad rules (like `.*` or `*.md`) exist in `.gitignore`.
- Support for posts, pages and other artifacts in a way that support for custom post types etc in future works too

3. **Seeder Integration**:
- Export `.gitignore` during checkout/seed so workspace rules remain intact.

### Acceptance Criteria
- [ ] `.gitignore` patterns correctly exclude matching files during push scan.
- [ ] Negation rules (`!pattern`) work as expected.
- [ ] System files (`.gitignore`, `AGENTS.md`, `CLAUDE.md` - and others) are explicitly whitelisted and never ignored.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia tracciando il flusso di push scan e checkout/seed descritto nell’issue, quindi esamina come vengono attualmente selezionati ed esportati i file del repository. Verifica il comportamento rispetto ai criteri di accettazione elencati: i pattern .gitignore annidati e le negazioni escludono i file corrispondenti, mentre .gitignore, AGENTS.md e CLAUDE.md rimangono preservati; conferma che le regole sopravvivano anche a checkout/seed.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git, php
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.