summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 91464df)
raw | patch | inline | side by side (parent: 91464df)
author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 18 Jul 2007 02:31:16 +0000 (22:31 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 18 Jul 2007 02:31:16 +0000 (22:31 -0400) |
Not every caller of 'git' or 'git_pipe' wants to use nice to lower the
priority of the process its executing. In many cases we may never use
the nice process to launch git. So we can avoid searching our $PATH
to locate a suitable nice if we'll never actually use it.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
priority of the process its executing. In many cases we may never use
the nice process to launch git. So we can avoid searching our $PATH
to locate a suitable nice if we'll never actually use it.
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 ebc270866e2b918012b1d1bd758c3dba95b951b9..5ca946a184f0b015ed6bd77f0f071a2cbc6251ff 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
return {}
}
+proc _lappend_nice {cmd_var} {
+ global _nice
+ upvar $cmd_var cmd
+
+ if {![info exists _nice]} {
+ set _nice [_which nice]
+ }
+ if {$_nice ne {}} {
+ lappend cmd $_nice
+ }
+}
+
proc git {args} {
set opt [list exec]
while {1} {
switch -- [lindex $args 0] {
--nice {
- global _nice
- if {$_nice ne {}} {
- lappend opt $_nice
- }
+ _lappend_nice opt
}
default {
while {1} {
switch -- [lindex $args 0] {
--nice {
- global _nice
- if {$_nice ne {}} {
- lappend opt $_nice
- }
+ _lappend_nice opt
}
--stderr {
while {1} {
switch -- [lindex $args 0] {
--nice {
- global _nice
- if {$_nice ne {}} {
- lappend opt $_nice
- }
+ _lappend_nice opt
}
default {
error_popup "Cannot find git in PATH."
exit 1
}
-set _nice [_which nice]
######################################################################
##