Skip to content

feat: allow remote selection in git menu#349

Merged
idursun merged 10 commits intoidursun:mainfrom
baggiiiie:git-multi-remote
Oct 26, 2025
Merged

feat: allow remote selection in git menu#349
idursun merged 10 commits intoidursun:mainfrom
baggiiiie:git-multi-remote

Conversation

@baggiiiie
Copy link
Copy Markdown
Collaborator

@baggiiiie baggiiiie commented Oct 23, 2025

summary

display remotes setup in the repo, allow tab to cycle select remotes in git menu
see issue #261

feature

  • remotes display under Title in git menu

  • --remote option is added to git operation (except those with existing --remote option or --all-remotes option

  • when no remote is configured for the repo

    • error message NO REMOTE FOUND is displayed
    • "" empty string is attached to --remote
    • action in the git menu fails gracefully with remote unfound message. (e.g., push action becomes git push --remote "")
  • pressing tab and shift+tab cycles through the list of remotes

    • as remotes being cycled through, items in git menu gets auto updated with selected remote
    • if a filter state is already in place, cycling through the list will not reset filter
  • with jjui/config.toml, user can config a default remote.

    • default for defaultRemote is origin, configured in internal/config/default/config.toml

implementation

  • added subtitle field to menu, display of menu with/without subtitle is handled by renderTitle
  • added style for subtitle
  • added GitRemoteList to run jj git remote list to fetch a list of remotes
  • added remote_parser to parse the list of remotes
  • added remoteNames, selectedRemoteIdx, style fields to git Model, to handle remotes and subtitle style
  • refactored NewModel method, separated menu list generation logic and git Model creation logic
  • added relevant tests for remote_parser, updated tests in git_test.go to expect a --remote flag

others

UI

image image image image

@baggiiiie baggiiiie changed the title feat: allow mult-remote selection in git menu feat: allow remote selection in git menu Oct 23, 2025
Copy link
Copy Markdown
Owner

@idursun idursun left a comment

Choose a reason for hiding this comment

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

Hey thanks for this.

This looks good but there's one inconvenience. For example in my remotes I would expect origin to be the first one in the list because that was the previous behaviour and also it is the most common thing I do. However, I am getting this list instead and this would require me to hit tab every single time.

image

Would you be able to make a change so that origin is always the first one?

@baggiiiie
Copy link
Copy Markdown
Collaborator Author

hey @idursun thanks for the feedback!

good catch on this!
i also notice that in your theme setup, baggiiiie has an space behind it got highlighted, will look into this too!

@baggiiiie
Copy link
Copy Markdown
Collaborator Author

baggiiiie commented Oct 25, 2025

solution with showing origin as the first option is having a default git remote config (defaulted to origin in internal/config/default/config.toml).

this also aligns with what @lorenzleutgeb mentioned in #261:

Is there a way to configure the name of the "default" remote?

@baggiiiie baggiiiie requested a review from idursun October 25, 2025 07:38
Copy link
Copy Markdown
Owner

@idursun idursun left a comment

Choose a reason for hiding this comment

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

Thank you very much!

@idursun idursun merged commit 1dcf76d into idursun:main Oct 26, 2025
3 checks passed
@baggiiiie baggiiiie deleted the git-multi-remote branch October 26, 2025 13:52
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 24, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [idursun/jjui](https://github.com/idursun/jjui) | patch | `v0.9.5` -> `v0.9.6` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>idursun/jjui (idursun/jjui)</summary>

### [`v0.9.6`](https://github.com/idursun/jjui/releases/tag/v0.9.6)

[Compare Source](idursun/jjui@v0.9.5...v0.9.6)

Another community driven release, mostly focusing on every day improvements.

#### What's Changed

- fix(ace\_jump): close operation after applying jump by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;351](idursun/jjui#351)
- feat: auto-detect preview placement, on by default by [@&#8203;lbonn](https://github.com/lbonn) in [#&#8203;348](idursun/jjui#348)
- feat: allow remote selection in git menu by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;349](idursun/jjui#349)
- fix(fuzzy\_files): quote path for editor command by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;354](idursun/jjui#354)
- fix for preview copied status file and filename with {}  by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;357](idursun/jjui#357)
- Support interactive file-level restores by [@&#8203;remo5000](https://github.com/remo5000) in [#&#8203;365](idursun/jjui#365)
- fuzzy\_files: remove quoting for files in revset by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;370](idursun/jjui#370)
- ui/git: add --tracked to git fetch by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;368](idursun/jjui#368)
- operation: add ForceApply to squash/rebase footer by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;371](idursun/jjui#371)
- abandon: add force apply to footer help menu by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;373](idursun/jjui#373)
- docs(README): add winget and scoop as installation method in Windows by [@&#8203;abgox](https://github.com/abgox) in [#&#8203;362](idursun/jjui#362)
- fix(set\_parents): keep parent order by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;375](idursun/jjui#375)
- fix(light theme): Removed the default border style of `bright white` as it was overriding the `text` style which should be the terminal’s default foreground and background.

#### New Contributors

- [@&#8203;lbonn](https://github.com/lbonn) made their first contribution in [#&#8203;348](idursun/jjui#348)
- [@&#8203;remo5000](https://github.com/remo5000) made their first contribution in [#&#8203;365](idursun/jjui#365)
- [@&#8203;abgox](https://github.com/abgox) made their first contribution in [#&#8203;362](idursun/jjui#362)

**Full Changelog**: <idursun/jjui@v0.9.5...v0.9.6>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOS4wIiwidXBkYXRlZEluVmVyIjoiNDIuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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