[TUI]: Prompt to attach a branch when graduating a detached worktree
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 65/100
調査の方向性
Ctrl-G の graduation フローから開始し、提案されている try graduate --attach エントリーポイントをたどってから、Git worktree の状態と TUI プロンプトがどのように処理されているかを調べます。detached worktree が編集可能なブランチのアタッチ、確認、拒否、キャンセル、そして対処可能な失敗処理をサポートし、既存の動作を維持したまま、列挙されたすべての状態をカバーできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Existing issues
- I searched the existing issues for this interaction.
Current workflow
try worktree <name> intentionally creates a detached worktree. Ctrl-G later moves that worktree to a permanent location, but it does not attach HEAD to a branch.
As a result, the TUI can report a successful graduation while leaving the promoted project detached. Users must know to run this manually before or after graduation:
git switch -c <branch>
The distinction between moving a worktree and attaching its Git HEAD is not visible in the current interaction.
Proposed interaction
When Ctrl-G is used on a detached Git worktree, the TUI should detect the detached state and prompt the user to attach it to a branch.
The prompt should:
- Explain that the selected worktree has a detached HEAD.
- Offer an inferred branch name derived from the graduation/worktree name.
- Allow the branch name to be edited.
- Run the equivalent of
git switch -c <branch>before moving the worktree when confirmed. - Allow the user to decline and graduate while detached.
No attachment prompt is needed for a worktree already associated with a branch or for a non-Git directory.
Why this improves the TUI
Branch attachment is part of promoting an ephemeral detached worktree into maintained work. Prompting at the transition point makes the Git state explicit, avoids orphaned commits, and removes a prerequisite that users otherwise have to discover outside try.
Acceptance criteria
- Ctrl-G detects whether a selected Git worktree is detached.
- Detached worktrees receive an attach-branch prompt before the move.
- The prompt includes an editable inferred branch name.
- Confirming performs branch attachment before
git worktree move. - Declining preserves the existing detached graduation behavior.
- Escape cancels without attaching or moving.
- Attachment failure prevents the move and displays an actionable error.
- Already-attached worktrees and normal directories are not prompted.
- Tests cover confirm, edit, decline, cancel, failure, and already-attached states.
try version
try v0.1.0
Shell
zsh
Additional context
The same behavior should be available non-interactively through the proposed try graduate --attach CLI.
- 主要言語
- Rust
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
indexzero/try.rs のほかの issue
-
Overall workflowオープン
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
indexzero/try.rs の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
longbridge/nsh#804 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
devex good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
calcit-lang/calcit#2538 ·
メンテナーはふだん 1 日以内に返信