Commit cfaf9e3
committed
UpdaterFrame: remove eager git executable check
Unfortunately, on macOS, trying to invoke git (which will be
/usr/bin/git on a fresh system) triggers Apple's wonderful "you ran
a command line tool for something that isn't installed so we're going to
pop a graphical dialog in response" genius tactic, made most famous in
our community previously by doing that in response to attempting to
breathe on Apple Java's shared library without it being installed.
Let's not make it so that every single Mac user is prompted to install
the Xcode developer command line tools just to update their ImageJ2.
"But Curtis!" you might ask. "What happens if git is not available on a
particular system, and you are no longer checking for it up front? Does
everything crash and burn?" It turns out everything is OK.
What happens is: if you click "Show changes" to pop the diff dialog,
then click the "Hex Diff" or "Class File Diff" button, the output pane
will show many errors of the form:
/Java-8/jars/imagej-updater-0.10.7.jar-20220314155634
java.lang.RuntimeException: java.io.IOException: Cannot run program "git": error=2, No such file or directory
at org.scijava.util.ProcessUtils.exec(ProcessUtils.java:135)
at org.scijava.util.ProcessUtils.exec(ProcessUtils.java:69)
at net.imagej.updater.Diff.showDiff(Diff.java:273)
at net.imagej.updater.Diff.showDiff(Diff.java:195)
at net.imagej.ui.swing.updater.DiffFile$2.run(DiffFile.java:134)
at net.imagej.ui.swing.updater.DiffFile$3.run(DiffFile.java:160)
which IMHO is good enough to clue in savvy people that they need git.
Because most people won't click on buttons with those labels.
If someone complains, we can make the error handling more pleasing then.1 parent 14958f6 commit cfaf9e3
File tree
1 file changed
+23
-34
lines changed- src/main/java/net/imagej/ui/swing/updater
1 file changed
+23
-34
lines changedLines changed: 23 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | 126 | | |
136 | 127 | | |
137 | 128 | | |
| |||
339 | 330 | | |
340 | 331 | | |
341 | 332 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
352 | 338 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
363 | 352 | | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
368 | 357 | | |
369 | 358 | | |
370 | 359 | | |
| |||
610 | 599 | | |
611 | 600 | | |
612 | 601 | | |
613 | | - | |
| 602 | + | |
614 | 603 | | |
615 | 604 | | |
616 | 605 | | |
| |||
0 commit comments