Skip to content

Conversation

@adamziel
Copy link
Collaborator

@adamziel adamziel commented Dec 25, 2024

Motivation for the change, related issues

🚧 Experimental! Do not merge! 🚧

Experimenting for fun with editing WP_Filesystem files and implementing a WP_Git_Filesystem class.

$fs = new WP_Git_Filesystem(
    new WP_Git_Client(GIT_REPO_URL, [
        'author' => 'Adam Zieliński <adam@example.net>',
        'committer' => 'Adam Zieliński <adam@example.net>',
    ]),
    'main',
    '/pages'
);

// Every $fs operation creates a commit
$fs->put_contents('/index.md', '# Markdown file!' );
$fs->mkdir('/setup');
$fs->put_contents('/setup/01-introduction.md', '# Setup introduction' );
$fs->put_contents('/setup/02-installation.md', '# Install things' );
$fs->rmdir('/setup', ['recursive' => true']);

// In the future we could have a local index and batch all the
// updates to push as a single commit

CleanShot 2024-12-25 at 19 04 49@2x

@adamziel adamziel added [Type] Exploration An exploration that may or may not result in mergable code [Aspect] Data Liberation labels Dec 25, 2024
@adamziel adamziel changed the title [Data Liberation] Local files browser [Data Liberation] Edit static files directly in a git repository Dec 25, 2024
@adamziel adamziel force-pushed the static-files-editor-local-fs-as-the-source-of-truth branch from 8d352a2 to 2d5da28 Compare January 7, 2025 13:50
@adamziel
Copy link
Collaborator Author

adamziel commented Jan 9, 2025

I'll close this in favor of a rebased and slightly cleaned up #2118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Aspect] Data Liberation [Type] Exploration An exploration that may or may not result in mergable code

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants