Skip to content

feat: git brach overrides#38

Open
OverHash wants to merge 10 commits intostandardagents:mainfrom
OverHash:feat/git-branch-selector
Open

feat: git brach overrides#38
OverHash wants to merge 10 commits intostandardagents:mainfrom
OverHash:feat/git-branch-selector

Conversation

@OverHash
Copy link

@OverHash OverHash commented Feb 26, 2026

Implements new Git branch override config when creating new agent panes. You can now optionally:

  • choose a base branch to create from (instead of current HEAD / default base), and/or
  • choose an explicit branch/worktree name for the new pane.

Closes #36


I've tested this myself manually, and there's also e2e tests that have been added (as well as some unit tests). See screenshots below for what this looks like!

1) Settings entry 2) Enable/Disable toggle 3) Save scope (Global / Project only)
Settings pane showing Ask Git options on create Ask Git options on create with Enable/Disable choices Save Ask Git options on create as Global or Project only
Type to filter local branches Select highlighted branch (press enter) Set branch/worktree override
Branch selector filtering Branch selector with highlighted match Branch/worktree name override input

.. and you can see the created session has my custom name set! Not pictured is the fact that the base branch was the one that I selected.

Created session uses custom naming
Created session with custom pane/worktree name

I suggest reviewing the PR commit-by-commit, as it delineates the linear progress I made towards creating this PR. Unfortunately, it's still relatively chunky even excluding the tests at +905/-89.

Add the Git options settings and types.

Define promptForGitOptionsOnCreate and the NewPaneInput payload so pane creation can carry prompt, base-branch, and branch-name overrides consistently.
Implement the new pane-input creation flow by threading structured prompt payloads through popup handling and pane creation hooks.
Add override-aware branch and worktree naming with base-branch precedence in pane creation.

Cover custom naming, agent suffix handling, and collision/error paths with unit and integration tests.
Add local-branch suggestions sorted by recent commits, strict base-branch validation, and keyboard-driven selection/filtering in the new-pane popup.

Include helper unit tests and tmux e2e coverage for success and strict-validation flows.
Document the new create-time git branch controls, strict local base-branch selection behavior, and e2e test execution workflow.
* Fixes padding (reduced)
* Moves the base branch selector to be within a single component, rather
  than two borded components
* Adds shift+tab and cyclic support back to prompt
* Backspace was performing the same operation as `del`, so fixes
  behavior so that backspace actually detetes stuff to the left of the
  cursor
focus?: boolean;
}

const InlineCursorInput: React.FC<InlineCursorInputProps> = ({
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component had to be made as the native component for input text wasn't correctly handling backspace. If you see fcaa45b, you can see the changes made here were rather aggressive to get this to work.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be split up now that there is substantial new code introduced that is beyond just the prompt? I was considering it..

@OverHash
Copy link
Author

OverHash commented Mar 21, 2026

Rebased off main twice.

To view how I handled conflicts, you'll need to use:

  • git log --remerge-diff -p -1 25bc1060d2b1f5df42d9724176bb6c56d72aecba
  • git log --remerge-diff -p -1 078e0d98959c56d87e5e5276b2a7d0b5a6350a87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Choose base branch and new branch name

1 participant