Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-03-12 20:24:10 +0300
committerShawn O. Pearce <spearce@spearce.org>2007-03-12 20:26:06 +0300
commit756d846fea4ac4b3bf0a0aea9fbf721138cf34cc (patch)
treee0cbc534cdc234e788f9be69344736d42c74615f
parentbb616ddd159508e6c6469626d494a69e28da7032 (diff)
git-gui: Allow 'git gui version' outside of a repositorygitgui-0.6.4
I got a little surprise one day when I tried to run 'git gui version' outside of a Git repository to determine what version of git-gui was installed on that system. Turns out we were doing the repository check long before we got around to command line argument handling. We now look to see if the only argument we have been given is 'version' or '--version', and if so, print out the version and exit immediately; long before we consider looking at the Git version or working directory. This way users can still get to the git-gui version number even if Git's version cannot be read. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-xgit-gui.sh12
1 files changed, 5 insertions, 7 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 2888864e49..60e79ca1b0 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -299,6 +299,11 @@ proc ask_popup {msg} {
##
## version check
+if {{--version} eq $argv || {version} eq $argv} {
+ puts "git-gui version $appvers"
+ exit
+}
+
set req_maj 1
set req_min 5
@@ -5054,8 +5059,6 @@ enable_option branch
enable_option transport
switch -- $subcommand {
---version -
-version -
browser -
blame {
disable_option multicommit
@@ -5426,11 +5429,6 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]}
# -- Not a normal commit type invocation? Do that instead!
#
switch -- $subcommand {
---version -
-version {
- puts "git-gui version $appvers"
- exit
-}
browser {
if {[llength $argv] != 1} {
puts stderr "usage: $argv0 browser commit"