Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add wp post revision restore and diff commands #563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
Copilot wants to merge 9 commits into main
base: main
Choose a base branch
Loading
from copilot/add-post-revision-commands

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026
edited
Loading

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 and others added 4 commits January 12, 2026 12:50
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
...sed property
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
...ror handling
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
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
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.

swissspidy and others added 3 commits January 13, 2026 12:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

@swissspidy swissspidy Awaiting requested review from swissspidy

At least 1 approving review is required to merge this pull request.

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

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

wp post revisions

2 participants

AltStyle によって変換されたページ (->オリジナル) /