Skip to content

feat: global default worktree root + grove config CLI#23

Merged
rrbe merged 3 commits into
mainfrom
feat/global-worktree-root
May 20, 2026
Merged

feat: global default worktree root + grove config CLI#23
rrbe merged 3 commits into
mainfrom
feat/global-worktree-root

Conversation

@rrbe
Copy link
Copy Markdown
Owner

@rrbe rrbe commented May 20, 2026

Summary

  • 新增 app-global 层的默认 worktree 目录,所有仓库共用一份;配置合并顺序变为 builtin → app-global → per-repo
  • 新增 grove config CLI 子命令(show / get / set / unset / path),可在终端直接读写这两层;--global 操作全局层,缺省作用于 per-repo
  • Settings 视图加「全局默认 Worktree 目录」卡片,per-repo 输入框 placeholder 显示继承的全局值

支持的 key:worktree_rootdefault_base_branchdefault_base_branch 仅支持 per-repo)。

CLI 示例

grove config set worktree_root ../wt --global    # 设全局
grove config show                                # 看生效值 + 来源
grove config get worktree_root                   # 当前 repo 生效值
grove config unset worktree_root                 # 清掉 per-repo override
grove config path                                # 打印 ~/.grove/store.json

Test plan

  • cargo test(31/31 通过,含新增的合并层单测)
  • cargo clippy --all-targets 无 warning
  • pnpm build + pnpm test --run 通过
  • CLI 烟雾测试:set/get/unset 全局往返、per-repo 往返、错误路径友好提示
  • GUI 手测:Settings 改全局默认后,per-repo 输入框 placeholder 跟着变;per-repo override 仍然优先

🤖 Generated with Claude Code

rrbe and others added 3 commits May 20, 2026 11:45
Add an app-wide default for the worktree directory that applies to
every repo unless a per-repo override is set. Config merge order is
now builtin → app-global → per-repo.

Also expose a `grove config` subcommand for viewing and editing both
layers from the terminal (show/get/set/unset/path), so the same
settings are reachable without opening the GUI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- store::trim_to_option for the trim → Option<String> pattern (used in
  the Tauri command and twice in the CLI)
- print_global_layer helper to remove the duplicated `[global]` block
  in cmd_config_show
- report_set helper to unify the global vs per-repo write paths in
  cmd_config_set and drop the unreachable match arms
- cmd_hook_list / cmd_worktree_list now use the current_repo_root
  helper that was already introduced for the config commands
- SettingsPage tracks the last-persisted global default in a ref, so
  blurring the field without a real change no longer triggers a full
  openRepo round-trip

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rrbe rrbe merged commit 7474e47 into main May 20, 2026
3 checks passed
@rrbe rrbe deleted the feat/global-worktree-root branch May 20, 2026 04:20
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.

1 participant