[CLI]: Add try graduate with detached-worktree attachment
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- git, rust
- Lĩnh vực
- cli, developer-experience
Hướng nghiên cứu
Bắt đầu từ graduation path hiện có của Ctrl-G và kiến trúc phát shell được try exec sử dụng; lần theo việc suy ra destination và branch-name dùng chung trước khi xem xét CLI parsing. Sau đó, kiểm tra các entry point của help, completions, usage spec, documentation và contract-test được đề cập trong issue. Hoàn thành nghĩa là có behavior CLI/TUI dùng chung, attachment an toàn và xử lý failure, cùng với coverage cho các trường hợp directory, worktree, cancellation và quoting được liệt kê.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Existing issues
- I searched the existing issues for this CLI request.
Problem
Graduation is currently available only as Ctrl-G inside the interactive selector. It cannot be invoked directly from scripts or from a shell already located inside the try.
Attaching a detached worktree to a branch is also a separate manual step:
git switch -c <branch>
This makes the complete promotion workflow difficult to discover and impossible to automate through a first-class try command.
Proposed command-line interface
# Perform the same graduation operation as Ctrl-G.
try graduate
# Graduate and attach a detached Git worktree to a branch first.
try graduate --attach
try graduate should expose the same destination derivation, validation, move, symlink, output, and final cd behavior as Ctrl-G.
--attach should perform the equivalent of git switch -c <inferred-branch> before moving the worktree. Branch inference should use the same normalized name presented by the graduation workflow.
Expected behavior
- From a try,
try graduategraduates that try without requiring the TUI. try graduate --attachdetects detached Git worktrees and creates/checks out the inferred branch before the move.- An attachment failure stops the operation before the worktree is moved.
- Already-attached worktrees are handled safely and do not receive a second branch.
- Regular, non-worktree directories continue through the normal move path.
- The command emits/evaluates shell operations consistently with the existing wrapper architecture.
Compatibility and scripting considerations
The CLI and TUI must share one graduation implementation so their behavior cannot drift. The command should preserve the shell-emission model used by try exec, existing TRY_PATH/TRY_PROJECTS behavior, quoting guarantees, and upstream-conformance boundaries.
This complements the proposed Worktrunk-aware default destination; the command should consume the same inferred destination and branch name rather than reimplementing them.
Acceptance criteria
-
try graduateperforms the same operation as Ctrl-G. -
try graduate --attachattaches a detached worktree withgit switch -cbefore moving it. - Attachment and move failures return non-zero without leaving a partially graduated worktree.
- Existing branches and already-attached worktrees have explicit, tested behavior.
- The CLI and TUI use shared graduation logic.
-
try --help, completions, the usage spec, and documentation includegraduateand--attach. - Contract tests cover normal directories, detached worktrees, attached worktrees, cancellation/failure, and shell quoting.
try version
try v0.1.0
Additional context
The desired workflow is “promote this existing try,” not “create another worktree with try worktree.”
- Ngôn ngữ chính
- Rust
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của indexzero/try.rs
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 65/100
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Tất cả issue của indexzero/try.rs
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
DayuanJiang/PecoFence#139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
nearai/compose-manager#73 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
akitaonrails/ai-memory#1664 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày