summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb616dd)
raw | patch | inline | side by side (parent: bb616dd)
author | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 12 Mar 2007 17:24:10 +0000 (13:24 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 12 Mar 2007 17:26:06 +0000 (13:26 -0400) |
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>
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>
git-gui.sh | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index 2888864e49d3feb4ac9d0f156163a26944a2fc81..60e79ca1b01bc8b057abe17ddab484699a7f5fdb 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
##
## version check
+if {{--version} eq $argv || {version} eq $argv} {
+ puts "git-gui version $appvers"
+ exit
+}
+
set req_maj 1
set req_min 5
enable_option transport
switch -- $subcommand {
---version -
-version -
browser -
blame {
disable_option multicommit
# -- 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"