Repository navigation
Session System
Mikhail Deynekin edited this page Oct 12, 2026
·
2 revisions
Historical page (sr 6.x). It documents the Bash implementation, which sr 7 replaced with a Python rewrite and a different command line. Nothing below applies to 7.x; the page is kept for reference. Current documentation: Home, Installation, Quick-Start and
sr help(27 topics). The text below is unchanged.
Manage complex replacement operations with named sessions.
Sessions provide complete audit trails and rollback capabilities for bulk replacements.
# Create a new session
sr --session "project-refactor" --find "old" --replace "new" --recursive ./src/
# Session with specific date
sr --session "2024-migration" --find "legacy" --replace "modern" /path/sr --session listsr --session show "project-refactor"
sr --session show "project-refactor" --detailedsr --session stat "project-refactor"# Revert all changes in a session
sr --session rollback "project-refactor"
# Rollback with confirmation
sr --session rollback "project-refactor" --confirm# Permanently commit session
sr --session commit "project-refactor" --message "Refactoring complete"| Property | Description |
|---|---|
| ID | Unique session identifier |
| Timestamp | Creation date/time |
| Files Modified | Count of changed files |
| Total Changes | Total replacements made |
| Status | active/committed/rollbacked |
| Audit Trail | Complete change log |
- Descriptive Names - Use clear, meaningful session names
- Review Before Commit - Always verify changes first
- Regular Cleanup - Archive old sessions periodically
- Backup Strategy - Combine with backup system
- Change Documentation - Add detailed commit messages