Skip to content

Conversation

@sei40kr
Copy link
Contributor

@sei40kr sei40kr commented Jan 19, 2026

Summary

Converts the merge operation to use the interactive picker interface for a more consistent user experience.

Changes

  • Modified src/ops/merge.rs to implement interactive picker for merge operations
  • Added comprehensive tests in src/tests/merge.rs covering various picker scenarios
  • Includes test snapshots for picker UI validation

Test plan

  • Unit tests pass with new interactive picker implementation
  • Picker correctly displays merge options
  • Custom input handling works as expected
  • Cancel operation functions properly

🤖 Generated with Claude Code

@sei40kr sei40kr force-pushed the feat/merge-interactive-picker branch from 02e0932 to 714b6a9 Compare January 19, 2026 06:02
- Convert Merge operation to use interactive picker with fuzzy search
- Add comprehensive test coverage with 5 test cases
- Exclude current branch from merge target list
- Support custom input for commit hashes and relative refs
- All tests verify operations execute correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@sei40kr sei40kr force-pushed the feat/merge-interactive-picker branch from 714b6a9 to f93ec22 Compare January 19, 2026 06:10
@sei40kr sei40kr marked this pull request as draft January 19, 2026 07:05
@sei40kr
Copy link
Contributor Author

sei40kr commented Jan 19, 2026

I reverted the PR to draft.
I noticed that when merging, both branches and tags are displayed, potentially causing duplicate ref shorthands.
Furthermore, display names should be determined considering potential duplication with the currently selected ref, so this requires significant refactoring.

…picker

- Exclude current ref from merge picker whether it's a branch, tag, or remote

- Add RefKind::to_full_refname() and shorthand() helper methods

- Handle duplicate branch/tag names with refs/ prefixes

- Use full refnames for git merge when duplicates exist

- Add comprehensive tests for edge cases with duplicate names
Consolidate the logic for converting git2::Reference to RefKind by
adding a from_reference() method. This removes duplicate code across
merge.rs and show_refs.rs.
Add PickerState::with_refs method to encapsulate the complex logic
of building a picker from git references. This method automatically
handles duplicate detection, sorting (default -> branches -> tags ->
remotes), and filtering of excluded references.

Simplify merge.rs by delegating the picker construction logic to the
new with_refs method, reducing code complexity from ~110 lines to
~50 lines.
@sei40kr sei40kr marked this pull request as ready for review January 19, 2026 11:11
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