Skip to content

Add Fetch and Prune menu items - #572

Merged
hannesa2 merged 2 commits into
gitx:masterfrom
goneng:add-menu-item-fetch-and-prune
Aug 18, 2026
Merged

hannesa2 merged 2 commits into
gitx:masterfrom
goneng:add-menu-item-fetch-and-prune

Conversation

@goneng

@goneng goneng commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Expose prune as a command of its own, so a one-off prune no longer means
flipping the global "Prune on fetch" preference back and forth.

  • Offer Fetch "origin" and Prune in the ref context menus, right after
    the plain fetch item, and add Fetch and Prune plus Fetch All and Prune to the Repository menu.
  • Thread a force-prune override down to the fetch task. An explicit
    invocation passes --prune in every preference state, including
    "Never prune", since a deliberate action should beat a default.
  • Fix a pre-existing silent no-op first, in its own commit: the fetch
    action rejected remote-branch refs, so an enabled Fetch "origin" on
    a remote branch did nothing at all - no fetch, no sheet, no error.

Test plan:

  • New GitXTests cover the fetch argument matrix: the preference alone
    decides without the override, the override wins in all three
    preference states, and the flag precedes the remote name.
  • Repository menu checked through accessibility on a Debug build:
    Fetch, Fetch and Prune, Fetch All, Fetch All and Prune, in
    that order, with the new nib connections in place.
  • Not verified locally: the retitled Fetch "origin" and Prune with a
    live sidebar selection, and an end-to-end prune dropping a stale
    remote branch. GitX windows are not reachable by accessibility on
    this machine.

goneng added 2 commits August 18, 2026 00:30
Let the fetch action accept remote-branch refs, so the menu item does
what its title already promises.

- Right-clicking a remote branch offers an enabled Fetch "origin",
  since the item is gated on the ref having a remote name, but
  fetchRemote: only accepted branch and remote refishes. A remote
  branch reports its own refish type, so refishForSender: returned nil
  and the action bailed out with no fetch, no sheet and no error. The
  Repository menu fails the same way, as selectedRef only rewrites a
  row to its remote when the row sits directly under Remotes.
- Accept kGitXRemoteBranchType as well. Everything downstream already
  copes with these refs and resolves them to their remote name.
Expose 'prune' as a command of its own, so a one-off prune no longer
means flipping the global preference back and forth.

- Offer 'Fetch "origin" and Prune' in the ref context menus, right after
  the plain fetch item, and add 'Fetch and Prune' plus
  'Fetch All and Prune' to the Repository menu.
- Thread a force-prune override down to the fetch task.
  An explicit invocation passes '--prune' in every preference state,
  including "Never prune", since a deliberate action should beat a default.
- Cover the resulting argument matrix in GitXTests, which needs the
  app's prefix header so the test target can import GitX headers.
@hannesa2
hannesa2 merged commit 41d8e78 into gitx:master Aug 18, 2026
3 checks passed
@goneng
goneng deleted the add-menu-item-fetch-and-prune branch August 18, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants