Skip to content

Conversation

@gschier
Copy link
Member

@gschier gschier commented Jan 26, 2026

This PR adds cloning, ports git branch operations from libgit2 to use the git binary directly, and significantly enhances the Git dropdown with new features and UX improvements.

CleanShot 2026-01-26 at 08 32 01

Git Clone

It is now possible to clone a new repository into Yaak, instead of having to clone via CLI and open in Yaak.
CleanShot 2026-01-26 at 10 30 06

Git Operations

  • Ported to git binary: checkout, create branch, delete branch, merge, and rename operations now use the git CLI instead of libgit2
  • New operations:
    • Rename branch (git branch -m)
    • Delete remote branch (git push origin --delete)
    • Create branch from a specific base (git branch <name> <base>)

Git Dropdown Enhancements

  • Branch submenus: Local and remote branches now have submenus with contextual actions
  • Local branch actions: Checkout, Merge, New Branch, Rename, Delete
  • Remote branch actions: Checkout, Delete

- Rewrite checkout, create, delete, and merge branch operations to use
  the git CLI instead of git2 library
- This fixes the 'cannot locate local branch' error when checking out
  remote branches that haven't been fetched yet, since git CLI handles
  this automatically
- Remove merge.rs and unused get_branch_by_name helper
- Make branch functions async to match other git operations
Git dropdown:
- Add branch rename functionality
- Add 'New Branch...' option in branch submenus (creates from selected branch)
- Add delete remote branch functionality
- Branch submenus now open on click instead of hover
- Add ellipses to menu items that open dialogs (View History..., etc.)
- Fix 'UNKNOWN' branch flash while loading

Dropdown component:
- Add submenuOpenOnClick option for click-to-open submenus
- Submenus now close entire menu hierarchy when item selected
- Submenus flip upward when near bottom of screen
- Filter cleared when dropdown opens

useFastMutation:
- Default onSuccess/onError callbacks now run alongside custom ones
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates git branch operations from libgit2 to the git CLI binary and significantly enhances the Git dropdown UI with new features including branch submenus with contextual actions.

Changes:

  • Migrated git operations (checkout, create branch, delete branch, merge, rename) from libgit2 to git binary
  • Added new git operations: rename branch, delete remote branch, create branch from a specific base
  • Enhanced Git dropdown with branch submenus containing contextual actions (checkout, merge, new branch, rename, delete)
  • Improved dropdown component with click-to-open submenu support and better positioning logic
  • Updated callback handling in useFastMutation to run both default and custom callbacks

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src-web/hooks/useFastMutation.ts Modified callback handling to execute both default and custom callbacks sequentially
src-web/components/git/GitDropdown.tsx Replaced top-level git actions with branch-specific submenus, added new branch operations (rename, delete remote), removed old branch management UI
src-web/components/core/Dropdown.tsx Added submenuOpenOnClick feature, onCloseAll callback propagation, filter clearing on open, and improved submenu positioning
crates/yaak-git/src/util.rs Removed unused get_branch_by_name function
crates/yaak-git/src/merge.rs Deleted entire file as merge logic is now handled by git binary
crates/yaak-git/src/lib.rs Removed merge module, updated exports to include new branch operations and BranchDeleteResult type
crates/yaak-git/src/branch.rs Rewrote all branch operations to use git CLI instead of libgit2, added git_rename_branch and git_delete_remote_branch functions
crates/yaak-git/index.ts Updated TypeScript bindings for new branch operations API signatures
crates/yaak-git/bindings/gen_git.ts Added BranchDeleteResult TypeScript type definition
crates-tauri/yaak-app/src/lib.rs Registered new git commands for rename and delete remote branch
crates-tauri/yaak-app/src/git_ext.rs Added command handlers for new branch operations, updated signatures to match new async functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gschier gschier merged commit 47a3d44 into main Jan 26, 2026
4 checks passed
@gschier gschier deleted the port-branch-ops-to-git-binary branch January 26, 2026 22:45
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.

2 participants