Skip to content

[WIP] Add alias and checkout commands#224

Draft
aratz-lasa wants to merge 3 commits intomainfrom
feature/alias-and-checkout
Draft

[WIP] Add alias and checkout commands#224
aratz-lasa wants to merge 3 commits intomainfrom
feature/alias-and-checkout

Conversation

@aratz-lasa
Copy link
Collaborator

  • Add opp alias command to create, delete, rename, and list PR aliases
  • Add opp checkout command with fzf integration for quick branch switching
  • Aliases work with native git commands via symrefs
  • Show aliases in opp status output
  • Clean up aliases when PRs are merged

@aratz-lasa aratz-lasa force-pushed the feature/alias-and-checkout branch from 4f60200 to 2b60c09 Compare February 6, 2026 16:56
This adds:
- `opp alias` command to create, delete, list, and rename symbolic-ref
  aliases that point to PR branches (e.g., `opp alias myfeature 123`)
- `opp checkout` command to switch to PR branches by number or alias,
  with interactive fzf selection when no argument is provided
- Alias resolution in PR commands, so you can use aliases in place of
  PR numbers (e.g., `opp push myfeature`)
- Alias display in `opp status` output
- Automatic cleanup of aliases when PRs are merged

Aliases work seamlessly with native git commands too:
  git checkout myfeature  # works after creating alias

Co-authored-by: Cursor <cursoragent@cursor.com>
@aratz-lasa aratz-lasa force-pushed the feature/alias-and-checkout branch from 2b60c09 to 2044fdb Compare February 9, 2026 06:35
aratz-lasa and others added 2 commits February 9, 2026 07:52
Replace go-git plumbing usage with direct git commands:
- symbolic-ref for creating/reading symbolic refs
- show-ref for checking ref existence
- update-ref for deleting refs
- for-each-ref for listing refs

This ensures compatibility with the upcoming go-git removal (pr/234).

Co-authored-by: Cursor <cursoragent@cursor.com>
- ListAliases now uses a single git for-each-ref with %(symref) instead
  of running git symbolic-ref for every branch (was O(n) git commands)
- fzf arguments with spaces are now properly quoted for shell execution
- fzf now uses temp file + stdin preservation for proper TTY interaction

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant

Comments