diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-07-09 01:17:09 -0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-07-09 01:17:09 -0400 |
commit | 0b81261622afad691501ee51d7811048cf4a5fce (patch) | |
tree | 0b2862469d7a162e11063bd2fe301c45331c27d2 /lib/branch.tcl | |
parent | git-gui: Show a progress meter for checking out files (diff) | |
download | tgif-0b81261622afad691501ee51d7811048cf4a5fce.tar.xz |
git-gui: Always use absolute path to all git executables
Rather than making the C library search for git every time we want
to execute it we now search for the main git wrapper at startup, do
symlink resolution, and then always use the absolute path that we
found to execute the binary later on. This should save us some
cycles, especially on stat challenged systems like Cygwin/Win32.
While I was working on this change I also converted all of our
existing pipes ([open "| git ..."]) to use two new pipe wrapper
functions. These functions take additional options like --nice
and --stderr which instructs Tcl to take special action, like
running the underlying git program through `nice` (if available)
or redirect stderr to stdout for capture in Tcl.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/branch.tcl')
-rw-r--r-- | lib/branch.tcl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/branch.tcl b/lib/branch.tcl index b948d926ae..777eeb79c1 100644 --- a/lib/branch.tcl +++ b/lib/branch.tcl @@ -7,7 +7,7 @@ proc load_all_heads {} { set rh refs/heads set rh_len [expr {[string length $rh] + 1}] set all_heads [list] - set fd [open "| git for-each-ref --format=%(refname) $rh" r] + set fd [git_read for-each-ref --format=%(refname) $rh] while {[gets $fd line] > 0} { if {!$some_heads_tracking || ![is_tracking_branch $line]} { lappend all_heads [string range $line $rh_len end] @@ -20,7 +20,10 @@ proc load_all_heads {} { proc load_all_tags {} { set all_tags [list] - set fd [open "| git for-each-ref --sort=-taggerdate --format=%(refname) refs/tags" r] + set fd [git_read for-each-ref \ + --sort=-taggerdate \ + --format=%(refname) \ + refs/tags] while {[gets $fd line] > 0} { if {![regsub ^refs/tags/ $line {} name]} continue lappend all_tags $name |