summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d164b75)
raw | patch | inline | side by side (parent: d164b75)
author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 18 Jul 2007 03:09:31 +0000 (23:09 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 18 Jul 2007 03:09:31 +0000 (23:09 -0400) |
Some users may do odd things, like tag their own private version of
Git with an annotated tag such as 'testver', then compile that git
and try to use it with git-gui. In such a case `git --version` will
give us 'git version testver', which is not a numeric argument that
we can pass off to our version comparsion routine.
We now check that the cleaned up git version is a going to pass the
version comparsion routine without failure. If it has a non-numeric
component, or lacks at least a minor revision then we ask the user to
confirm they really want to use this version of git within git-gui.
If they do we shall assume it is git 1.5.0 and run with only the code
that will support.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Git with an annotated tag such as 'testver', then compile that git
and try to use it with git-gui. In such a case `git --version` will
give us 'git version testver', which is not a numeric argument that
we can pass off to our version comparsion routine.
We now check that the cleaned up git version is a going to pass the
version comparsion routine without failure. If it has a non-numeric
component, or lacks at least a minor revision then we ask the user to
confirm they really want to use this version of git within git-gui.
If they do we shall assume it is git 1.5.0 and run with only the code
that will support.
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 cd2b09372308e5ab6459920f682e66cb61c7b5df..2127557f9d595020765dbf318051375be8c7e390 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
error_popup "Cannot parse Git version string:\n\n$_git_version"
exit 1
}
+
+set _real_git_version $_git_version
regsub -- {-dirty$} $_git_version {} _git_version
regsub {\.[0-9]+\.g[0-9a-f]+$} $_git_version {} _git_version
regsub {\.rc[0-9]+$} $_git_version {} _git_version
regsub {\.GIT$} $_git_version {} _git_version
+if {![regexp {^[1-9]+(\.[0-9]+)+$} $_git_version]} {
+ catch {wm withdraw .}
+ if {[tk_messageBox \
+ -icon warning \
+ -type yesno \
+ -default no \
+ -title "[appname]: warning" \
+ -message "Git version cannot be determined.
+
+$_git claims it is version '$_real_git_version'.
+
+[appname] requires at least Git 1.5.0 or later.
+
+Assume '$_real_git_version' is version 1.5.0?
+"] eq {yes}} {
+ set _git_version 1.5.0
+ } else {
+ exit 1
+ }
+}
+unset _real_git_version
+
proc git-version {args} {
global _git_version
}
lock_index begin-read
+if {![winfo ismapped .]} {
+ wm deiconify .
+}
after 1 do_rescan