Skip to content

V0.1: Automated versioning with Reaper-native save - #21

Open
Zesseth wants to merge 16 commits into
masterfrom
V0.1_features
Open

V0.1: Automated versioning with Reaper-native save#21
Zesseth wants to merge 16 commits into
masterfrom
V0.1_features

Conversation

@Zesseth

@Zesseth Zesseth commented Mar 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements one-click project versioning: increments the version folder name and saves using Reaper's native Main_SaveProjectEx(0, path, 2), which copies all media and rewrites internal .rpp references atomically — identical to Save As with "Copy all media into project directory" ticked
  • Adds archiving UI: move old versions to a configurable local destination, with configurable keep-count and confirmation dialogs
  • Cross-platform support: Windows, Linux (Debian), macOS

Key technical decision

Previous approach used robocopy/cp to copy media manually, then saved the .rpp with flag 0. This left internal .rpp path references pointing to the original locations, producing a broken version. The fix is Main_SaveProjectEx flag 2 which lets Reaper's engine handle everything atomically.

Test plan

  • Open a Reaper project with media files
  • Click "Create New Version" in auto mode — verify new versioned folder is created with all media copied and .rpp opens correctly
  • Verify .rpp references point to the new folder, not the original
  • Test on Windows and Linux

🤖 Generated with Claude Code

Copilot AI and others added 7 commits December 19, 2025 18:15
Co-authored-by: jlahtela <13746676+jlahtela@users.noreply.github.com>
…older browser

Co-authored-by: jlahtela <13746676+jlahtela@users.noreply.github.com>
…g logic and add confirmation dialogs for archiving and existing versions
Replace manual robocopy/cp approach with reaper.Main_SaveProjectEx(0, path, 2)
which saves the .rpp, copies all media, and rewrites internal references
atomically — identical to Save As with "Copy all media" ticked.

Remove file_operations helpers that existed only for the old manual copy
approach: copy_file, count_files_in_dir, get_project_media_files,
get_all_project_files, copy_project_files.

Also add .claude/ and CLAUDE.md to .gitignore (not for public repo).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use info.project from EnumProjects(-1) instead of 0 to be explicit about
which project is being saved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates RASP to v0.2 by expanding project versioning options (native vs automated “safe” saving) and introducing initial local archiving support via a new module and GUI section.

Changes:

  • Add dual versioning modes (Native Save As dialog vs Auto safe versioning via Main_SaveProjectEx) with conflict handling.
  • Introduce archiving workflow (UI + module) to move older version folders to an archive destination.
  • Update README and repo hygiene (.gitignore) for the new feature set.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
README.md Documents v0.2 features, adds versioning guide and updates roadmap.
RASP.lua Wires GUI actions to new versioning mode + archiving operations.
modules/versioning.lua Implements auto safe versioning, console logging, and version-folder conflict handling.
modules/gui.lua Adds versioning mode toggle and new archiving UI controls/flags.
modules/file_operations.lua Refactors directory copy/delete to use exit-code capture and adds verification logic.
modules/config.lua Adds defaults for versioning mode + archiving settings; increases window height.
modules/archiving.lua New module to select versions to archive, confirm, copy to destination, and delete source.
.gitignore Ignores Claude-related local files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/file_operations.lua Outdated
Comment thread modules/file_operations.lua Outdated
Comment thread modules/versioning.lua Outdated
Comment thread modules/versioning.lua Outdated
Comment thread modules/archiving.lua
Comment thread modules/archiving.lua Outdated
Comment thread README.md
Comment thread README.md
@Zesseth

Zesseth commented Mar 13, 2026

Copy link
Copy Markdown
Owner Author

This PR contains both v0.1 and v0.2 features mixed together (see issue #29).

The intended path forward: merge this PR as-is to bring v0.1 features into master (issues #22, #23, #24). Since v0.2 code is already present and partially implemented, merging establishes a working baseline from which a dedicated V0.2_features branch can be created for proper v0.2 development, testing, and release.

…p Windows

- file_operations: remove execute_with_exitcode and all Windows-specific
  shell commands (robocopy, rmdir). Archiving now uses cp/rm directly
  via os.execute — Linux/macOS only. Remove broken count_files_in_dir
  reference from copy_directory.
- versioning: replace alongside (_a/_b) conflict option with "increment
  version number" (finds next available version). Fix success message to
  report actual created folder name instead of bare version suffix.
- archiving: remove unused escaped_prefix variable. Fix create_directory
  check to use dir_exists() after creation instead of trusting return value.
- README: update console output examples to match actual log messages,
  update conflict handling table, note Windows not supported.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Zesseth

Zesseth commented Mar 13, 2026

Copy link
Copy Markdown
Owner Author

Addressed Copilot review comments (commit a09987e):

  • Windows support dropped — archiving uses cp/rm shell commands (Linux/macOS only). Versioning via Main_SaveProjectEx remains cross-platform, but since archiving cannot work on Windows without significant extra work, Windows is no longer a supported platform. Noted in README.
  • Conflict handling replaced — removed the _a/_b alongside suffix scheme. Options are now: increment version number / overwrite / do nothing.
  • Fixed broken count_files_in_dir reference in copy_directory (function had been removed but call remained).
  • Fixed create_directory false positive in archiving — now verifies with dir_exists() after creation.
  • Removed unused escaped_prefix variable in archiving.
  • README console output updated to match actual log messages.

Zesseth and others added 5 commits March 13, 2026 19:26
Windows is explicitly not planned due to shell command dependencies.
macOS was never tested and shouldn't be listed as supported.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Keep .claude/ personal directory gitignored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Main_SaveProjectEx flag 2 did not copy media files on Linux.
New approach:
  1. cp -r copies all project files (media, peaks, etc.) to new folder
  2. Main_SaveProjectEx flag 0 saves .rpp with new name, Reaper rewrites internal references
  3. Old .rpp removed from destination folder

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Flag 2 alone did not copy media on Linux. Trying flag 3 = flag 1 (create
subdirectory) + flag 2 (copy all media), which may require Reaper to create
the directory itself. Removed manual cp-r and directory creation.

If flag 3 also fails, fallback is cp-r + flag 0 + .rpp path patching.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Public repo — all comments, commits, issues, and docs must be in English.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates RASP toward the v0.2 roadmap by adding a safer automated versioning path (with conflict handling) and introducing local archiving (UI + logic), plus documentation and configuration updates.

Changes:

  • Add dual versioning modes (Native Save As vs Auto “safe” save/copy via Main_SaveProjectEx) with console logging and folder-conflict handling.
  • Add local archiving workflow: GUI controls for archive destination / “versions to keep”, and an archiving module that copies then deletes old version folders.
  • Update config defaults/UI sizing and expand repository docs (README.md, CLAUDE.md, .gitignore).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
README.md Updates feature list and adds a detailed versioning guide + roadmap adjustments.
RASP.lua Wires GUI events to new versioning mode selection and archiving actions.
modules/versioning.lua Implements “auto safe” version creation with conflict dialog and console logging; adds mode parameter.
modules/gui.lua Adds versioning mode switch and archiving section (destination + versions-to-keep + actions).
modules/file_operations.lua Refactors file ops toward shell-based dir copy/delete; updates module docs.
modules/config.lua Adds persisted settings for versioning mode + archiving; increases default window height.
modules/archiving.lua New module to locate version folders and archive (copy + delete) old versions.
CLAUDE.md New contributor guidance for repo structure and feature behavior.
.gitignore Ignores Claude Code local directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread RASP.lua
Comment thread modules/archiving.lua Outdated
Comment thread modules/file_operations.lua
Comment thread modules/file_operations.lua
Comment thread CLAUDE.md Outdated
Comment thread modules/versioning.lua Outdated
Zesseth and others added 3 commits March 15, 2026 16:44
- archiving.lua: fix cutoff comparison (< -> <=) so versions_to_keep=3
  correctly keeps exactly 3 versions instead of 4
- versioning.lua: return true (not false) when user cancels conflict
  dialog, so cancellation is not shown as a red error in the UI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README: remove _v002_a alongside example (feature was removed)
- README: remove duplicate Auto Mode bullet point
- README: move local archiving to v0.2 (already shipped), update v0.3
  to Backblaze B2 cloud archiving
- CLAUDE.md: update file_operations.lua description (Linux-only, no robocopy)
- CLAUDE.md: fix Main_SaveProjectEx flag reference (2 -> 3)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Resolve README roadmap conflict (keep master's v0.2/v0.3/v0.4 structure, mark v0.1 and v0.2 done per PR #21 / issue #29)
- Rename CLAUDE.md to AGENTS.md and remove Claude-specific references
- Remove AI tool entries from .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants