Skip to content

Make it easier to copy all annotations #336

Closed

Description

@raine

A common review workflow is to annotate several lines and then copy the complete annotation output for use elsewhere.

Today this requires planning the handoff before launching revdiff. Piping stdout to a clipboard command copies the annotations after quitting, while using --output with --post-flush-command copies the current snapshot after pressing O. If revdiff is already running without either setup, there does not appear to be a direct way to copy all annotations.

It would be helpful to have a simple, discoverable way to copy all current annotations from within an active review session. The specific interface and clipboard mechanism are open to whatever fits revdiff best.

Activity

  1. umputun commented on Aug 28, 2026

    @umputun
    Owner

    done in #339, and your report turned up a separate bug along the way.

    O no longer requires -o/--output. One line in ~/.config/revdiff/config:

    post-flush-command = pbcopy

    and each successful O with annotations copies the full current set, in every session including a bare revdiff HEAD~1, with no per-launch flags and no output file. On Linux use xclip -selection clipboard for X11 or wl-copy for Wayland; over SSH or inside a multiplexer use an OSC 52 helper, the README has the script.

    the -o coupling came from #277, which kept it deliberately to hold that PR's scope down, and that was the right call for the PR. Its author said at the time that running the hook standalone made sense as a follow-up. What was not intended was treating that scoping choice as a permanent rule. The runtime coupling was a single early return, though the help text, tests and docs had grown around it too. Configure the output file, the command, or both: with both, the command receives the exact bytes written to the file, so the two cannot drift.

    the stdout example also exposed a separate bug. In the version you tested, redirecting stdout sent the TUI into the pipe, so no window-size message ever arrived and the review never left its loading state, with nothing visible in the terminal. That is fixed in #338, which keeps the TUI on /dev/tty and reserves stdout for the annotations, so revdiff HEAD~1 | pbcopy works too.

    the post-flush pbcopy recipe was also undocumented: the README only showed the OSC 52 route. README and the site now cover both.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions