git-gui: Basic version check to ensure git 1.5.0 or later is used.
This is a very crude (but hopefully effective) check against the `git` executable found in our PATH. Some of the subcommands and options that git-gui requires to be present to operate were created during the 1.5.0 development cycle, so 1.5 is the minimum version of git that we can expect to support. There actually are early releases of 1.5 (e.g. 1.5.0-rc0) that don't have everything we expect (like `blame --incremental`) but these are purely academic at this point. 1.5.0 final was tagged and released just a few hours ago. The release candidates will (hopefully) fade into the dark quickly. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Feb 13, 2007 at 23:15 UTC
54acdd95b81d3675381a749e7cd7fc14956853c3
1 file changed
+32
git-gui.sh
+32
@@ -295,6 +295,38 @@ proc ask_popup {msg} {
295
-message $msg]
296
}
297
298
+######################################################################
299
+##
300
+## version check
301
+
302
+set req_maj 1
303
+set req_min 5
304
+
305
+if {[catch {set v [git --version]} err]} {
306
+ catch {wm withdraw .}
307
+ error_popup "Cannot determine Git version:
308
+
309
+$err
310
+
311
+[appname] requires Git $req_maj.$req_min or later."
312
+ exit 1
313
+}
314
+if {[regexp {^git version (\d+)\.(\d+)} $v _junk act_maj act_min]} {
315
+ if {$act_maj < $req_maj
316
+ || ($act_maj == $req_maj && $act_min < $req_min)} {
317
+ catch {wm withdraw .}
318
+ error_popup "[appname] requires Git $req_maj.$req_min or later.
319
+
320
+You are using $v."
321
+ exit 1
322
+ }
323
+} else {
324
+ catch {wm withdraw .}
325
+ error_popup "Cannot parse Git version string:\n\n$v"
326
+ exit 1
327
+}
328
+unset -nocomplain v _junk act_maj act_min req_maj req_min
329
+
330
######################################################################
331
##
332
## repository setup