Skip to content

Fix the recents list failing silently, and find Homebrew's git on Apple Silicon - #616

Merged
hannesa2 merged 2 commits into
masterfrom
fix-silent-failure-from-recents
Sep 13, 2026
Merged

hannesa2 merged 2 commits into
masterfrom
fix-silent-failure-from-recents

Conversation

@goneng

@goneng goneng commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Fixes #603, which is two separate faults.

The recents popup swallowed the error. Both call sites handed
openDocumentWithContentsOfURL:display:completionHandler: an empty
completion handler, and that method leaves presentation to the caller, so
a repository that failed to open took the popup down and put nothing in
its place. The same repository opened from the File menu says what went
wrong, which is the asymmetry in the report.

/opt/homebrew/bin/git was not searched. The list predates Apple
Silicon: MacPorts, Fink, /usr/local, ~/bin, /usr/bin, but not the
prefix Homebrew uses on ARM. With /usr/bin/git refusing to run until the
Xcode licence is accepted, there was nothing left to find. The error the
user is shown is built from that same list, so it now names it too.

Test plan

  • make unit-test: 68 tests, 0 failures, 5 of them new
  • Both fixes confirmed red first: testTheHomebrewPrefixesAreBothSearched
    fails without the added path, and the recents test fails when the
    completion handler is put back the way it was
  • Reproduced the silent failure by opening a repository, then moving its
    .git aside so the recents entry no longer resolves: before, selecting
    it opened nothing and said nothing; now it shows the same alert as the
    File menu

I could not stage the reporter's actual trigger, since /usr/bin/git is
protected and cannot be made to fail a licence check, so the discovery
half rests on the code and the test. An artifact from this PR would let
@johndouthat confirm it on the machine that has the problem.

Picking a repository in the Open Recent window handed the document
controller an empty completion handler, so a repository that could not
be opened took the window down and put nothing in its place, while the
same repository opened from the File menu says what went wrong.

* Report the error the document controller hands back, the way the
  application delegate already does for files opened from the Finder
* Open the selection in one place rather than once per key and once per
  double click
The search locations were written before Apple Silicon and name every
prefix but /opt/homebrew, so a Mac whose /usr/bin/git refuses to run
until the Xcode licence is accepted has no git GitX will accept, even
with a working one installed.

* Look in /opt/homebrew/bin ahead of the older prefixes, since that is
  where Homebrew installs on Apple Silicon
* The error the user is shown lists these locations, so it now names
  the one they are most likely to have
@goneng
goneng force-pushed the fix-silent-failure-from-recents branch from b2e6ca3 to 7b7a6ce Compare September 13, 2026 06:43
@hannesa2

Copy link
Copy Markdown
Contributor

Screenshot differs: emulatorApi=arm64 with 4 screenshot(s)

setpoint (old) | diff | actual screenshot (new)

00-commit-context-menu.pngscreenshot

01-history-view.pngscreenshot

02-main-window.pngscreenshot

03-staging-view.pngscreenshot

@goneng
goneng marked this pull request as ready for review September 13, 2026 07:24
@hannesa2
hannesa2 merged commit cf342c1 into master Sep 13, 2026
3 checks passed
@hannesa2
hannesa2 deleted the fix-silent-failure-from-recents branch September 13, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opening a repo silently fails when Apple Git is blocked by Xcode license acceptance

2 participants