Vault SVN

by caesarloo
5
4
3
2
1
Score: 32/100

Description

Integrate SVN version control with automatic commit-and-sync in Obsidian.md

Reviews

No reviews yet.

Stats

2
stars
479
downloads
0
forks
175
days
75
days
75
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
1
total issues
1
open issues
0
closed issues
65
commits

Latest Version

2 months ago

Changelog

Vault SVN v1.2.0

English | 中文


English

Release Date: 2026-08-24

New Features

  1. Shared SVN Core via @caesarloo/simple-svn-client — The SVN domain layer now comes from the published @caesarloo/simple-svn-client@^0.1.0 npm package, replacing ~1,340 lines of duplicated local code (src/services/svnClient.ts, src/services/summaryService.ts).

  2. Unit Test for getSvnClient() — Added src/main.test.ts to lock down the plugin-settings → package-constructor mapping, preventing silent signature drift.

Fixes

  1. No-Timeout SVN Commands Restored — Commands now run with timeoutMs: 0 (matching the previous no-timeout behavior), so large-repository svn update / big-file diff operations are no longer killed after the package's default 60-second timeout.

  2. package-lock.json Version Synced — The lockfile version was stale (1.1.6); it now matches package.json (1.2.0).

  3. Dead Code Removed — Deleted the unreferenced src/services/cryptoService.ts.

Improvements

  1. XML Entity Decoding in Status Parsing — Paths containing &, quotes, or other XML entities now display correctly.

  2. Safe Path Handling — Paths starting with - get a ./ prefix for add/commit and other commands, so they are never mistaken for svn options.

  3. Real Error Messages — Command failures now surface the actual svn stderr text (SvnError), instead of a generic Node error.

  4. Reused Package Test Coverage — All SVN domain logic (encoding repair, status/update/diff parsing, binary discovery) now lives in the shared package and is covered by its own test suite.

Version Update

  • manifest.json: 1.1.14 → 1.2.0
  • package.json: 1.1.14 → 1.2.0
  • versions.json: Added 1.2.0

Release Assets

  • dist/main.js - Plugin main program
  • dist/manifest.json - Plugin manifest
  • dist/styles.css - Plugin styles

Chinese / 中文

发布日期: 2026-08-24

新增

  1. 引入共享 SVN 核心 @caesarloo/simple-svn-client — SVN 领域层改为依赖已发布的 @caesarloo/simple-svn-client@^0.1.0 npm 包,删除本地重复实现(src/services/svnClient.ts、src/services/summaryService.ts,共 -1340 行)。

  2. 新增 getSvnClient() 单元测试 — 添加 src/main.test.ts 锁定"插件设置 → 包构造参数"的映射,防止签名漂移。

修复

  1. 恢复 SVN 命令"无超时"行为 — 命令以 timeoutMs: 0 运行(与旧版无超时行为一致),大型仓库 svn update / 大文件 diff 不再因包默认 60 秒超时被中断。

  2. package-lock.json 版本号同步 — 锁文件版本号此前落后(1.1.6),现与 package.json(1.2.0)一致。

  3. 删除死代码 — 移除未被引用的 src/services/cryptoService.ts。

改进

  1. 状态解析支持 XML 实体解码 — 路径含 &、引号等 XML 实体时现在能正确显示。

  2. 安全路径处理 — 以 - 开头的路径在 add/commit 等命令中自动加 ./ 前缀,防止被 svn 当作选项。

  3. 真实错误信息 — 命令失败时展示实际 svn stderr 内容(SvnError),而非笼统的 Node 错误。

  4. 复用包内测试覆盖 — 所有 SVN 领域逻辑(编码修复、状态/更新/差异解析、二进制探测)位于共享包,由其自带测试套件守护。

版本更新

  • manifest.json: 1.1.14 → 1.2.0
  • package.json: 1.1.14 → 1.2.0
  • versions.json: 新增 1.2.0

发布附件

  • dist/main.js - 插件主程序
  • dist/manifest.json - 插件清单
  • dist/styles.css - 插件样式

README file from

Github

Vault SVN

English | 中文


English

Vault SVN is a desktop-only Obsidian plugin for managing SVN working copies directly inside your vault. It provides a visual SVN client panel with status tree, staging, commit, conflict resolution, and more.

⚠️ Permissions: This plugin invokes the system svn CLI via Node.js child_process.execFile and accesses SVN working copies on the local filesystem via fs. It only operates on paths you configure in settings. These permissions are required for SVN version control functionality and cannot be replaced by the Obsidian vault API.

Current stable version: 1.2.0

Latest release: https://github.com/caesarloo/obsidian-svn/releases/tag/1.2.0

Installation

  1. Go to the latest release page and download these 3 files:
    • main.js
    • manifest.json
    • styles.css
  2. Create the plugin directory inside your vault: <Vault>/.obsidian/plugins/vault-svn/
  3. Copy the 3 downloaded files into that directory.
  4. Restart Obsidian, or reload Community Plugins in Settings.

Prerequisites

  • Desktop Obsidian only (not available on mobile).
  • SVN CLI must be installed and available on your system. Verify with svn --version in your terminal.
  • You need a local SVN working copy path.

Usage

Open the SVN Panel
  • Command Palette: Run Open Vault SVN Panel
  • Ribbon Icon: Click the Open Vault SVN icon in the left ribbon
Settings

Configure these in the plugin settings tab:

Setting Description
SVN Executable Path Optional; leave empty to use system PATH
Auto-refresh Interval How often to poll for status changes
Auto-open Panel on Startup Open the panel automatically when Obsidian starts
Daily Workflow
  1. Update — pull latest changes from the repository (svn update)
  2. Refresh Status — view the current change list (svn status)
  3. Stage — select files/directories in the file tree to stage
  4. Enter Commit Message — type a message (summary generation is available as a helper)
  5. Commit — commit only the staged changes
Conflict Resolution

When conflicts are detected, the plugin shows a conflict indicator. To resolve:

  1. Fix the conflict in your external editor or merge tool
  2. Run Mark as Resolved in the plugin
  3. Refresh status and commit as usual

Features

  • Update working copy (svn update)
  • Refresh status (svn status)
  • Change tree: added, modified, deleted, conflicted, untracked, missing
  • File and folder-level staging / un-staging
  • File restore and recursive folder restore
  • Commit staged changes
  • Automatic commit summary generation (non-blocking on failure)
  • Conflict detection and marking resolved
  • Selectable file path in diff view for easy copy/paste

FAQ

Q: No changes are shown.

A: Verify the working copy path in settings. Check that svn status runs correctly in that directory from your terminal.

Q: Plugin says "svn command not found".

A: Run svn --version in your terminal to verify installation. If installed but still failing, set the absolute path to the svn executable in plugin settings.

Q: Commit fails.

A: Check for unresolved conflicts or file permission issues.

Known Issues

  • Settings search on Obsidian 1.13+ — The plugin's settings do not appear in Obsidian's global settings search on version 1.13.0 or later, because the plugin uses the legacy imperative settings API (display()) and does not implement the declarative getSettingDefinitions() yet. The settings page itself works normally. A fix is planned for v1.3.0.

Development

# Build the plugin
npm run build

# Type-check
npm run typecheck

Chinese / 中文

Vault SVN 插件使用说明

Vault SVN 是一个 Obsidian 桌面端插件,用于在库内管理 SVN 工作副本。

⚠️ 权限说明:本插件通过 Node.js child_process.execFile 调用系统已安装的 svn CLI 命令,并使用 fs 模块直接访问文件系统上的 SVN 工作副本。插件仅在用户配置的工作副本路径下执行 SVN 操作,不会主动访问其他目录。这些权限是 SVN 版本管理功能所必需的,无法通过 Obsidian vault API 替代。

当前稳定版本:1.2.0

最新发布页:https://github.com/caesarloo/obsidian-svn/releases/tag/1.2.0

1. 安装插件

  1. 打开发布页下载以下 3 个文件:
    • main.js
    • manifest.json
    • styles.css
  2. 在你的库目录下创建插件目录:<Vault>/.obsidian/plugins/vault-svn/
  3. 将上述 3 个文件放入该目录。
  4. 重启 Obsidian,或在"社区插件"中重新加载插件。

2. 前置条件

  • 仅支持桌面端 Obsidian。
  • 系统中必须已安装可执行的 svn 命令行工具。
  • 你需要有可访问的 SVN 工作副本本地路径。

3. 打开插件面板

  • 方式一:命令面板执行 打开 SVN 面板
  • 方式二:点击左侧 Ribbon 图标 Open Vault SVN

4. 首次配置

在插件设置中填写以下信息:

  • svn 可执行文件路径(可选,未填时使用系统 PATH)
  • 自动刷新间隔
  • 启动自动打开面板等行为选项

5. 日常使用流程

建议按以下顺序操作:

  1. 点击"更新"拉取最新变更(svn update)
  2. 点击"刷新状态"查看变更列表(svn status)
  3. 在文件树中选择需要提交的文件/目录进行"暂存"
  4. 输入提交信息(可使用摘要生成功能辅助)
  5. 点击"提交变更"(仅提交已暂存集合)

6. 冲突处理

检测到冲突时,插件会给出冲突提示。可按以下流程处理:

  1. 在外部工具或编辑器中解决冲突
  2. 回到插件中执行"标记已解决"
  3. 再次刷新状态并继续提交

7. 功能清单

  • 更新工作副本(svn update)
  • 刷新状态(svn status)
  • 变更树展示:新增/修改/删除/冲突/未跟踪/缺失
  • 文件与文件夹级暂存/取消暂存
  • 文件还原与文件夹递归还原
  • 提交已暂存变更
  • 提交摘要自动生成(失败不阻断手动提交)
  • 冲突提示与标记已解决
  • 差异视图文件路径可选中复制

8. 常见问题

看不到任何变更
  • 先确认"工作副本路径"是否正确。
  • 确认该目录可正常执行 svn status。
提示找不到 svn 命令
  • 在系统终端执行 svn --version 验证安装。
  • 若已安装但仍失败,请在设置中填写 svn 可执行文件绝对路径。
提交失败
  • 检查是否存在冲突或权限问题。

9. 已知问题

  • Obsidian 1.13+ 设置搜索 — 插件使用旧版命令式设置 API(display()),尚未实现声明式 getSettingDefinitions(),因此在 Obsidian 1.13.0 及以上版本中,插件设置不会出现在全局"设置搜索"里。设置页本身功能正常。计划在 v1.3.0 中修复。