⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

Implementation Plan for Post Revision Commands

  • Explore repository structure and understand existing patterns
  • Create Post_Revision_Command.php file with two commands:
    • wp post revision restore <post_id> - Restore a revision with the given ID
    • wp post revision diff <from> <to> - Compare/diff two revisions
  • Register the command in entity-command.php
  • Add command to composer.json commands list
  • Create Behat feature tests for the new commands
  • Address all code review feedback
  • Fix incomplete test scenario for diff between two revisions
  • All code quality checks passing ✓

Latest Changes

  • Added third update to create multiple revisions for proper diff testing
  • Extract individual revision IDs from the list
  • Actually execute wp post revision diff command with two revision IDs
  • Verify the command executes successfully

Ready for merge.

Original prompt

This section details on the original issue you should resolve

<issue_title>wp post revisions</issue_title>
<issue_description>This command is to manage revisions for the specific post.
I think that a large number of people need it for now... 😓

Examples:

Lists all revisions for post_id=221

$ wp post revisions 221 --format=json

Restores revision from 233.

$ wp post revisions 221 --restore=233

Displays diff.

$ wp post revisions 221 --diff=233:255

Or

$ wp post revisions 221 --diff=233

</issue_description>

<agent_instructions>Let's start with two new commands:

  1. wp post revision restore <post_id> - Restore a revision with the given ID
  2. wp post revision diff <from> <to> - Compare/diff two revisions</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@danielbachhuber Restoring and displaying diffs would be pretty interesting. @danielbachhuber Another implementation of revisions https://github.com/trepmal/wp-revisions-cli

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@github-actions github-actions bot added command:post Related to 'post' command command:post-list Related to 'post list' command command:post-meta Related to 'post meta' command command:post-meta-get Related to 'post meta get' command command:post-meta-update Related to 'post meta update' command labels Jan 12, 2026
Copilot AI changed the title [WIP] Add commands for restoring and diffing post revisions Add wp post revision restore and diff commands Jan 12, 2026
Copilot AI requested a review from swissspidy January 12, 2026 12:59
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 0% with 58 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Post_Revision_Command.php 0.00% 58 Missing ⚠️

📢 Thoughts on this report? Let us know!

This comment was marked as resolved.

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

Labels

command:post Related to 'post' command command:post-list Related to 'post list' command command:post-meta Related to 'post meta' command command:post-meta-get Related to 'post meta get' command command:post-meta-update Related to 'post meta update' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wp post revisions

2 participants