Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[CLI]: Add try graduate with detached-worktree attachment

Đang mở
#9 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ả

enhancement
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 graduate graduates that try without requiring the TUI.
  • try graduate --attach detects 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 graduate performs the same operation as Ctrl-G.
  • try graduate --attach attaches a detached worktree with git switch -c before 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 include graduate and --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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của indexzero/try.rs

Tất cả issue của indexzero/try.rs

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.