WIP: feat: add branch commands to CLI and TUI #37

Draft
sigil-03 wants to merge 2 commits from sigil-03/3e9f497724af048a29b55100db55a290 into main
Owner

Add ability to check out a feature branch for a given issue from both
the CLI and the TUI.

Branch name format: /<issue_uuid>
Username is taken from git config user.name, normalized to lowercase
with spaces replaced by underscores.

If the branch already exists, it is checked out. Otherwise, a new
branch is created and checked out.

CLI:
ent checkout <issue_id>

TUI:
Press 'b' on a highlighted issue (Overview or IssueDetail view) to
check out a feature branch for that issue.

Add ability to check out a feature branch for a given issue from both the CLI and the TUI. Branch name format: <username>/<issue_uuid> Username is taken from git config user.name, normalized to lowercase with spaces replaced by underscores. If the branch already exists, it is checked out. Otherwise, a new branch is created and checked out. CLI: ent checkout <issue_id> TUI: Press 'b' on a highlighted issue (Overview or IssueDetail view) to check out a feature branch for that issue.
feat: add 'ent checkout' CLI command and entui 'b' key binding
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
bd27e9b044
Add ability to check out a feature branch for a given issue from both
the CLI and the TUI.

Branch name format: <username>/<issue_uuid>
Username is taken from git config user.name, normalized to lowercase
with spaces replaced by underscores.

If the branch already exists, it is checked out. Otherwise, a new
branch is created and checked out.

CLI:
  ent checkout <issue_id>

TUI:
  Press 'b' on a highlighted issue (Overview or IssueDetail view) to
  check out a feature branch for that issue.
sigil-03 force-pushed sigil-03/3e9f497724af048a29b55100db55a290 from bd27e9b044
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
to de43b15d0b
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
2026-07-11 21:21:57 +00:00
Compare
Author
Owner

there are some minor formatting fixes rolled into this as well due to running cargo fmt

there are some minor formatting fixes rolled into this as well due to running `cargo fmt`
sigil-03 force-pushed sigil-03/3e9f497724af048a29b55100db55a290 from de43b15d0b
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
to 7606756690
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
2026-07-11 21:31:06 +00:00
Compare
feat: add 'ent worktree' CLI command and entui 'w' key binding
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
eba4e2e114
Add ability to check out a feature branch for a given issue in a new
git worktree from both the CLI and the TUI.

Worktree path: ~/git-worktrees/<repo>/<username>/<issue_id>
Branch name: <username>/<issue_id> (same as 'ent checkout')

If the worktree already exists, just return the path.  The worktree is
created with --detach to avoid conflicts when the branch is already
checked out in another worktree.

CLI:
  ent worktree <issue_id>

TUI:
  Press 'w' on a highlighted issue (Overview or IssueDetail view) to
  create a worktree for that issue.  TUI restarts in the worktree
  directory.
sigil-03 changed title from feat: add 'ent checkout' CLI command and entui 'b' key binding to feat: add worktree and branch commands to CLI and TUI 2026-07-11 22:52:14 +00:00
Owner

This seems like useful functionality, and i mostly like the code. Only thing i'm not sure about is the base of the branch that it creates - it currently bases the branch on whatever's currently checked out. Maybe that's the right behavior, or maybe it should be based on main/master? Idk, just raising the question.

This seems like useful functionality, and i mostly like the code. Only thing i'm not sure about is the base of the branch that it creates - it currently bases the branch on whatever's currently checked out. Maybe that's the right behavior, or maybe it should be based on `main`/`master`? Idk, just raising the question.
sigil-03 force-pushed sigil-03/3e9f497724af048a29b55100db55a290 from eba4e2e114
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
to 7606756690
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
2026-07-12 15:41:37 +00:00
Compare
fix: checkout_issue_branch fetches origin/main before branching
Some checks failed
Code Checks / clippy (push) Has been cancelled
Code Checks / test (push) Has been cancelled
Code Checks / clippy (pull_request) Has been cancelled
Code Checks / test (pull_request) Has been cancelled
96bdcbf4f9
When creating a new feature branch, fetch origin/main first to ensure
it's fresh, then branch from origin/main instead of the current branch.
Author
Owner

yeah actually that just bit me.

  1. i'm removing the worktree code for now to keep this simple
  2. i've made it checkout origin/main but i'm realizing that doesn't work for all repositories.

is there a way in git to see what the mainline branch is?

yeah actually that just bit me. 1. i'm removing the worktree code for now to keep this simple 2. i've made it checkout `origin/main` but i'm realizing that doesn't work for all repositories. is there a way in git to see what the mainline branch is?
sigil-03 changed title from feat: add worktree and branch commands to CLI and TUI to feat: add branch commands to CLI and TUI 2026-07-12 16:06:23 +00:00
sigil-03 changed title from feat: add branch commands to CLI and TUI to WIP: feat: add branch commands to CLI and TUI 2026-07-12 16:20:27 +00:00
Some checks failed
Code Checks / clippy (push) Has been cancelled
Code Checks / test (push) Has been cancelled
Code Checks / clippy (pull_request) Has been cancelled
Code Checks / test (pull_request) Has been cancelled
This pull request has changes conflicting with the target branch.
  • src/bin/entui/components/entomologist/mod.rs
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin sigil-03/3e9f497724af048a29b55100db55a290:sigil-03/3e9f497724af048a29b55100db55a290
git switch sigil-03/3e9f497724af048a29b55100db55a290

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff sigil-03/3e9f497724af048a29b55100db55a290
git switch sigil-03/3e9f497724af048a29b55100db55a290
git rebase main
git switch main
git merge --ff-only sigil-03/3e9f497724af048a29b55100db55a290
git switch sigil-03/3e9f497724af048a29b55100db55a290
git rebase main
git switch main
git merge --no-ff sigil-03/3e9f497724af048a29b55100db55a290
git switch main
git merge --squash sigil-03/3e9f497724af048a29b55100db55a290
git switch main
git merge --ff-only sigil-03/3e9f497724af048a29b55100db55a290
git switch main
git merge sigil-03/3e9f497724af048a29b55100db55a290
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
taproot-manufacturing/entomologist!37
No description provided.