summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 37af79d)
raw | patch | inline | side by side (parent: 37af79d)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 7 Nov 2006 09:26:02 +0000 (04:26 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 7 Nov 2006 09:26:02 +0000 (04:26 -0500) |
We're likely going to need key/value pairs from the repo-config beyond
just remote.*.url, so cache them all up front into a Tcl array where we
have fast access to them without needing to refork a repo-config --list
process.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
just remote.*.url, so cache them all up front into a Tcl array where we
have fast access to them without needing to refork a repo-config --list
process.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index adc89474a772a10693790d06fbd1740fdef9c04c..de67aa2a68e43ebc4c29b8ba8ac775fb8b1f2997 100755 (executable)
--- a/git-gui
+++ b/git-gui
##
## config (fetch push pull)
+proc load_repo_config {} {
+ global repo_config
+
+ array unset repo_config
+ catch {
+ set fd_rc [open "| git repo-config --list" r]
+ while {[gets $fd_rc line] >= 0} {
+ if {[regexp {^([^=]+)=(.*)$} $line line name value]} {
+ lappend repo_config($name) $value
+ }
+ }
+ close $fd_rc
+ }
+}
+
proc load_all_remotes {} {
- global gitdir all_remotes
+ global gitdir all_remotes repo_config
set all_remotes [list]
set rm_dir [file join $gitdir remotes]
-directory $rm_dir *]]
}
- set fd_rc [open "| git repo-config --list" r]
- while {[gets $fd_rc line] >= 0} {
- if {[regexp ^remote\.(.*)\.url= $line line name]} {
+ foreach line [array names repo_config remote.*.url] {
+ if {[regexp ^remote\.(.*)\.url\$ $line line name]} {
lappend all_remotes $name
}
}
- close $fd_rc
set all_remotes [lsort -unique $all_remotes]
}
wm title . "$appname ([file normalize [file dirname $gitdir]])"
focus -force $ui_comm
+load_repo_config
load_all_remotes
populate_remote_menu .mbar.fetch From fetch_from
populate_remote_menu .mbar.push To push_to