Skip to content

make local branch error give commands to push / delete / rename branch - and to delete local worktree #120

Closed

Description

@JacobStephens2

[jstephens@dev html]$ thirdshift https://github.com/Educational-Travel-Adventures/tourbot/issues/1259
thirdshift: the local branch issue-1259 is not on origin; push, rename or delete it first
[jstephens@dev html]$

[jstephens@dev html]$ thirdshift https://github.com/Educational-Travel-Adventures/tourbot/issues/1259
thirdshift: creating worktree /var/www/tourbot-issue-1259 on issue-1259 from origin/issue-1259
thirdshift: git worktree add -B issue-1259 /var/www/tourbot-issue-1259 origin/issue-1259 failed: fatal: 'issue-1259' is already used by worktree at '/var/www/tourbot-issue-1259'
[jstephens@dev html]$

Activity

  1. changed the title [-]make local branch error give commands to push / delete / rename branch[/-] [+]make local branch error give commands to push / delete / rename branch - and to delete local worktree[/+] on Sep 29, 2026
  2. JacobStephens2 commented on Oct 17, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: enhancement
    Summary: Make local Issue branch and Worktree acquisition failures print usable recovery commands.

    Current behavior:
    A local-only or divergent Issue branch produces prose such as “push, rename or delete it first.” A branch already checked out in another Worktree can surface only Git's raw refusal. The issue's examples therefore leave the user to reconstruct the relevant Git commands.

    Desired behavior:
    For these local-state acquisition failures, explain the relevant branch and checkout, then print concrete, correctly quoted recovery alternatives. Cover pushing preserved work, renaming the local branch, non-forcing local branch deletion, and non-forcing removal of the relevant Worktree. Identify a checkout that must be left or inspected before a branch can be renamed/deleted. Make the command's working-directory requirement clear. Where the current checkout offers the normal Continuation path, explain that route rather than implying the preserved work must be discarded.

    Printed advice must respect the existing preservation contract: thirdshift performs no recovery mutation automatically, and the examples use Git's ordinary refusal checks rather than force flags. Explain that removal may refuse while work remains and that the user must inspect/preserve it first.

    Key interfaces:

    • Worktree acquisition diagnostics: carry the selected Issue branch, launch repository and known occupied checkout into the error advice.
    • Existing Failed run preservation and Continuation behavior: remain authoritative.

    Acceptance criteria:

    • Local-only and divergent-branch errors name the branch and provide applicable push/rename/non-forcing-delete commands, without suggesting deletion is required.
    • An occupied Worktree error identifies the actual checkout and gives applicable non-forcing removal or Continuation guidance.
    • Commands remain valid for paths containing spaces or shell metacharacters, and identify the directory from which to run them.
    • Focused acquisition/CLI regression cases verify these failures still preserve local work and do not execute the printed commands.
    • Existing exit/failure and Worktree ownership behavior is preserved.

    Out of scope:
    Automatic deletion, force removal/reset, remote branch deletion, changing acquisition authority, global advice for every error (#53), and the separate missing Base branch advice in #295.

  3. added
    enhancementNew feature or request
    ready-for-agentFully specified, ready for an AFK agent
    in-progressA Claim: thirdshift has taken this issue
    and removed
    ready-for-agentFully specified, ready for an AFK agent
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions